Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -65,45 +65,33 @@ def process_video(text):
|
|
65 |
|
66 |
return output_path
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
chat = chat_interface()
|
97 |
-
video_processor = process_video_interface()
|
98 |
-
|
99 |
-
# Now initialize the demo interface correctly
|
100 |
-
demo = gr.Interface(
|
101 |
-
fn=None, # No main function needed for multi-interface setup
|
102 |
-
interfaces=[chat, video_processor],
|
103 |
-
title="YTSHorts Maker",
|
104 |
-
description="Powered by GROQ, MoviePy, and other tools.",
|
105 |
-
theme="soft",
|
106 |
-
)
|
107 |
|
108 |
-
# Launch the demo interface
|
109 |
demo.launch()
|
|
|
65 |
|
66 |
return output_path
|
67 |
|
68 |
+
additional_inputs = [
|
69 |
+
gr.Dropdown(choices=["llama3-70b-8192", "llama3-8b-8192", "mixtral-8x7b-32768", "gemma-7b-it"], value="llama3-70b-8192", label="Model"),
|
70 |
+
gr.Slider(minimum=0.0, maximum=1.0, step=0.01, value=0.5, label="Temperature", info="Controls diversity of the generated text. Lower is more deterministic, higher is more creative."),
|
71 |
+
gr.Slider(minimum=1, maximum=32192, step=1, value=4096, label="Max Tokens", info="The maximum number of tokens that the model can process in a single response.<br>Maximums: 8k for gemma 7b, llama 7b & 70b, 32k for mixtral 8x7b."),
|
72 |
+
gr.Slider(minimum=0.0, maximum=1.0, step=0.01, value=0.5, label="Top P", info="A method of text generation where a model will only consider the most probable next tokens that make up the probability p."),
|
73 |
+
gr.Number(precision=0, value=42, label="Seed", info="A starting point to initiate generation, use 0 for random")
|
74 |
+
]
|
75 |
+
|
76 |
+
with gr.Blocks(theme=gr.themes.Soft(primary_hue="red", secondary_hue="pink")) as demo:
|
77 |
+
with gr.Tabs():
|
78 |
+
with gr.TabItem("Chat"):
|
79 |
+
chat_interface = gr.ChatInterface(
|
80 |
+
fn=generate_response,
|
81 |
+
chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
|
82 |
+
additional_inputs=additional_inputs,
|
83 |
+
title="YTSHorts Maker",
|
84 |
+
description="Powered by GROQ, MoviePy, and other tools.",
|
85 |
+
)
|
86 |
+
with gr.TabItem("Video Processing"):
|
87 |
+
text_input = gr.Textbox(lines=5, label="Text (8 words max per line)")
|
88 |
+
process_button = gr.Button("Process Video")
|
89 |
+
video_output = gr.Video(label="Processed Video")
|
90 |
+
|
91 |
+
process_button.click(
|
92 |
+
fn=process_video,
|
93 |
+
inputs=[text_input],
|
94 |
+
outputs=video_output,
|
95 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
|
|
97 |
demo.launch()
|