Spaces:
Runtime error
Runtime error
Fix app
Browse files
app.py
CHANGED
@@ -18,9 +18,9 @@ class GradioInference():
|
|
18 |
self.yt = YouTube(link)
|
19 |
path = self.yt.streams.filter(only_audio=True)[0].download(filename="tmp.mp4")
|
20 |
subprocess.run([
|
21 |
-
'ffmpeg', '-i', 'tmp.mp4', 'tmp.
|
22 |
])
|
23 |
-
sound_data = soundfile.read('tmp.
|
24 |
input_features = self.processor(sound_data, return_tensors="pt").input_features
|
25 |
forced_decoder_ids = self.processor.get_decoder_prompt_ids(language = "sv", task = "translate")
|
26 |
predicted_ids = self.model.generate(input_features, forced_decoder_ids = forced_decoder_ids)
|
|
|
18 |
self.yt = YouTube(link)
|
19 |
path = self.yt.streams.filter(only_audio=True)[0].download(filename="tmp.mp4")
|
20 |
subprocess.run([
|
21 |
+
'ffmpeg', '-i', 'tmp.mp4','-vn', '-acodec', 'pcm_s16le', '-ac', '1', '-ar', '44100', '-f' 'wav','tmp.wav'
|
22 |
])
|
23 |
+
sound_data = soundfile.read('tmp.wav')
|
24 |
input_features = self.processor(sound_data, return_tensors="pt").input_features
|
25 |
forced_decoder_ids = self.processor.get_decoder_prompt_ids(language = "sv", task = "translate")
|
26 |
predicted_ids = self.model.generate(input_features, forced_decoder_ids = forced_decoder_ids)
|