shibing624 commited on
Commit
da9a963
·
verified ·
1 Parent(s): 93ed0bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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="cpu",
26
- half=False
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.",