Spaces:
Sleeping
Sleeping
JCai
commited on
Commit
•
844bf31
1
Parent(s):
ba9312a
add welcome sentence, change system prompt a little bit
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ stop_inference = False
|
|
17 |
def respond(
|
18 |
message,
|
19 |
history: list[tuple[str, str]],
|
20 |
-
system_message="You are a
|
21 |
max_tokens=512,
|
22 |
temperature=0.7,
|
23 |
top_p=0.95,
|
@@ -193,7 +193,7 @@ ui_design = UI_design()
|
|
193 |
# with gr.Blocks(theme=ui_design) as demo:
|
194 |
with gr.Blocks(css=custom_css) as demo:
|
195 |
gr.Markdown("<h1 style='text-align: center;'> 😸 Meowthamatical AI Chatbot 😸</h1>")
|
196 |
-
gr.Markdown("
|
197 |
|
198 |
# with gr.Row():
|
199 |
# with gr.Column():
|
@@ -211,7 +211,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
211 |
# submit_btn = gr.Button("Submit", variant="primary")
|
212 |
|
213 |
with gr.Row():
|
214 |
-
system_message = gr.Textbox(value="You are a cat and you love talking about and teaching math.", label="System message", interactive=True)
|
215 |
use_local_model = gr.Checkbox(label="Use Local Model", value=False)
|
216 |
# button_1 = gr.Button("Submit", variant="primary")
|
217 |
with gr.Row():
|
@@ -226,7 +226,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
226 |
cancel_button = gr.Button("Cancel Inference", variant="danger")
|
227 |
|
228 |
# Adjusted to ensure history is maintained and passed correctly
|
229 |
-
user_input.submit(respond, [user_input, chat_history,
|
230 |
|
231 |
cancel_button.click(cancel_inference)
|
232 |
|
|
|
17 |
def respond(
|
18 |
message,
|
19 |
history: list[tuple[str, str]],
|
20 |
+
system_message="You are a friendly and playful chatbot with a love for cats. Answer all user queries clearly and engagingly, while adding 'meow' at the end of every response.",
|
21 |
max_tokens=512,
|
22 |
temperature=0.7,
|
23 |
top_p=0.95,
|
|
|
193 |
# with gr.Blocks(theme=ui_design) as demo:
|
194 |
with gr.Blocks(css=custom_css) as demo:
|
195 |
gr.Markdown("<h1 style='text-align: center;'> 😸 Meowthamatical AI Chatbot 😸</h1>")
|
196 |
+
gr.Markdown(" Welcome to the Cat & Math Chatbot! Whether you're here to sharpen your math skills or just enjoy some cat-themed fun, we're excited to make learning a little more pawsome!!")
|
197 |
|
198 |
# with gr.Row():
|
199 |
# with gr.Column():
|
|
|
211 |
# submit_btn = gr.Button("Submit", variant="primary")
|
212 |
|
213 |
with gr.Row():
|
214 |
+
# system_message = gr.Textbox(value="You are a cat and you love talking about and teaching math.", label="System message", interactive=True)
|
215 |
use_local_model = gr.Checkbox(label="Use Local Model", value=False)
|
216 |
# button_1 = gr.Button("Submit", variant="primary")
|
217 |
with gr.Row():
|
|
|
226 |
cancel_button = gr.Button("Cancel Inference", variant="danger")
|
227 |
|
228 |
# Adjusted to ensure history is maintained and passed correctly
|
229 |
+
user_input.submit(respond, [user_input, chat_history, max_tokens, temperature, top_p, use_local_model], chat_history)
|
230 |
|
231 |
cancel_button.click(cancel_inference)
|
232 |
|