Update app.py
Browse files
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 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|