Spaces:
Sleeping
Sleeping
vtrv.vls
commited on
Commit
·
deb74eb
1
Parent(s):
2103f08
New API
Browse files
app.py
CHANGED
@@ -15,9 +15,10 @@ TINY_LLAMA = None
|
|
15 |
S3_SESSION = None
|
16 |
|
17 |
def giga_gen(content, chat_history):
|
|
|
18 |
print(chat_history)
|
19 |
res = generate(chat_history,'auth_token.json')
|
20 |
-
chat_history.append(
|
21 |
send_to_s3(res, f'protobench/giga_{str(datetime.now()).replace(" ", "_")}.json', S3_SESSION)
|
22 |
print(chat_history)
|
23 |
return '', chat_history
|
|
|
15 |
S3_SESSION = None
|
16 |
|
17 |
def giga_gen(content, chat_history):
|
18 |
+
chat_history.append([content])
|
19 |
print(chat_history)
|
20 |
res = generate(chat_history,'auth_token.json')
|
21 |
+
chat_history[-1].append(res)
|
22 |
send_to_s3(res, f'protobench/giga_{str(datetime.now()).replace(" ", "_")}.json', S3_SESSION)
|
23 |
print(chat_history)
|
24 |
return '', chat_history
|
utils.py
CHANGED
@@ -64,7 +64,8 @@ def generate(content=None, auth_file=None):
|
|
64 |
content_giga = []
|
65 |
for step in content:
|
66 |
content_giga.append({'role': 'user', 'content': step[0]})
|
67 |
-
|
|
|
68 |
|
69 |
resp = get_text(content, auth_token['access_token'])
|
70 |
|
|
|
64 |
content_giga = []
|
65 |
for step in content:
|
66 |
content_giga.append({'role': 'user', 'content': step[0]})
|
67 |
+
if len(step) >= 1:
|
68 |
+
content_giga.append({'role': 'assistant', 'content': step[1]})
|
69 |
|
70 |
resp = get_text(content, auth_token['access_token'])
|
71 |
|