Spaces:
Runtime error
Runtime error
Commit
•
ff3c3b5
1
Parent(s):
9846dc0
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
|
@@ -32,6 +33,8 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
32 |
ljs_model.to(device)
|
33 |
vctk_model.to(device)
|
34 |
|
|
|
|
|
35 |
def ljs_forward(text, speaking_rate=1.0):
|
36 |
inputs = ljs_tokenizer(text, return_tensors="pt")
|
37 |
|
@@ -44,6 +47,7 @@ def ljs_forward(text, speaking_rate=1.0):
|
|
44 |
return gr.make_waveform((22050, waveform))
|
45 |
|
46 |
|
|
|
47 |
def vctk_forward(text, speaking_rate=1.0, speaker_id=1):
|
48 |
inputs = vctk_tokenizer(text, return_tensors="pt")
|
49 |
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
|
|
|
33 |
ljs_model.to(device)
|
34 |
vctk_model.to(device)
|
35 |
|
36 |
+
|
37 |
+
@spaces.GPU
|
38 |
def ljs_forward(text, speaking_rate=1.0):
|
39 |
inputs = ljs_tokenizer(text, return_tensors="pt")
|
40 |
|
|
|
47 |
return gr.make_waveform((22050, waveform))
|
48 |
|
49 |
|
50 |
+
@spaces.GPU
|
51 |
def vctk_forward(text, speaking_rate=1.0, speaker_id=1):
|
52 |
inputs = vctk_tokenizer(text, return_tensors="pt")
|
53 |
|