Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -18,12 +18,13 @@ from parrots import TextToSpeech
|
|
18 |
|
19 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
20 |
logger.info(f"device: {device}")
|
|
|
21 |
|
22 |
m = TextToSpeech(
|
23 |
speaker_model_path="shibing624/parrots-gpt-sovits-speaker-maimai",
|
24 |
speaker_name="MaiMai",
|
25 |
-
device=
|
26 |
-
half=
|
27 |
)
|
28 |
m.predict(
|
29 |
text="你好,欢迎来北京。welcome to the city.",
|
|
|
18 |
|
19 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
20 |
logger.info(f"device: {device}")
|
21 |
+
half = True if device == "cuda" else False
|
22 |
|
23 |
m = TextToSpeech(
|
24 |
speaker_model_path="shibing624/parrots-gpt-sovits-speaker-maimai",
|
25 |
speaker_name="MaiMai",
|
26 |
+
device=device,
|
27 |
+
half=half
|
28 |
)
|
29 |
m.predict(
|
30 |
text="你好,欢迎来北京。welcome to the city.",
|