z2learn commited on
Commit
ceca54f
Β·
verified Β·
1 Parent(s): fed6159

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -4,7 +4,7 @@ import tempfile
4
  import os
5
  from pathlib import Path
6
 
7
- MODEL_SIZE = "medium" # switched from "small" to "medium"
8
 
9
  class GradioSRTGenerator:
10
  def __init__(self):
@@ -75,8 +75,7 @@ def create_ui():
75
 
76
  with gr.Row():
77
  with gr.Column():
78
- - input_video = gr.Video(label="Upload Video", source="upload", interactive=True)
79
- + input_video = gr.Video(label="Upload Video")
80
  generate_btn = gr.Button("🎯 Generate SRT", variant="primary")
81
  status_text = gr.Textbox(label="Status", interactive=False, show_copy_button=True)
82
 
@@ -89,7 +88,7 @@ def create_ui():
89
  inputs=[input_video],
90
  outputs=[srt_download, status_text],
91
  api_name="generate_srt"
92
- ).queue() # <-- ensures this function is queued if another request is running
93
 
94
  # Add a queue to the entire Blocks app with exactly 1 worker
95
  app.queue(concurrency_count=1, max_size=10)
@@ -98,4 +97,7 @@ def create_ui():
98
  app = create_ui()
99
 
100
  if __name__ == "__main__":
101
- app.launch()
 
 
 
 
4
  import os
5
  from pathlib import Path
6
 
7
+ MODEL_SIZE = "medium" # Switched from "small" to "medium"
8
 
9
  class GradioSRTGenerator:
10
  def __init__(self):
 
75
 
76
  with gr.Row():
77
  with gr.Column():
78
+ input_video = gr.Video(label="Upload Video")
 
79
  generate_btn = gr.Button("🎯 Generate SRT", variant="primary")
80
  status_text = gr.Textbox(label="Status", interactive=False, show_copy_button=True)
81
 
 
88
  inputs=[input_video],
89
  outputs=[srt_download, status_text],
90
  api_name="generate_srt"
91
+ ).queue() # ensures this function is queued if another request is running
92
 
93
  # Add a queue to the entire Blocks app with exactly 1 worker
94
  app.queue(concurrency_count=1, max_size=10)
 
97
  app = create_ui()
98
 
99
  if __name__ == "__main__":
100
+ app.launch(
101
+ server_name="0.0.0.0", # bind to all interfaces (important for Docker)
102
+ server_port=7860 # default Gradio port
103
+ )