Spaces:
Runtime error
Runtime error
Commit
·
45a4010
1
Parent(s):
3e4a623
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,13 +37,10 @@ def process_video(radio, video, target_language):
|
|
| 37 |
return gr.Interface.Warnings("Video duration exceeds 1 minute and 30 seconds. Please upload a shorter video.")
|
| 38 |
|
| 39 |
run_uuid = uuid.uuid4().hex[:6]
|
|
|
|
| 40 |
output_filename = f"{run_uuid}_resized_video.mp4"
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
ffmpeg.input(video).output(output_filename, vf='scale=-1:720').run()
|
| 44 |
-
video_path = output_filename
|
| 45 |
-
else:
|
| 46 |
-
video_path = video
|
| 47 |
|
| 48 |
if not os.path.exists(video_path):
|
| 49 |
return f"Error: {video_path} does not exist."
|
|
@@ -146,4 +143,5 @@ iface = gr.Interface(
|
|
| 146 |
with gr.Blocks() as demo:
|
| 147 |
iface.render()
|
| 148 |
radio.change(swap, inputs=[radio], outputs=video)
|
|
|
|
| 149 |
demo.launch()
|
|
|
|
| 37 |
return gr.Interface.Warnings("Video duration exceeds 1 minute and 30 seconds. Please upload a shorter video.")
|
| 38 |
|
| 39 |
run_uuid = uuid.uuid4().hex[:6]
|
| 40 |
+
|
| 41 |
output_filename = f"{run_uuid}_resized_video.mp4"
|
| 42 |
+
ffmpeg.input(video).output(output_filename, vf='scale=-1:720').run()
|
| 43 |
+
video_path = output_filename
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
if not os.path.exists(video_path):
|
| 46 |
return f"Error: {video_path} does not exist."
|
|
|
|
| 143 |
with gr.Blocks() as demo:
|
| 144 |
iface.render()
|
| 145 |
radio.change(swap, inputs=[radio], outputs=video)
|
| 146 |
+
demo.queue(concurrency_count=2, max_size=15)
|
| 147 |
demo.launch()
|