Zeph27 commited on
Commit
528611f
β€’
1 Parent(s): 60e801c
Files changed (1) hide show
  1. app.py +2 -2
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": "transcribe"}, return_timestamps=True)["text"]
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
- progress(f"Transcription: {transcription}")
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)