Spaces:
Runtime error
Runtime error
Commit
·
3e98569
1
Parent(s):
61a4fb2
more chatbots
Browse files
app.py
CHANGED
|
@@ -10,9 +10,13 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
| 10 |
|
| 11 |
with gr.Blocks() as demo:
|
| 12 |
with gr.Row():
|
| 13 |
-
vicuna_chatbot = gr.Chatbot(label="
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
def respond(message, chat_history, chatbot_idx):
|
| 18 |
input_ids = tokenizer.encode(message, return_tensors="pt")
|
|
@@ -22,6 +26,6 @@ with gr.Blocks() as demo:
|
|
| 22 |
time.sleep(2)
|
| 23 |
return "", chat_history
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
demo.launch()
|
|
|
|
| 10 |
|
| 11 |
with gr.Blocks() as demo:
|
| 12 |
with gr.Row():
|
| 13 |
+
vicuna_chatbot = gr.Chatbot(label="vicuna-7b", live=False)
|
| 14 |
+
llama_chatbot = gr.Chatbot(label="llama-7b", live=False)
|
| 15 |
+
gpt_chatbot = gr.Chatbot(label="gpt-3.5", live=False)
|
| 16 |
+
with gr.Row():
|
| 17 |
+
prompt = gr.Textbox(show_label=False, placeholder="Enter prompt")
|
| 18 |
+
send_button_Chunk = gr.Button("Send", scale=0)
|
| 19 |
+
clear = gr.ClearButton([prompt, vicuna_chatbot])
|
| 20 |
|
| 21 |
def respond(message, chat_history, chatbot_idx):
|
| 22 |
input_ids = tokenizer.encode(message, return_tensors="pt")
|
|
|
|
| 26 |
time.sleep(2)
|
| 27 |
return "", chat_history
|
| 28 |
|
| 29 |
+
prompt.submit(respond, [prompt, vicuna_chatbot, vicuna_chatbot])
|
| 30 |
|
| 31 |
demo.launch()
|