freddyaboulton HF Staff commited on
Commit
ec31fe5
·
verified ·
1 Parent(s): a2b062f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -12
app.py CHANGED
@@ -222,18 +222,22 @@ def generate(data: WebRTCData, history: list[dict], system_prompt: str = "", max
222
 
223
 
224
  with gr.Blocks() as demo:
225
- chatbot = gr.Chatbot(type="messages")
226
- webrtc = WebRTC(
227
- modality="audio",
228
- mode="send",
229
- variant="textbox",
230
- rtc_configuration=get_hf_turn_credentials,
231
- server_rtc_configuration=get_hf_turn_credentials(ttl=3_600 * 24 * 30),
232
- )
233
- with gr.Accordion(label="Additional Inputs"):
234
- sp = gr.Textbox(label="System Prompt", value="You are a helpful assistant.")
235
- slider = gr.Slider(label="Max New Tokens", minimum=100, maximum=2000, step=10, value=700)
236
- image = gr.Image(type="filepath")
 
 
 
 
237
 
238
  webrtc.stream(
239
  ReplyOnPause(generate), # type: ignore
 
222
 
223
 
224
  with gr.Blocks() as demo:
225
+ with gr.Row():
226
+ with gr.Column(scale=1):
227
+ image = gr.Image(type="filepath", label="Image Input")
228
+ with gr.Column(scale=4):
229
+ chatbot = gr.Chatbot(type="messages")
230
+ webrtc = WebRTC(
231
+ modality="audio",
232
+ mode="send",
233
+ variant="textbox",
234
+ rtc_configuration=get_hf_turn_credentials,
235
+ server_rtc_configuration=get_hf_turn_credentials(ttl=3_600 * 24 * 30),
236
+ )
237
+ with gr.Row():
238
+ with gr.Accordion(label="Additional Inputs"):
239
+ sp = gr.Textbox(label="System Prompt", value="You are a helpful assistant.")
240
+ slider = gr.Slider(label="Max New Tokens", minimum=100, maximum=2000, step=10, value=700)
241
 
242
  webrtc.stream(
243
  ReplyOnPause(generate), # type: ignore