Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -217,39 +217,7 @@ def search(term, num_results=1, lang="ko", advanced=True, sleep_interval=0, time
|
|
217 |
|
218 |
|
219 |
client = InferenceClient("peterpeter8585/AIAI")
|
220 |
-
def respond1(
|
221 |
-
message,
|
222 |
-
history: list[tuple[str, str]],
|
223 |
-
system_message,
|
224 |
-
max_tokens,
|
225 |
-
temperature,
|
226 |
-
top_p,
|
227 |
-
password
|
228 |
-
):
|
229 |
-
if password==password1:
|
230 |
-
messages = [{"role": "system", "content": "Your name is Chatchat.And your creator of you is Sung Yoon.In Korean, it is 정성윤.These are the instructions for you:"+system_message}]
|
231 |
-
|
232 |
-
for val in history:
|
233 |
-
if val[0]:
|
234 |
-
messages.append({"role": "user", "content": val[0]})
|
235 |
-
if val[1]:
|
236 |
-
messages.append({"role": "assistant", "content": val[1]})
|
237 |
-
|
238 |
-
messages.append({"role": "user", "content": message})
|
239 |
|
240 |
-
response = ""
|
241 |
-
|
242 |
-
for message in client.chat_completion(
|
243 |
-
messages,
|
244 |
-
max_tokens=max_tokens,
|
245 |
-
stream=True,
|
246 |
-
temperature=temperature,
|
247 |
-
top_p=top_p,
|
248 |
-
):
|
249 |
-
token = message.choices[0].delta.content
|
250 |
-
|
251 |
-
response += token
|
252 |
-
yield response
|
253 |
examples = [
|
254 |
"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
|
255 |
"An astronaut riding a green horse",
|
|
|
217 |
|
218 |
|
219 |
client = InferenceClient("peterpeter8585/AIAI")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
examples = [
|
222 |
"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
|
223 |
"An astronaut riding a green horse",
|