eienmojiki commited on
Commit
25a5868
·
verified ·
1 Parent(s): c8a0cc4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  import subprocess
3
  import os
4
- #import spaces
5
 
6
  def get_file_size(file_path):
7
  """Get file size in a human-readable format"""
@@ -16,7 +16,7 @@ def get_file_size(file_path):
16
  return f"{size_bytes:.2f} {unit}"
17
  size_bytes /= 1024
18
 
19
- #@spaces.GPU(duration=120)
20
  def compress_video(video_file):
21
  """Compresses the uploaded video using FFmpeg and returns the output video path and file sizes."""
22
  if video_file is None:
@@ -37,8 +37,8 @@ def compress_video(video_file):
37
  # Execute ffmpeg command
38
  command = [
39
  "ffmpeg",
40
- #"-hwaccel",
41
- #"cuda",
42
  "-i", input_path,
43
  "-vcodec", "libx264",
44
  "-crf", "28",
@@ -118,4 +118,4 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
118
  outputs=[input_size_display]
119
  )
120
 
121
- app.launch(ssr_mode=False, debug=True, show_error=True)
 
1
  import gradio as gr
2
  import subprocess
3
  import os
4
+ import spaces
5
 
6
  def get_file_size(file_path):
7
  """Get file size in a human-readable format"""
 
16
  return f"{size_bytes:.2f} {unit}"
17
  size_bytes /= 1024
18
 
19
+ @spaces.GPU(duration=120)
20
  def compress_video(video_file):
21
  """Compresses the uploaded video using FFmpeg and returns the output video path and file sizes."""
22
  if video_file is None:
 
37
  # Execute ffmpeg command
38
  command = [
39
  "ffmpeg",
40
+ "-hwaccel",
41
+ "cuda",
42
  "-i", input_path,
43
  "-vcodec", "libx264",
44
  "-crf", "28",
 
118
  outputs=[input_size_display]
119
  )
120
 
121
+ app.launch(debug=True, show_error=True)