Omnibus commited on
Commit
eabbeea
·
verified ·
1 Parent(s): af2ae6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -265,9 +265,16 @@ def save_memory(purpose, history):
265
  print (keyw.split("[")[1].split("]")[0])
266
  keyw=keyw.split("[")[1].split("]")[0]
267
  for ea in keyw.split(","):
 
268
  ea=ea.strip().strip("\n")
269
- print(ea)
270
- key_box.append(ea)
 
 
 
 
 
 
271
  lod.append({"file_name":timename,"keywords":key_box})
272
  json_object = json.dumps(lod, indent=4)
273
  with open(f"tmp2-{uid}.json", "w") as outfile2:
 
265
  print (keyw.split("[")[1].split("]")[0])
266
  keyw=keyw.split("[")[1].split("]")[0]
267
  for ea in keyw.split(","):
268
+ s1=""
269
  ea=ea.strip().strip("\n")
270
+ for ev in ea:
271
+ if ev.isalnum():
272
+ s1=s1.join(ev)
273
+ if ev == " ":
274
+ s1=s1.join(ev)
275
+ #ea=s1
276
+ print(s1)
277
+ key_box.append(s1)
278
  lod.append({"file_name":timename,"keywords":key_box})
279
  json_object = json.dumps(lod, indent=4)
280
  with open(f"tmp2-{uid}.json", "w") as outfile2: