Spaces:
Runtime error
Runtime error
blog
Browse files
app.py
CHANGED
|
@@ -68,7 +68,7 @@ def transcribe_audio(audio_file):
|
|
| 68 |
inputs = ffmpeg_read(inputs, asr_pipeline.feature_extractor.sampling_rate)
|
| 69 |
inputs = {"array": inputs, "sampling_rate": asr_pipeline.feature_extractor.sampling_rate}
|
| 70 |
|
| 71 |
-
transcription = asr_pipeline(inputs, batch_size=8, generate_kwargs={"task": "
|
| 72 |
return transcription
|
| 73 |
|
| 74 |
@spaces.GPU
|
|
@@ -91,7 +91,7 @@ def analyze_video(prompt, video, progress=gr.Progress()):
|
|
| 91 |
|
| 92 |
progress(0.5, desc="Transcribing audio")
|
| 93 |
transcription = transcribe_audio(audio_path)
|
| 94 |
-
|
| 95 |
|
| 96 |
# Clean up temporary audio file
|
| 97 |
os.remove(audio_path)
|
|
|
|
| 68 |
inputs = ffmpeg_read(inputs, asr_pipeline.feature_extractor.sampling_rate)
|
| 69 |
inputs = {"array": inputs, "sampling_rate": asr_pipeline.feature_extractor.sampling_rate}
|
| 70 |
|
| 71 |
+
transcription = asr_pipeline(inputs, batch_size=8, generate_kwargs={"task": "translate"}, return_timestamps=False)["text"]
|
| 72 |
return transcription
|
| 73 |
|
| 74 |
@spaces.GPU
|
|
|
|
| 91 |
|
| 92 |
progress(0.5, desc="Transcribing audio")
|
| 93 |
transcription = transcribe_audio(audio_path)
|
| 94 |
+
print(f"Transcription: {transcription}")
|
| 95 |
|
| 96 |
# Clean up temporary audio file
|
| 97 |
os.remove(audio_path)
|