Spaces:
Running
on
Zero
Running
on
Zero
macadeliccc
commited on
Commit
·
d21b363
1
Parent(s):
d2b7f91
test
Browse files
app.py
CHANGED
@@ -48,22 +48,19 @@ def chat_with_ochat(message):
|
|
48 |
|
49 |
|
50 |
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
inputs=gr.Textbox(lines=2, placeholder="Type your message here..."),
|
58 |
-
outputs=[
|
59 |
-
gr.Textbox(label="ochat Response", placeholder="Response will appear here...", interactive=False),
|
60 |
-
gr.Button("Clear Chat", fn=clear_chat)
|
61 |
-
],
|
62 |
-
title="ochat Chat Interface",
|
63 |
-
description="Engage in a conversation with the ochat server. Type your message below and get a response.",
|
64 |
-
layout="vertical",
|
65 |
-
theme="huggingface", # This is an example theme, you can choose others
|
66 |
-
css=".input_text {height: 50px;} .output_text {height: 100px;}"
|
67 |
-
)
|
68 |
|
69 |
-
|
|
|
|
|
|
48 |
|
49 |
|
50 |
|
51 |
+
# Create a Gradio Blocks interface
|
52 |
+
with gr.Blocks() as app:
|
53 |
+
gr.Markdown("### vLLM OpenChat-3.5 Interface")
|
54 |
+
gr.Markdown("Type your message and get a response from the ochat server.")
|
55 |
+
with gr.Row():
|
56 |
+
input_text = gr.Textbox(label="Your Message")
|
57 |
+
submit_button = gr.Button("Send")
|
58 |
+
output_text = gr.Textbox(label="ochat Response", interactive=False)
|
59 |
|
60 |
+
def update_output():
|
61 |
+
response = chat_with_ochat(input_text.value)
|
62 |
+
output_text.update(value=response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
+
submit_button.click(fn=update_output, inputs=input_text, outputs=output_text)
|
65 |
+
|
66 |
+
app.launch()
|