Update app.py
Browse files
app.py
CHANGED
|
@@ -174,7 +174,7 @@ def respond(message, history):
|
|
| 174 |
buffer += new_text
|
| 175 |
yield buffer
|
| 176 |
else:
|
| 177 |
-
messages = f"<|im_start|>system\
|
| 178 |
for msg in history:
|
| 179 |
messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
|
| 180 |
messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
|
|
@@ -186,7 +186,7 @@ def respond(message, history):
|
|
| 186 |
output += response.token.text
|
| 187 |
yield output
|
| 188 |
except:
|
| 189 |
-
messages = f"<|start_header_id|>system\
|
| 190 |
for msg in history:
|
| 191 |
messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
|
| 192 |
messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"
|
|
@@ -202,19 +202,9 @@ def respond(message, history):
|
|
| 202 |
demo = gr.ChatInterface(
|
| 203 |
fn=respond,
|
| 204 |
chatbot=gr.Chatbot(layout="panel"),
|
| 205 |
-
description ="# OpenGPT 4o mini\n ### You can engage in chat, generate images, perform web searches, and Q&A with images.",
|
| 206 |
textbox=gr.MultimodalTextbox(),
|
| 207 |
multimodal=True,
|
| 208 |
concurrency_limit=200,
|
| 209 |
-
examples=[
|
| 210 |
-
{"text": "Hy, who are you?",},
|
| 211 |
-
{"text": "What's the current price of Bitcoin",},
|
| 212 |
-
{"text": "Search and Tell me what's trending on Youtube.",},
|
| 213 |
-
{"text": "Create A Beautiful image of Effiel Tower at Night",},
|
| 214 |
-
{"text": "Write me a Python function to calculate the first 10 digits of the fibonacci sequence.",},
|
| 215 |
-
{"text": "What's the colour of car in given image", "files": ["./car1.png"]},
|
| 216 |
-
{"text": "Read what's written on paper", "files": ["./paper_with_text.png"]},
|
| 217 |
-
],
|
| 218 |
cache_examples=False,
|
| 219 |
)
|
| 220 |
demo.launch()
|
|
|
|
| 174 |
buffer += new_text
|
| 175 |
yield buffer
|
| 176 |
else:
|
| 177 |
+
messages = f"<|im_start|>system\n 👋, I am Nora,mini a helpful assistant.Ask me! I will do my best!!<|im_end|>"
|
| 178 |
for msg in history:
|
| 179 |
messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
|
| 180 |
messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
|
|
|
|
| 186 |
output += response.token.text
|
| 187 |
yield output
|
| 188 |
except:
|
| 189 |
+
messages = f"<|start_header_id|>system\nHi 👋, I am Nora,mini a helpful assistant.Ask me! I will do my best!!<|end_header_id|>"
|
| 190 |
for msg in history:
|
| 191 |
messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
|
| 192 |
messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"
|
|
|
|
| 202 |
demo = gr.ChatInterface(
|
| 203 |
fn=respond,
|
| 204 |
chatbot=gr.Chatbot(layout="panel"),
|
|
|
|
| 205 |
textbox=gr.MultimodalTextbox(),
|
| 206 |
multimodal=True,
|
| 207 |
concurrency_limit=200,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
cache_examples=False,
|
| 209 |
)
|
| 210 |
demo.launch()
|