Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -441,6 +441,8 @@ def save_memory(purpose, history):
|
|
| 441 |
#json_object = json.dumps(out_box,indent=4)
|
| 442 |
with open(f"tmp-{uid}.json", "w") as outfile:
|
| 443 |
outfile.write(json_object)
|
|
|
|
|
|
|
| 444 |
api.upload_file(
|
| 445 |
path_or_fileobj=f"tmp-{uid}.json",
|
| 446 |
path_in_repo=f"/mem-test2/{timename}---{s}-{ee}.json",
|
|
@@ -486,6 +488,7 @@ def save_memory(purpose, history):
|
|
| 486 |
json_object = json.dumps(lod, indent=4)
|
| 487 |
with open(f"tmp2-{uid}.json", "w") as outfile2:
|
| 488 |
outfile2.write(json_object)
|
|
|
|
| 489 |
api.upload_file(
|
| 490 |
path_or_fileobj=f"tmp2-{uid}.json",
|
| 491 |
path_in_repo=f"/mem-test2/main.json",
|
|
@@ -494,9 +497,9 @@ def save_memory(purpose, history):
|
|
| 494 |
token=token_self,
|
| 495 |
repo_type="dataset",
|
| 496 |
)
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
return out_box
|
| 501 |
|
| 502 |
|
|
|
|
| 441 |
#json_object = json.dumps(out_box,indent=4)
|
| 442 |
with open(f"tmp-{uid}.json", "w") as outfile:
|
| 443 |
outfile.write(json_object)
|
| 444 |
+
|
| 445 |
+
outfile.close()
|
| 446 |
api.upload_file(
|
| 447 |
path_or_fileobj=f"tmp-{uid}.json",
|
| 448 |
path_in_repo=f"/mem-test2/{timename}---{s}-{ee}.json",
|
|
|
|
| 488 |
json_object = json.dumps(lod, indent=4)
|
| 489 |
with open(f"tmp2-{uid}.json", "w") as outfile2:
|
| 490 |
outfile2.write(json_object)
|
| 491 |
+
outfile2.close()
|
| 492 |
api.upload_file(
|
| 493 |
path_or_fileobj=f"tmp2-{uid}.json",
|
| 494 |
path_in_repo=f"/mem-test2/main.json",
|
|
|
|
| 497 |
token=token_self,
|
| 498 |
repo_type="dataset",
|
| 499 |
)
|
| 500 |
+
ee=ee+chunk-1000
|
| 501 |
+
s=s+chunk-1000
|
| 502 |
+
out_box.append(resp)
|
| 503 |
return out_box
|
| 504 |
|
| 505 |
|