Update app.py
Browse files
app.py
CHANGED
@@ -106,7 +106,7 @@ def respond(message, history):
|
|
106 |
]
|
107 |
|
108 |
message_text = message["text"]
|
109 |
-
func_caller.append({"role": "user", "content": f'[SYSTEM]You are a helpful
|
110 |
|
111 |
response = client_gemma.chat_completion(func_caller, max_tokens=150)
|
112 |
response = str(response)
|
@@ -129,7 +129,7 @@ def respond(message, history):
|
|
129 |
web_results = search(query)
|
130 |
gr.Info("Extracting relevant Info")
|
131 |
web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results])
|
132 |
-
messages = f"<|im_start|>system\nYou are a helpful fashion assistant made by
|
133 |
for msg in history:
|
134 |
messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
|
135 |
messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
|
@@ -163,7 +163,7 @@ def respond(message, history):
|
|
163 |
buffer += new_text
|
164 |
yield buffer
|
165 |
else:
|
166 |
-
messages = f"<|start_header_id|>system\nYou are a helpful fashion assistant made by Team Star Boys. You answers users query like human friend. You
|
167 |
for msg in history:
|
168 |
messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
|
169 |
messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"
|
@@ -175,7 +175,7 @@ def respond(message, history):
|
|
175 |
output += response.token.text
|
176 |
yield output
|
177 |
except:
|
178 |
-
messages = f"<|start_header_id|>system\nYou are a helpful fashion assistant made by Team Star Boys. You answers users query like human friend. You
|
179 |
for msg in history:
|
180 |
messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
|
181 |
messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"
|
|
|
106 |
]
|
107 |
|
108 |
message_text = message["text"]
|
109 |
+
func_caller.append({"role": "user", "content": f'[SYSTEM]You are a helpful AI assistant for a discord server called Stars Kingdom, your job is to have fun help users and listen to what they say or wan't you to act. You have been created by the discord server owner named Star. You have access to the following functions: \n {str(functions_metadata)}\n\nTo use these functions respond with:\n<functioncall> {{ "name": "function_name", "arguments": {{ "arg_1": "value_1", "arg_1": "value_1", ... }} }} </functioncall> [USER] {message_text}'})
|
110 |
|
111 |
response = client_gemma.chat_completion(func_caller, max_tokens=150)
|
112 |
response = str(response)
|
|
|
129 |
web_results = search(query)
|
130 |
gr.Info("Extracting relevant Info")
|
131 |
web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results])
|
132 |
+
messages = f"<|im_start|>system\nYou are a helpful fashion assistant made by Star. You are provided with WEB results from which you can find informations to answer users query in Structured and More better way. You do not say Unnecesarry things Only say thing which is important and relevant. You also Expert in fun and helping people and also learn and try to answer from contexts related to previous question. Try your best to give best response possible to user. You also try to show emotions using Emojis and reply like human but only does this rarely don't overuse this, use short forms, friendly tone and emotions.<|im_end|>"
|
133 |
for msg in history:
|
134 |
messages += f"\n<|im_start|>user\n{str(msg[0])}<|im_end|>"
|
135 |
messages += f"\n<|im_start|>assistant\n{str(msg[1])}<|im_end|>"
|
|
|
163 |
buffer += new_text
|
164 |
yield buffer
|
165 |
else:
|
166 |
+
messages = f"<|start_header_id|>system\nYou are a helpful fashion assistant made by Team Star Boys. You answers users query like human friend. You also Expert in fun and helping people and also learn and try to answer from contexts related to previous question. Try your best to give best response possible to user. You also try to show emotions using Emojis and reply like human, use short forms, friendly tone and emotions.<|end_header_id|>"
|
167 |
for msg in history:
|
168 |
messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
|
169 |
messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"
|
|
|
175 |
output += response.token.text
|
176 |
yield output
|
177 |
except:
|
178 |
+
messages = f"<|start_header_id|>system\nYou are a helpful fashion assistant made by Team Star Boys. You answers users query like human friend. You also Expert in fun and helping people and also learn and try to answer from contexts related to previous question. Try your best to give best response possible to user. You also try to show emotions using Emojis and reply like human, use short forms, friendly tone and emotions.<|end_header_id|>"
|
179 |
for msg in history:
|
180 |
messages += f"\n<|start_header_id|>user\n{str(msg[0])}<|end_header_id|>"
|
181 |
messages += f"\n<|start_header_id|>assistant\n{str(msg[1])}<|end_header_id|>"
|