Pankaj Mathur
commited on
Commit
•
ee5711c
1
Parent(s):
827bd46
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,6 @@ def clear_chat(chat_history_state, chat_message):
|
|
24 |
|
25 |
def user(message, history):
|
26 |
history = history or []
|
27 |
-
# Append the user's message to the conversation history
|
28 |
history.append([message, ""])
|
29 |
return "", history
|
30 |
|
@@ -35,9 +34,7 @@ def chat(history, system_message, max_tokens, temperature, top_p, top_k, repetit
|
|
35 |
messages = BASE_SYSTEM_MESSAGE + system_message.strip() + \
|
36 |
"\n".join(["\n".join(["### User: "+item[0]+"\n\n", "### Assistant: \n"+item[1]+"\n\n"])
|
37 |
for item in history])
|
38 |
-
# strip the last `<|end_of_turn|>` from the messages
|
39 |
messages = messages.rstrip("\n\n")
|
40 |
-
# remove last space from assistant, some models output a ZWSP if you leave a space
|
41 |
messages = messages.rstrip()
|
42 |
|
43 |
prediction = make_prediction(
|
@@ -77,17 +74,16 @@ with gr.Blocks(css=CSS) as demo:
|
|
77 |
with gr.Row():
|
78 |
gr.Markdown("# orca-mini chatbot")
|
79 |
with gr.Row():
|
80 |
-
#chatbot = gr.Chatbot().style(height=500)
|
81 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
82 |
with gr.Row():
|
83 |
message = gr.Textbox(
|
84 |
label="Hello, I am orca-mini, How can I help you today?",
|
85 |
-
placeholder="Ask me anything!",
|
86 |
lines=3,
|
87 |
)
|
88 |
with gr.Row():
|
89 |
-
submit = gr.Button(value="Send
|
90 |
-
clear = gr.Button(value="Clear
|
91 |
stop = gr.Button(value="Stop", variant="secondary").style(full_width=False)
|
92 |
with gr.Accordion("Show Model Parameters", open=False):
|
93 |
with gr.Row():
|
|
|
24 |
|
25 |
def user(message, history):
|
26 |
history = history or []
|
|
|
27 |
history.append([message, ""])
|
28 |
return "", history
|
29 |
|
|
|
34 |
messages = BASE_SYSTEM_MESSAGE + system_message.strip() + \
|
35 |
"\n".join(["\n".join(["### User: "+item[0]+"\n\n", "### Assistant: \n"+item[1]+"\n\n"])
|
36 |
for item in history])
|
|
|
37 |
messages = messages.rstrip("\n\n")
|
|
|
38 |
messages = messages.rstrip()
|
39 |
|
40 |
prediction = make_prediction(
|
|
|
74 |
with gr.Row():
|
75 |
gr.Markdown("# orca-mini chatbot")
|
76 |
with gr.Row():
|
|
|
77 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
78 |
with gr.Row():
|
79 |
message = gr.Textbox(
|
80 |
label="Hello, I am orca-mini, How can I help you today?",
|
81 |
+
placeholder="Ask me anything! For example, I'm going to cook for my date who claims to be a picky eater. Can you recommend me a dish that's easy to cook?",
|
82 |
lines=3,
|
83 |
)
|
84 |
with gr.Row():
|
85 |
+
submit = gr.Button(value="Send", variant="secondary").style(full_width=True)
|
86 |
+
clear = gr.Button(value="Clear", variant="secondary").style(full_width=False)
|
87 |
stop = gr.Button(value="Stop", variant="secondary").style(full_width=False)
|
88 |
with gr.Accordion("Show Model Parameters", open=False):
|
89 |
with gr.Row():
|