Fabrice-TIERCELIN commited on
Commit
e6563cd
1 Parent(s): b30841e

Fix by printing methods

Browse files
Files changed (1) hide show
  1. app.py +2 -13
app.py CHANGED
@@ -58,7 +58,7 @@ class Tango:
58
  def generate(self, prompt, steps = 100, guidance = 3, samples = 1, disable_progress = True):
59
  # Generate audio for a single prompt string
60
  with torch.no_grad():
61
- self.model.set_generation_params(duration=20)
62
  latents = self.model.inference([prompt], self.scheduler, steps, guidance, samples, disable_progress = disable_progress)
63
  mel = self.vae.decode_first_stage(latents)
64
  wave = self.vae.decode_to_waveform(mel)
@@ -146,12 +146,6 @@ def text2audio(
146
  gr.update(visible = True, value = "Start again to get a different result. The output have been generated in " + ((str(hours) + " h, ") if hours != 0 else "") + ((str(minutes) + " min, ") if hours != 0 or minutes != 0 else "") + str(secondes) + " sec.")
147
  ]
148
 
149
- def keep_output(output_format, output_number):
150
- time.sleep(3 * 60 * 60)
151
- return [
152
- gr.update(visible = False)
153
- ]
154
-
155
  # Gradio interface
156
  with gr.Blocks() as interface:
157
  gr.Markdown("""
@@ -221,12 +215,7 @@ with gr.Blocks() as interface:
221
  output_audio_2,
222
  output_audio_3,
223
  information
224
- ], scroll_to_output = True).success(fn = keep_output, inputs = [
225
- output_format,
226
- output_number
227
- ], outputs = [
228
- information
229
- ], queue = True, show_progress = False)
230
 
231
  gr.Examples(
232
  fn = text2audio,
 
58
  def generate(self, prompt, steps = 100, guidance = 3, samples = 1, disable_progress = True):
59
  # Generate audio for a single prompt string
60
  with torch.no_grad():
61
+ print(dir(self.model))
62
  latents = self.model.inference([prompt], self.scheduler, steps, guidance, samples, disable_progress = disable_progress)
63
  mel = self.vae.decode_first_stage(latents)
64
  wave = self.vae.decode_to_waveform(mel)
 
146
  gr.update(visible = True, value = "Start again to get a different result. The output have been generated in " + ((str(hours) + " h, ") if hours != 0 else "") + ((str(minutes) + " min, ") if hours != 0 or minutes != 0 else "") + str(secondes) + " sec.")
147
  ]
148
 
 
 
 
 
 
 
149
  # Gradio interface
150
  with gr.Blocks() as interface:
151
  gr.Markdown("""
 
215
  output_audio_2,
216
  output_audio_3,
217
  information
218
+ ], scroll_to_output = True)
 
 
 
 
 
219
 
220
  gr.Examples(
221
  fn = text2audio,