TIMBOVILL commited on
Commit
1acd8d1
1 Parent(s): 04240c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -9
app.py CHANGED
@@ -73,13 +73,16 @@ 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
- chat_interface = gr.Interface(
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)")
@@ -93,13 +96,13 @@ def process_video_interface():
93
  fn=process_video_callback,
94
  inputs=text_input,
95
  outputs=video_output,
96
- title="Video Processing",
97
  description="Select a video file from 'videos' folder, add text, and process.",
98
  )
99
 
100
  demo = gr.Interface(
101
  fn=None, # No main function needed for multi-interface setup
102
- interfaces=[chat_interface, process_video_interface()],
103
  title="YTSHorts Maker",
104
  description="Powered by GROQ, MoviePy, and other tools.",
105
  theme="soft",
 
73
  gr.Number(precision=0, value=42, label="Seed", info="A starting point to initiate generation, use 0 for random")
74
  ]
75
 
76
+ def chat_interface():
77
+ return gr.Interface(
78
+ fn=generate_response,
79
+ inputs=["text", "history", "model", "temperature", "max_tokens", "top_p", "seed"],
80
+ outputs="text",
81
+ title="YTSHorts Maker - Chat Interface",
82
+ description="Powered by GROQ.",
83
+ additional_inputs=additional_inputs,
84
+ live=True # Enable live updates for the chat interface
85
+ )
86
 
87
  def process_video_interface():
88
  text_input = gr.Textbox(lines=5, label="Text (8 words max per line)")
 
96
  fn=process_video_callback,
97
  inputs=text_input,
98
  outputs=video_output,
99
+ title="YTSHorts Maker - Video Processing",
100
  description="Select a video file from 'videos' folder, add text, and process.",
101
  )
102
 
103
  demo = gr.Interface(
104
  fn=None, # No main function needed for multi-interface setup
105
+ interfaces=[chat_interface(), process_video_interface()],
106
  title="YTSHorts Maker",
107
  description="Powered by GROQ, MoviePy, and other tools.",
108
  theme="soft",