diff --git a/requirements.txt b/requirements.txt index 1f5cc9ed..c6b7ba57 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,8 +16,8 @@ psutil==5.9.8 pykakasi==2.3.0 pycaw==20240210 websockets==15.0.1 -huggingface-hub==0.31.2 -hf-xet==1.1.2 +huggingface_hub[hf-xet] +setuptools==80.8.0 translators @ git+https://github.com/misyaguziya/translators@5.9.2.1 SpeechRecognition @ git+https://github.com/misyaguziya/custom_speech_recognition@3.10.4.1 tinyoscquery @ git+https://github.com/cyberkitsune/tinyoscquery@0.1.3 \ No newline at end of file diff --git a/requirements_cuda.txt b/requirements_cuda.txt index 347031cd..00293ea3 100644 --- a/requirements_cuda.txt +++ b/requirements_cuda.txt @@ -17,8 +17,8 @@ psutil==5.9.8 pykakasi==2.3.0 pycaw==20240210 websockets==15.0.1 -huggingface-hub==0.31.2 -hf-xet==1.1.2 +huggingface[hub] +setuptools==80.8.0 translators @ git+https://github.com/misyaguziya/translators@5.9.2.1 SpeechRecognition @ git+https://github.com/misyaguziya/custom_speech_recognition@3.10.4.1 tinyoscquery @ git+https://github.com/cyberkitsune/tinyoscquery@0.1.3 \ No newline at end of file diff --git a/src-python/mainloop.py b/src-python/mainloop.py index f5e2318b..c2429a58 100644 --- a/src-python/mainloop.py +++ b/src-python/mainloop.py @@ -7,9 +7,17 @@ from threading import Thread from queue import Queue import warnings warnings.filterwarnings('ignore') -huggingface_cache_dir = os.path.join(os.path.dirname(__file__), ".cache") -os.makedirs(huggingface_cache_dir, exist_ok=True) -os.environ["HF_HOME"] = os.path.join(huggingface_cache_dir) + +if getattr(sys, 'frozen', False): + cache_dir = os.path.join(os.path.dirname(sys.executable), ".cache") + hub_dir = os.path.join(os.path.dirname(sys.executable), ".cache", "hub") +else: + cache_dir = os.path.join(os.path.dirname(__file__), ".cache") + hub_dir = os.path.join(os.path.dirname(__file__), ".cache", "hub") + +os.makedirs(cache_dir, exist_ok=True) +os.makedirs(hub_dir, exist_ok=True) +os.environ["HF_HOME"] = os.path.join(cache_dir) from controller import Controller from utils import printLog, printResponse, errorLogging, encodeBase64