Spaces:
Runtime error
Runtime error
AkhilTolani
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -58,9 +58,10 @@ def generate_audio(prompt, description, seed, temperature, max_length, do_sample
|
|
58 |
if hasattr(eval_model, '_orig_mod'):
|
59 |
eval_model = eval_model._orig_mod
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
64 |
output_audios = eval_model.generate(**batch, **gen_kwargs)
|
65 |
|
66 |
output_audios = accelerator.pad_across_processes(output_audios, dim=1, pad_index=0)
|
@@ -99,7 +100,7 @@ interface = gr.Interface(
|
|
99 |
gr.Textbox(label="Prompt", value=default_prompt),
|
100 |
gr.Textbox(label="Description", value=default_description),
|
101 |
gr.Textbox(label="Seed", value=default_seed),
|
102 |
-
gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, step=0.1, value=0
|
103 |
gr.Slider(label="Max Length", minimum=256, maximum=5120, step=256, value=2580),
|
104 |
gr.Dropdown(label="Do Sample", choices=[True, False], value=True)
|
105 |
],
|
|
|
58 |
if hasattr(eval_model, '_orig_mod'):
|
59 |
eval_model = eval_model._orig_mod
|
60 |
|
61 |
+
if mixed_precision != "no":
|
62 |
+
with accelerator.autocast():
|
63 |
+
output_audios = eval_model.generate(**batch, **gen_kwargs)
|
64 |
+
else:
|
65 |
output_audios = eval_model.generate(**batch, **gen_kwargs)
|
66 |
|
67 |
output_audios = accelerator.pad_across_processes(output_audios, dim=1, pad_index=0)
|
|
|
100 |
gr.Textbox(label="Prompt", value=default_prompt),
|
101 |
gr.Textbox(label="Description", value=default_description),
|
102 |
gr.Textbox(label="Seed", value=default_seed),
|
103 |
+
gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, step=0.1, value=1.0),
|
104 |
gr.Slider(label="Max Length", minimum=256, maximum=5120, step=256, value=2580),
|
105 |
gr.Dropdown(label="Do Sample", choices=[True, False], value=True)
|
106 |
],
|