Spaces:
Runtime error
Runtime error
Fix folder paths
Browse files- services/audio.py +1 -1
- services/gcp.py +2 -2
- services/utils.py +1 -1
services/audio.py
CHANGED
@@ -20,7 +20,7 @@ os.environ['COQUI_TOS_AGREED'] = '1'
|
|
20 |
|
21 |
# Used to generate audio based on a sample
|
22 |
nltk.download('punkt')
|
23 |
-
model_path = os.path.join("
|
24 |
|
25 |
config = XttsConfig()
|
26 |
config.load_json(os.path.join(model_path, "config.json"))
|
|
|
20 |
|
21 |
# Used to generate audio based on a sample
|
22 |
nltk.download('punkt')
|
23 |
+
model_path = os.path.join("tts_model")
|
24 |
|
25 |
config = XttsConfig()
|
26 |
config.load_json(os.path.join(model_path, "config.json"))
|
services/gcp.py
CHANGED
@@ -11,10 +11,10 @@ def download_credentials() -> None:
|
|
11 |
Downloads the GCP credentials from Hugging Face Hub
|
12 |
:return: None
|
13 |
"""
|
14 |
-
os.makedirs('
|
15 |
hf_hub_download(
|
16 |
repo_id=os.environ.get('DATA'), repo_type='dataset', filename="credentials.json",
|
17 |
-
token=os.environ.get('HUB_TOKEN'), local_dir="
|
18 |
)
|
19 |
return
|
20 |
|
|
|
11 |
Downloads the GCP credentials from Hugging Face Hub
|
12 |
:return: None
|
13 |
"""
|
14 |
+
os.makedirs('assets', exist_ok=True)
|
15 |
hf_hub_download(
|
16 |
repo_id=os.environ.get('DATA'), repo_type='dataset', filename="credentials.json",
|
17 |
+
token=os.environ.get('HUB_TOKEN'), local_dir="assets"
|
18 |
)
|
19 |
return
|
20 |
|
services/utils.py
CHANGED
@@ -12,7 +12,7 @@ from pinecone import Index
|
|
12 |
|
13 |
from services import audio_model, gcp
|
14 |
|
15 |
-
if not os.path.exists('
|
16 |
audio_model.download_model()
|
17 |
from services.audio import *
|
18 |
from video import *
|
|
|
12 |
|
13 |
from services import audio_model, gcp
|
14 |
|
15 |
+
if not os.path.exists('tts_model'): # Get TTS model
|
16 |
audio_model.download_model()
|
17 |
from services.audio import *
|
18 |
from video import *
|