Update app.py
Browse files
app.py
CHANGED
@@ -153,6 +153,7 @@ def generate_dashboard(analytics):
|
|
153 |
dashboard += f" {metric}: {value}\n"
|
154 |
return dashboard
|
155 |
|
|
|
156 |
# Gradio Interface with Tabs
|
157 |
def build_interface():
|
158 |
with gr.Blocks() as demo:
|
@@ -164,16 +165,18 @@ def build_interface():
|
|
164 |
language_input = gr.Dropdown(["en", "es", "fr", "zh"], label="Select Language") # Language codes
|
165 |
|
166 |
submit_button = gr.Button("Post and Process")
|
167 |
-
|
168 |
with gr.Row():
|
169 |
post_output = gr.Textbox(label="Posting Status", interactive=False)
|
170 |
transcription_output = gr.JSON(label="Transcription JSON File")
|
171 |
translated_output = gr.JSON(label="Translated JSON File")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
-
submit_button.click(upload_and_manage,
|
174 |
-
inputs=[file_input, platform_input, language_input],
|
175 |
-
outputs=[post_output, transcription_output, translated_output, gr.State()])
|
176 |
-
|
177 |
with gr.Tab("Analytics Dashboard"):
|
178 |
gr.Markdown("## Content Performance Analytics")
|
179 |
analytics_output = gr.Textbox(label="Dashboard", interactive=False)
|
|
|
153 |
dashboard += f" {metric}: {value}\n"
|
154 |
return dashboard
|
155 |
|
156 |
+
# Gradio Interface with Tabs
|
157 |
# Gradio Interface with Tabs
|
158 |
def build_interface():
|
159 |
with gr.Blocks() as demo:
|
|
|
165 |
language_input = gr.Dropdown(["en", "es", "fr", "zh"], label="Select Language") # Language codes
|
166 |
|
167 |
submit_button = gr.Button("Post and Process")
|
|
|
168 |
with gr.Row():
|
169 |
post_output = gr.Textbox(label="Posting Status", interactive=False)
|
170 |
transcription_output = gr.JSON(label="Transcription JSON File")
|
171 |
translated_output = gr.JSON(label="Translated JSON File")
|
172 |
+
with gr.Row():
|
173 |
+
processed_video_output = gr.File(label="Download Processed Video", interactive=False) # Download button
|
174 |
+
submit_button.click(
|
175 |
+
upload_and_manage,
|
176 |
+
inputs=[file_input, platform_input, language_input],
|
177 |
+
outputs=[post_output, transcription_output, translated_output, processed_video_output]
|
178 |
+
)
|
179 |
|
|
|
|
|
|
|
|
|
180 |
with gr.Tab("Analytics Dashboard"):
|
181 |
gr.Markdown("## Content Performance Analytics")
|
182 |
analytics_output = gr.Textbox(label="Dashboard", interactive=False)
|