Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ configs_single, model_single, vocoder_single = load_models(config_path = "config
|
|
| 39 |
configs_multi, model_multi, vocoder_multi = load_models(config_path = "config/Frysk_CV/",
|
| 40 |
model_name = "Frysk_CV_300000.pth.tar")
|
| 41 |
|
| 42 |
-
@spaces.GPU(duration=
|
| 43 |
def infer(text, speaker_ID, configs, model, vocoder):
|
| 44 |
model.to('cuda')
|
| 45 |
vocoder.to('cuda')
|
|
@@ -61,13 +61,13 @@ def infer(text, speaker_ID, configs, model, vocoder):
|
|
| 61 |
return sr, audio
|
| 62 |
|
| 63 |
# main inference function
|
| 64 |
-
@spaces.GPU(duration=
|
| 65 |
def run_single(text):
|
| 66 |
speaker_ID = 0
|
| 67 |
output = infer(text, 0, configs_single, model_single, vocoder_single)
|
| 68 |
return output
|
| 69 |
|
| 70 |
-
@spaces.GPU(duration=
|
| 71 |
def run_multi(text, speaker_ID):
|
| 72 |
dic = {1: 0, 2: 11, 3: 22, 4: 24, 5: 25, 6: 26, 7: 27, 8: 28, 9: 29, 10: 1, 11: 2, 12: 3, 13: 4, 14: 5, 15: 6, 16: 7, 17: 8, 18: 9, 19: 10, 20: 12, 21: 13, 22: 14, 23: 15, 24: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: 23}
|
| 73 |
output = infer(text, dic[speaker_ID], configs_multi, model_multi, vocoder_multi)
|
|
|
|
| 39 |
configs_multi, model_multi, vocoder_multi = load_models(config_path = "config/Frysk_CV/",
|
| 40 |
model_name = "Frysk_CV_300000.pth.tar")
|
| 41 |
|
| 42 |
+
@spaces.GPU(duration=80)
|
| 43 |
def infer(text, speaker_ID, configs, model, vocoder):
|
| 44 |
model.to('cuda')
|
| 45 |
vocoder.to('cuda')
|
|
|
|
| 61 |
return sr, audio
|
| 62 |
|
| 63 |
# main inference function
|
| 64 |
+
@spaces.GPU(duration=80)
|
| 65 |
def run_single(text):
|
| 66 |
speaker_ID = 0
|
| 67 |
output = infer(text, 0, configs_single, model_single, vocoder_single)
|
| 68 |
return output
|
| 69 |
|
| 70 |
+
@spaces.GPU(duration=80)
|
| 71 |
def run_multi(text, speaker_ID):
|
| 72 |
dic = {1: 0, 2: 11, 3: 22, 4: 24, 5: 25, 6: 26, 7: 27, 8: 28, 9: 29, 10: 1, 11: 2, 12: 3, 13: 4, 14: 5, 15: 6, 16: 7, 17: 8, 18: 9, 19: 10, 20: 12, 21: 13, 22: 14, 23: 15, 24: 16, 25: 17, 26: 18, 27: 19, 28: 20, 29: 21, 30: 23}
|
| 73 |
output = infer(text, dic[speaker_ID], configs_multi, model_multi, vocoder_multi)
|