Spaces:
Paused
Paused
Upload app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ https://blog.csdn.net/xmh_free/article/details/127210992
|
|
17 |
async def get_model_reply(prompt,style,cookies,context=[]):
|
18 |
# combines the new question with a previous context
|
19 |
|
20 |
-
context
|
21 |
cookies = json.loads(cookies)
|
22 |
# given the most recent context (4096 characters)
|
23 |
# continue the text up to 2048 tokens ~ 8192 charaters
|
@@ -26,7 +26,7 @@ async def get_model_reply(prompt,style,cookies,context=[]):
|
|
26 |
await bot.close()
|
27 |
#print(raw_data)
|
28 |
response = raw_data["item"]["messages"][1]["text"]
|
29 |
-
context
|
30 |
|
31 |
# list of (user, bot) responses. We will use this format later
|
32 |
responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
|
|
|
17 |
async def get_model_reply(prompt,style,cookies,context=[]):
|
18 |
# combines the new question with a previous context
|
19 |
|
20 |
+
context = [prompt]
|
21 |
cookies = json.loads(cookies)
|
22 |
# given the most recent context (4096 characters)
|
23 |
# continue the text up to 2048 tokens ~ 8192 charaters
|
|
|
26 |
await bot.close()
|
27 |
#print(raw_data)
|
28 |
response = raw_data["item"]["messages"][1]["text"]
|
29 |
+
context = [response]
|
30 |
|
31 |
# list of (user, bot) responses. We will use this format later
|
32 |
responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
|