Update app.py
Browse files
app.py
CHANGED
@@ -84,7 +84,6 @@ def translate_from_video(video, WHISPER_MODEL_SIZE, batch_size, compute_type,
|
|
84 |
|
85 |
YOUR_HF_TOKEN = os.getenv("My_hf_token")
|
86 |
|
87 |
-
print(f"### Start {video} ###")
|
88 |
|
89 |
OutputFile = 'Video.mp4'
|
90 |
audio_wav = "audio.wav"
|
@@ -98,7 +97,8 @@ def translate_from_video(video, WHISPER_MODEL_SIZE, batch_size, compute_type,
|
|
98 |
os.system("rm audio.wav")
|
99 |
|
100 |
|
101 |
-
if os.path.exists(video):
|
|
|
102 |
if device == 'cpu':
|
103 |
# max 1 minute in cpu
|
104 |
print('10 s. Limited for CPU ')
|
@@ -108,6 +108,7 @@ def translate_from_video(video, WHISPER_MODEL_SIZE, batch_size, compute_type,
|
|
108 |
|
109 |
os.system("ffmpeg -y -i Video.mp4 -vn -acodec pcm_s16le -ar 44100 -ac 2 audio.wav")
|
110 |
else:
|
|
|
111 |
if device == 'cpu':
|
112 |
# max 1 minute in cpu
|
113 |
print('10 s. Limited for CPU ')
|
|
|
84 |
|
85 |
YOUR_HF_TOKEN = os.getenv("My_hf_token")
|
86 |
|
|
|
87 |
|
88 |
OutputFile = 'Video.mp4'
|
89 |
audio_wav = "audio.wav"
|
|
|
97 |
os.system("rm audio.wav")
|
98 |
|
99 |
|
100 |
+
if os.path.exists(video):
|
101 |
+
print(f"### Start Video ###")
|
102 |
if device == 'cpu':
|
103 |
# max 1 minute in cpu
|
104 |
print('10 s. Limited for CPU ')
|
|
|
108 |
|
109 |
os.system("ffmpeg -y -i Video.mp4 -vn -acodec pcm_s16le -ar 44100 -ac 2 audio.wav")
|
110 |
else:
|
111 |
+
print(f"### Start {video} ###")
|
112 |
if device == 'cpu':
|
113 |
# max 1 minute in cpu
|
114 |
print('10 s. Limited for CPU ')
|