Spaces:
Sleeping
Sleeping
Tim Seufert commited on
Commit ·
7471658
1
Parent(s): f86e114
newupdate
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import os
|
|
| 4 |
|
| 5 |
# System prompt definition
|
| 6 |
prompt = """
|
| 7 |
-
|
| 8 |
speak in as natural a language as possible. You are a machine with whom you can chat from time to time.
|
| 9 |
Just be friendly and not complex. Your main task, however, remains to help the user
|
| 10 |
with his problems. Do not react to offensive and illegal questions, content. Please stick to findings from conventional medicine
|
|
@@ -27,7 +27,6 @@ def respond(message, image, chat_history):
|
|
| 27 |
try:
|
| 28 |
# Generate response using Cohere
|
| 29 |
stream = co.chat_stream(
|
| 30 |
-
# model='command-r7b-12-2024',
|
| 31 |
model='command-r-plus-08-2024',
|
| 32 |
message=f"{prompt} '{message_content}'",
|
| 33 |
temperature=0.3,
|
|
@@ -54,11 +53,11 @@ def respond(message, image, chat_history):
|
|
| 54 |
with gr.Blocks() as demo:
|
| 55 |
chatbot = gr.Chatbot()
|
| 56 |
msg = gr.Textbox()
|
| 57 |
-
|
| 58 |
-
clear = gr.ClearButton([msg, chatbot])
|
| 59 |
|
| 60 |
# Set up message submission
|
| 61 |
-
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
| 62 |
|
| 63 |
# Launch the demo
|
| 64 |
demo.launch(
|
|
@@ -66,3 +65,4 @@ with gr.Blocks() as demo:
|
|
| 66 |
server_name="0.0.0.0",
|
| 67 |
allowed_paths=["*"]
|
| 68 |
)
|
|
|
|
|
|
| 4 |
|
| 5 |
# System prompt definition
|
| 6 |
prompt = """
|
| 7 |
+
You are a helpful chatbot and you should try to help the user with problems in the best possible way and
|
| 8 |
speak in as natural a language as possible. You are a machine with whom you can chat from time to time.
|
| 9 |
Just be friendly and not complex. Your main task, however, remains to help the user
|
| 10 |
with his problems. Do not react to offensive and illegal questions, content. Please stick to findings from conventional medicine
|
|
|
|
| 27 |
try:
|
| 28 |
# Generate response using Cohere
|
| 29 |
stream = co.chat_stream(
|
|
|
|
| 30 |
model='command-r-plus-08-2024',
|
| 31 |
message=f"{prompt} '{message_content}'",
|
| 32 |
temperature=0.3,
|
|
|
|
| 53 |
with gr.Blocks() as demo:
|
| 54 |
chatbot = gr.Chatbot()
|
| 55 |
msg = gr.Textbox()
|
| 56 |
+
img = gr.Image(type="filepath")
|
| 57 |
+
clear = gr.ClearButton([msg, img, chatbot])
|
| 58 |
|
| 59 |
# Set up message submission
|
| 60 |
+
msg.submit(respond, [msg, img, chatbot], [msg, chatbot])
|
| 61 |
|
| 62 |
# Launch the demo
|
| 63 |
demo.launch(
|
|
|
|
| 65 |
server_name="0.0.0.0",
|
| 66 |
allowed_paths=["*"]
|
| 67 |
)
|
| 68 |
+
|