Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -80,13 +80,14 @@ def do_transcribe(inputs):
|
|
80 |
return convert_to_vtt(result)
|
81 |
|
82 |
def transcribe(file_path):
|
83 |
-
|
|
|
84 |
|
85 |
# Calculate the length in seconds
|
86 |
audio_length = len(audio_data) / 16000
|
87 |
expected_transcribe_duration = audio_length / 5.0
|
88 |
gr.Info(f"Starting to transcribe, requesting a GPU for {expected_transcribe_duration} seconds")
|
89 |
-
return dynamic_gpu_duration(do_transcribe, expected_transcribe_duration,
|
90 |
|
91 |
|
92 |
def _return_yt_html_embed(yt_url):
|
|
|
80 |
return convert_to_vtt(result)
|
81 |
|
82 |
def transcribe(file_path):
|
83 |
+
with open(file_path, "rb") as f:
|
84 |
+
audio_data = ffmpeg_read(f.read(), 16000)
|
85 |
|
86 |
# Calculate the length in seconds
|
87 |
audio_length = len(audio_data) / 16000
|
88 |
expected_transcribe_duration = audio_length / 5.0
|
89 |
gr.Info(f"Starting to transcribe, requesting a GPU for {expected_transcribe_duration} seconds")
|
90 |
+
return dynamic_gpu_duration(do_transcribe, expected_transcribe_duration, file_path)
|
91 |
|
92 |
|
93 |
def _return_yt_html_embed(yt_url):
|