Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,6 @@ from video_processing import process_video
|
|
4 |
from gradio.themes.base import Base
|
5 |
from gradio.themes.utils import colors, fonts, sizes
|
6 |
from typing import Iterable
|
7 |
-
import shutil
|
8 |
|
9 |
class CustomTheme(Base):
|
10 |
def __init__(
|
@@ -54,10 +53,9 @@ def save_uploaded_file(file):
|
|
54 |
os.makedirs(upload_dir, exist_ok=True)
|
55 |
file_path = os.path.join(upload_dir, file.name)
|
56 |
with open(file_path, "wb") as f:
|
57 |
-
|
58 |
return file_path
|
59 |
|
60 |
-
|
61 |
def display_results(video_url, video_file, description):
|
62 |
if video_url:
|
63 |
final_clip_path = process_video(video_url, description, is_url=True)
|
|
|
4 |
from gradio.themes.base import Base
|
5 |
from gradio.themes.utils import colors, fonts, sizes
|
6 |
from typing import Iterable
|
|
|
7 |
|
8 |
class CustomTheme(Base):
|
9 |
def __init__(
|
|
|
53 |
os.makedirs(upload_dir, exist_ok=True)
|
54 |
file_path = os.path.join(upload_dir, file.name)
|
55 |
with open(file_path, "wb") as f:
|
56 |
+
f.write(file.encode('utf-8')) # Convert to bytes and write
|
57 |
return file_path
|
58 |
|
|
|
59 |
def display_results(video_url, video_file, description):
|
60 |
if video_url:
|
61 |
final_clip_path = process_video(video_url, description, is_url=True)
|