peterpeter8585 commited on
Commit
da15395
1 Parent(s): 8da3082

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -123,7 +123,7 @@ def search(term, num_results=1, lang="en", advanced=True, sleep_interval=0, time
123
  return all_results
124
 
125
 
126
- client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
127
 
128
 
129
  def respond(
@@ -134,10 +134,18 @@ def respond(
134
  temperature,
135
  top_p,
136
  ):
137
- messages = "<s>[SYSTEM] Your name is Chatchat.Answer as Real OpenGPT 4o, Made by 'peterpeter8585', Keep conversation very short, clear, friendly and concise. The text provided is a request for a specific type of response from you, the virtual assistant. The request asks you to provide friendly responses. The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, your task is to generate responses that appear as if they are created by the user and not an AI-powered assistant.If the user asks with Korean, you must answer with Korean.Or 8f the user asks with English, you have to answer with English.Do not transelate it.[USER]"+system_message
138
  web_results = search(message)
139
  web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results])
140
- formatted_prompt = messages + message + "[WEB]" + str(web2) + "[OpenGPT 4o]"
 
 
 
 
 
 
 
 
 
141
 
142
 
143
  response = ""
 
123
  return all_results
124
 
125
 
126
+ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
127
 
128
 
129
  def respond(
 
134
  temperature,
135
  top_p,
136
  ):
 
137
  web_results = search(message)
138
  web2 = ' '.join([f"Link: {res['link']}\nText: {res['text']}\n\n" for res in web_results])
139
+ messages1 = "Your name is Chatchat.Answer as Real OpenGPT 4o, Made by 'peterpeter8585', Keep conversation very short, clear, friendly and concise. The text provided is a request for a specific type of response from you, the virtual assistant. The request asks you to provide friendly responses. The expectation is that I will avoid introductions and start answering the query directly, elaborating on all aspects of the request. As an AI-powered assistant, your task is to generate responses that appear as if they are created by the user and not an AI-powered assistant.If the user asks with Korean, you must answer with Korean.Or if the user asks with English, you have to answer with English.Do not transelate it.This is the web search result, use itto answer the user's questions.:"+web2+"And the instructions:"+system_message
140
+ messages = [{"role": "system", "content":messages1}]
141
+
142
+ for val in history:
143
+ if val[0]:
144
+ messages.append({"role": "user", "content": val[0]})
145
+ if val[1]:
146
+ messages.append({"role": "assistant", "content": val[1]})
147
+
148
+ messages.append({"role": "user", "content": message})
149
 
150
 
151
  response = ""