michaeltangz commited on
Commit
3e64dd3
·
1 Parent(s): dd7a42e

fix app.py to remove redundant generate_kwargs in transcription calls and enable demo sharing during launch

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -53,7 +53,7 @@ def stream_transcribe(stream, new_chunk):
53
  else:
54
  stream = y
55
 
56
- transcription = pipe({"sampling_rate": sr, "raw": stream}, generate_kwargs={"condition_on_previous_text": False})["text"]
57
  end_time = time.time()
58
  latency = end_time - start_time
59
 
@@ -70,7 +70,7 @@ def transcribe(inputs, previous_transcription):
70
  sample_rate, audio_data = inputs
71
  scipy.io.wavfile.write(filename, sample_rate, audio_data)
72
 
73
- transcription = pipe(filename, generate_kwargs={"condition_on_previous_text": False})["text"]
74
  previous_transcription += transcription
75
 
76
  end_time = time.time()
@@ -121,4 +121,4 @@ with gr.Blocks() as demo:
121
  gr.TabbedInterface([microphone, file], ["Microphone", "Transcribe from file"])
122
 
123
  if __name__ == "__main__":
124
- demo.launch()
 
53
  else:
54
  stream = y
55
 
56
+ transcription = pipe({"sampling_rate": sr, "raw": stream})["text"]
57
  end_time = time.time()
58
  latency = end_time - start_time
59
 
 
70
  sample_rate, audio_data = inputs
71
  scipy.io.wavfile.write(filename, sample_rate, audio_data)
72
 
73
+ transcription = pipe(filename)["text"]
74
  previous_transcription += transcription
75
 
76
  end_time = time.time()
 
121
  gr.TabbedInterface([microphone, file], ["Microphone", "Transcribe from file"])
122
 
123
  if __name__ == "__main__":
124
+ demo.launch(share=True)