Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -560,19 +560,18 @@ def save_memory(purpose, history):
|
|
560 |
lod.append({"file_name":f"{timename}---{s}-{ee}","keywords":key_box,"description":str(desc),"index":f"{s}:{ee}"})
|
561 |
key_box = []
|
562 |
desc=""
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
outfile2.
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
)
|
576 |
|
577 |
ee=ee+chunk
|
578 |
s=s+chunk
|
|
|
560 |
lod.append({"file_name":f"{timename}---{s}-{ee}","keywords":key_box,"description":str(desc),"index":f"{s}:{ee}"})
|
561 |
key_box = []
|
562 |
desc=""
|
563 |
+
json_object = json.dumps(lod, indent=4)
|
564 |
+
with open(f"tmp2-{uid}.json", "w") as outfile2:
|
565 |
+
outfile2.write(json_object)
|
566 |
+
outfile2.close()
|
567 |
+
api.upload_file(
|
568 |
+
path_or_fileobj=f"tmp2-{uid}.json",
|
569 |
+
path_in_repo=f"/mem-test2/main.json",
|
570 |
+
repo_id=reponame,
|
571 |
+
#repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
|
572 |
+
token=token_self,
|
573 |
+
repo_type="dataset",
|
574 |
+
)
|
|
|
575 |
|
576 |
ee=ee+chunk
|
577 |
s=s+chunk
|