Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -73,25 +73,39 @@ additional_inputs = [
|
|
73 |
gr.Number(precision=0, value=42, label="Seed", info="A starting point to initiate generation, use 0 for random")
|
74 |
]
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
demo.launch()
|
|
|
73 |
gr.Number(precision=0, value=42, label="Seed", info="A starting point to initiate generation, use 0 for random")
|
74 |
]
|
75 |
|
76 |
+
chat_interface = gr.ChatInterface(
|
77 |
+
fn=generate_response,
|
78 |
+
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
|
79 |
+
additional_inputs=additional_inputs,
|
80 |
+
title="YTSHorts Maker",
|
81 |
+
description="Powered by GROQ, MoviePy, and other tools.",
|
82 |
+
)
|
83 |
+
|
84 |
+
def process_video_interface():
|
85 |
+
text_input = gr.Textbox(lines=5, label="Text (8 words max per line)")
|
86 |
+
process_button = gr.Button("Process Video")
|
87 |
+
video_output = gr.Video(label="Processed Video")
|
88 |
+
|
89 |
+
def process_video_callback():
|
90 |
+
text = text_input.value
|
91 |
+
output_path = process_video(text)
|
92 |
+
video_output.value = output_path
|
93 |
+
|
94 |
+
process_button.click(process_video_callback)
|
95 |
+
|
96 |
+
return gr.Interface(
|
97 |
+
fn=process_video_callback,
|
98 |
+
inputs=[text_input],
|
99 |
+
outputs=video_output,
|
100 |
+
title="Video Processing",
|
101 |
+
description="Select a video file from 'videos' folder, add text, and process.",
|
102 |
+
)
|
103 |
+
|
104 |
+
demo = gr.Interface(
|
105 |
+
[chat_interface, process_video_interface()],
|
106 |
+
title="YTSHorts Maker",
|
107 |
+
description="Powered by GROQ, MoviePy, and other tools.",
|
108 |
+
theme="soft",
|
109 |
+
)
|
110 |
|
111 |
demo.launch()
|