LucasMendes commited on
Commit
d070bc3
1 Parent(s): 42f98e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -10,9 +10,6 @@ from transformers.pipelines.audio_utils import ffmpeg_read
10
  import tempfile
11
  import os
12
 
13
- print("ola mundo1")
14
-
15
-
16
 
17
  MODEL_NAME = "openai/whisper-large-v3"
18
  BATCH_SIZE = 8
@@ -89,7 +86,7 @@ def yt_transcribe(yt_url, task, max_filesize=75.0):
89
  inputs = ffmpeg_read(inputs, pipe.feature_extractor.sampling_rate)
90
  inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
91
 
92
- text = json.dumps(pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True))
93
 
94
  return html_embed_str, text
95
 
@@ -153,7 +150,5 @@ yt_transcribe = gr.Interface(
153
  with demo:
154
  gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])
155
 
156
- print("ola mundo3")
157
-
158
  demo.launch(enable_queue=True)
159
 
 
10
  import tempfile
11
  import os
12
 
 
 
 
13
 
14
  MODEL_NAME = "openai/whisper-large-v3"
15
  BATCH_SIZE = 8
 
86
  inputs = ffmpeg_read(inputs, pipe.feature_extractor.sampling_rate)
87
  inputs = {"array": inputs, "sampling_rate": pipe.feature_extractor.sampling_rate}
88
 
89
+ text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": task}, return_timestamps=True)
90
 
91
  return html_embed_str, text
92
 
 
150
  with demo:
151
  gr.TabbedInterface([mf_transcribe, file_transcribe, yt_transcribe], ["Microphone", "Audio file", "YouTube"])
152
 
 
 
153
  demo.launch(enable_queue=True)
154