Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def set_seed(seed: int):
|
|
24 |
# and ensure the function CALLING the model is decorated.
|
25 |
|
26 |
@spaces.GPU # <<< ADD THIS DECORATOR
|
27 |
-
def generate(model_obj, text, audio_prompt_path, exaggeration,
|
28 |
# It's better to load the model once, perhaps when the gr.State is initialized
|
29 |
# or globally, rather than checking `model_obj is None` on every call.
|
30 |
# For ZeroGPU, the decorated function handles the GPU context.
|
@@ -48,7 +48,6 @@ def generate(model_obj, text, audio_prompt_path, exaggeration, pace, temperature
|
|
48 |
text,
|
49 |
audio_prompt_path=audio_prompt_path,
|
50 |
exaggeration=exaggeration,
|
51 |
-
pace=pace,
|
52 |
temperature=temperature,
|
53 |
cfg_weight=cfgw,
|
54 |
)
|
@@ -85,7 +84,7 @@ with gr.Blocks() as demo:
|
|
85 |
with gr.Accordion("More options", open=False):
|
86 |
seed_num = gr.Number(value=0, label="Random seed (0 for random)")
|
87 |
temp = gr.Slider(0.05, 5, step=.05, label="temperature", value=.8)
|
88 |
-
|
89 |
|
90 |
run_btn = gr.Button("Generate", variant="primary")
|
91 |
|
@@ -99,7 +98,6 @@ with gr.Blocks() as demo:
|
|
99 |
text,
|
100 |
ref_wav,
|
101 |
exaggeration,
|
102 |
-
pace,
|
103 |
temp,
|
104 |
seed_num,
|
105 |
cfg_weight,
|
|
|
24 |
# and ensure the function CALLING the model is decorated.
|
25 |
|
26 |
@spaces.GPU # <<< ADD THIS DECORATOR
|
27 |
+
def generate(model_obj, text, audio_prompt_path, exaggeration, temperature, seed_num, cfgw):
|
28 |
# It's better to load the model once, perhaps when the gr.State is initialized
|
29 |
# or globally, rather than checking `model_obj is None` on every call.
|
30 |
# For ZeroGPU, the decorated function handles the GPU context.
|
|
|
48 |
text,
|
49 |
audio_prompt_path=audio_prompt_path,
|
50 |
exaggeration=exaggeration,
|
|
|
51 |
temperature=temperature,
|
52 |
cfg_weight=cfgw,
|
53 |
)
|
|
|
84 |
with gr.Accordion("More options", open=False):
|
85 |
seed_num = gr.Number(value=0, label="Random seed (0 for random)")
|
86 |
temp = gr.Slider(0.05, 5, step=.05, label="temperature", value=.8)
|
87 |
+
|
88 |
|
89 |
run_btn = gr.Button("Generate", variant="primary")
|
90 |
|
|
|
98 |
text,
|
99 |
ref_wav,
|
100 |
exaggeration,
|
|
|
101 |
temp,
|
102 |
seed_num,
|
103 |
cfg_weight,
|