jschwab21 commited on
Commit
0a4ad8b
·
verified ·
1 Parent(s): d9349af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,9 +1,9 @@
1
- import os
2
  import gradio as gr
3
  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
 
8
  class CustomTheme(Base):
9
  def __init__(
@@ -53,7 +53,7 @@ def save_uploaded_file(file):
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):
 
 
1
  import gradio as gr
2
  from video_processing import process_video
3
  from gradio.themes.base import Base
4
  from gradio.themes.utils import colors, fonts, sizes
5
  from typing import Iterable
6
+ import shutil
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
+ shutil.copyfileobj(file.file, f)
57
  return file_path
58
 
59
  def display_results(video_url, video_file, description):