Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,13 @@ def create_loop(
|
|
| 46 |
f"{uid}_loop.mp4"
|
| 47 |
)
|
| 48 |
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
duration = get_video_duration(input_path)
|
| 52 |
|
|
@@ -134,8 +140,7 @@ with gr.Blocks() as demo:
|
|
| 134 |
|
| 135 |
input_video = gr.Video(
|
| 136 |
label="Upload Video",
|
| 137 |
-
sources=["upload"]
|
| 138 |
-
type="filepath"
|
| 139 |
)
|
| 140 |
|
| 141 |
fade_duration = gr.Slider(
|
|
|
|
| 46 |
f"{uid}_loop.mp4"
|
| 47 |
)
|
| 48 |
|
| 49 |
+
# Compatible with Gradio 5 & 6
|
| 50 |
+
if isinstance(input_video, dict):
|
| 51 |
+
video_file = input_video["path"]
|
| 52 |
+
else:
|
| 53 |
+
video_file = input_video
|
| 54 |
+
|
| 55 |
+
shutil.copy(video_file, input_path)
|
| 56 |
|
| 57 |
duration = get_video_duration(input_path)
|
| 58 |
|
|
|
|
| 140 |
|
| 141 |
input_video = gr.Video(
|
| 142 |
label="Upload Video",
|
| 143 |
+
sources=["upload"]
|
|
|
|
| 144 |
)
|
| 145 |
|
| 146 |
fade_duration = gr.Slider(
|