Spaces:
Runtime error
Runtime error
Update webui.py
Browse files
webui.py
CHANGED
@@ -22,8 +22,9 @@ from datetime import datetime
|
|
22 |
from cli.SparkTTS import SparkTTS
|
23 |
from sparktts.utils.token_parser import LEVELS_MAP_UI
|
24 |
import spaces
|
|
|
25 |
|
26 |
-
def initialize_model(model_dir="
|
27 |
"""Load the model once at the beginning."""
|
28 |
logging.info(f"Loading model from: {model_dir}")
|
29 |
device = torch.device(f"cuda:{device}")
|
|
|
22 |
from cli.SparkTTS import SparkTTS
|
23 |
from sparktts.utils.token_parser import LEVELS_MAP_UI
|
24 |
import spaces
|
25 |
+
from huggingface_hub import snapshot_download
|
26 |
|
27 |
+
def initialize_model(model_dir=snapshot_download("SparkAudio/Spark-TTS-0.5B"), device=0):
|
28 |
"""Load the model once at the beginning."""
|
29 |
logging.info(f"Loading model from: {model_dir}")
|
30 |
device = torch.device(f"cuda:{device}")
|