Skip to content

Commit

Permalink
fix/initial model dl (#9)
Browse files Browse the repository at this point in the history
plugin failed to load on first boot when attempting to download a model without internet
  • Loading branch information
JarbasAl authored Nov 11, 2022
1 parent 808527c commit f3103da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ovos_stt_plugin_vosk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import json
from time import sleep
from os.path import join, exists
from ovos_plugin_manager.templates.stt import STT, StreamThread, StreamingSTT
from ovos_skill_installer import download_extract_zip, download_extract_tar
from ovos_utils.log import LOG
from ovos_utils.network_utils import is_connected
from ovos_utils.xdg_utils import xdg_data_home
from queue import Queue
from speech_recognition import AudioData
Expand Down Expand Up @@ -134,6 +136,10 @@ def download_model(url):
name = url.split("/")[-1].split(".")[0]
model_path = join(folder, name)
if not exists(model_path):
while not is_connected():
LOG.info("Waiting for internet in order to download vosk language model")
# waiting for wifi setup most likely
sleep(10)
LOG.info(f"Downloading model for vosk {url}")
LOG.info("this might take a while")
if url.endswith(".zip"):
Expand Down

0 comments on commit f3103da

Please sign in to comment.