Omnibus commited on
Commit
3cb3ca5
·
verified ·
1 Parent(s): 73cf9ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
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
- if lod:
564
- json_object = json.dumps(lod, indent=4)
565
- with open(f"tmp2-{uid}.json", "w") as outfile2:
566
- outfile2.write(json_object)
567
- outfile2.close()
568
- api.upload_file(
569
- path_or_fileobj=f"tmp2-{uid}.json",
570
- path_in_repo=f"/mem-test2/main.json",
571
- repo_id=reponame,
572
- #repo_id=save_data.split('datasets/',1)[1].split('/raw',1)[0],
573
- token=token_self,
574
- repo_type="dataset",
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