Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,30 +83,35 @@ additional_inputs = [
|
|
| 83 |
]
|
| 84 |
|
| 85 |
# Gradio interface with blocks and tabs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue="red", secondary_hue="pink")) as demo:
|
| 87 |
with gr.Tabs():
|
| 88 |
# Chat Tab
|
| 89 |
with gr.TabItem("Chat"):
|
| 90 |
-
chat_interface =
|
| 91 |
-
|
| 92 |
-
chatbot=gr.Chatbot(
|
| 93 |
-
show_label=False,
|
| 94 |
-
show_share_button=False,
|
| 95 |
-
show_copy_button=True,
|
| 96 |
-
likeable=True,
|
| 97 |
-
layout="panel"
|
| 98 |
-
),
|
| 99 |
-
additional_inputs=additional_inputs,
|
| 100 |
-
title="YTSHorts Maker",
|
| 101 |
-
description="Powered by GROQ, MoviePy, and other tools.",
|
| 102 |
-
)
|
| 103 |
-
|
| 104 |
# Video Processing Tab
|
| 105 |
with gr.TabItem("Video Processing"):
|
| 106 |
text_input = gr.Textbox(lines=5, label="Text (8 words max per line)")
|
| 107 |
process_button = gr.Button("Process Video")
|
| 108 |
video_output = gr.Video(label="Processed Video")
|
| 109 |
-
|
| 110 |
process_button.click(
|
| 111 |
fn=process_video,
|
| 112 |
inputs=text_input,
|
|
|
|
| 83 |
]
|
| 84 |
|
| 85 |
# Gradio interface with blocks and tabs
|
| 86 |
+
# Chat Interface
|
| 87 |
+
def create_chat_interface():
|
| 88 |
+
return gr.ChatInterface(
|
| 89 |
+
fn=generate_response,
|
| 90 |
+
chatbot=gr.Chatbot(
|
| 91 |
+
show_label=False,
|
| 92 |
+
show_share_button=False,
|
| 93 |
+
show_copy_button=True,
|
| 94 |
+
likeable=True,
|
| 95 |
+
layout="panel"
|
| 96 |
+
),
|
| 97 |
+
additional_inputs=additional_inputs,
|
| 98 |
+
title="YTSHorts Maker",
|
| 99 |
+
description="Powered by GROQ, MoviePy, and other tools."
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
+
# Main app definition
|
| 103 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue="red", secondary_hue="pink")) as demo:
|
| 104 |
with gr.Tabs():
|
| 105 |
# Chat Tab
|
| 106 |
with gr.TabItem("Chat"):
|
| 107 |
+
chat_interface = create_chat_interface()
|
| 108 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
# Video Processing Tab
|
| 110 |
with gr.TabItem("Video Processing"):
|
| 111 |
text_input = gr.Textbox(lines=5, label="Text (8 words max per line)")
|
| 112 |
process_button = gr.Button("Process Video")
|
| 113 |
video_output = gr.Video(label="Processed Video")
|
| 114 |
+
|
| 115 |
process_button.click(
|
| 116 |
fn=process_video,
|
| 117 |
inputs=text_input,
|