freddyaboulton HF staff commited on
Commit
5086b00
·
verified ·
1 Parent(s): d536921

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -93,7 +93,8 @@ def generate_base(subject, setting):
93
  speech_output = [output.cpu().numpy() for output in speech_output]
94
  gr.Info("Generated Audio")
95
  return None, None, {"audio": speech_output, "text": model_input_tokens}
96
-
 
97
  def stream_audio(state):
98
  speech_output = state["audio"]
99
  sentences = state["text"]
@@ -105,6 +106,7 @@ def stream_audio(state):
105
  print(f"Sample of length: {round(new_audio.shape[0] / sampling_rate, 2)} seconds")
106
  story += f"{sentence}\n"
107
  yield story, numpy_to_mp3(new_audio, sampling_rate=sampling_rate)
 
108
 
109
 
110
  with gr.Blocks() as block:
 
93
  speech_output = [output.cpu().numpy() for output in speech_output]
94
  gr.Info("Generated Audio")
95
  return None, None, {"audio": speech_output, "text": model_input_tokens}
96
+
97
+ import time
98
  def stream_audio(state):
99
  speech_output = state["audio"]
100
  sentences = state["text"]
 
106
  print(f"Sample of length: {round(new_audio.shape[0] / sampling_rate, 2)} seconds")
107
  story += f"{sentence}\n"
108
  yield story, numpy_to_mp3(new_audio, sampling_rate=sampling_rate)
109
+ time.sleep(1)
110
 
111
 
112
  with gr.Blocks() as block: