Spaces:
Sleeping
Sleeping
vtrv.vls
commited on
Commit
·
e4fda99
1
Parent(s):
0cea943
New API
Browse files
app.py
CHANGED
@@ -21,6 +21,7 @@ def giga_gen(content, chat_history):
|
|
21 |
chat_history.append({"role": "user", "content": content})
|
22 |
print(chat_history)
|
23 |
res = generate(chat_history,'auth_token.json')
|
|
|
24 |
send_to_s3(res, f'protobench/giga_{str(datetime.now()).replace(" ", "_")}.json', S3_SESSION)
|
25 |
print(chat_history)
|
26 |
return '', chat_history
|
|
|
21 |
chat_history.append({"role": "user", "content": content})
|
22 |
print(chat_history)
|
23 |
res = generate(chat_history,'auth_token.json')
|
24 |
+
chat_history.append({"role": "assistant", "content": res})
|
25 |
send_to_s3(res, f'protobench/giga_{str(datetime.now()).replace(" ", "_")}.json', S3_SESSION)
|
26 |
print(chat_history)
|
27 |
return '', chat_history
|
utils.py
CHANGED
@@ -62,7 +62,6 @@ def generate(content='Привет!', auth_file=None):
|
|
62 |
auth_token = json.load(f)
|
63 |
|
64 |
resp = get_text(content, auth_token['access_token'])
|
65 |
-
print(resp)
|
66 |
|
67 |
return resp["choices"][0]["message"]["content"]
|
68 |
|
|
|
62 |
auth_token = json.load(f)
|
63 |
|
64 |
resp = get_text(content, auth_token['access_token'])
|
|
|
65 |
|
66 |
return resp["choices"][0]["message"]["content"]
|
67 |
|