Spaces:
Build error
Build error
ayaanzaveri
commited on
Commit
•
c9eb8b9
1
Parent(s):
51e7ccb
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,7 @@ def download_convert_video_to_audio(
|
|
21 |
}
|
22 |
],
|
23 |
"outtmpl": f"{destination_path}.%(ext)s",
|
|
|
24 |
}
|
25 |
try:
|
26 |
print(f"Downloading video from {video_url}")
|
@@ -46,6 +47,8 @@ def transcribe_video(video_url: str, beam_size: int = 5, model_size: str = "tiny
|
|
46 |
rand_id = uuid.uuid4().hex
|
47 |
print("doing download")
|
48 |
download_convert_video_to_audio(yt_dlp, video_url, f"{rand_id}")
|
|
|
|
|
49 |
segments, info = model.transcribe(f"{rand_id}.mp3", beam_size=beam_size, word_timestamps=word_timestamps)
|
50 |
segments = [segment_to_dict(segment) for segment in segments]
|
51 |
total_duration = round(info.duration, 2) # Same precision as the Whisper timestamps.
|
|
|
21 |
}
|
22 |
],
|
23 |
"outtmpl": f"{destination_path}.%(ext)s",
|
24 |
+
"concurrent-fragments": 128
|
25 |
}
|
26 |
try:
|
27 |
print(f"Downloading video from {video_url}")
|
|
|
47 |
rand_id = uuid.uuid4().hex
|
48 |
print("doing download")
|
49 |
download_convert_video_to_audio(yt_dlp, video_url, f"{rand_id}")
|
50 |
+
print("done download")
|
51 |
+
print("doing transcribe")
|
52 |
segments, info = model.transcribe(f"{rand_id}.mp3", beam_size=beam_size, word_timestamps=word_timestamps)
|
53 |
segments = [segment_to_dict(segment) for segment in segments]
|
54 |
total_duration = round(info.duration, 2) # Same precision as the Whisper timestamps.
|