Omnibus commited on
Commit
02b3d4b
·
verified ·
1 Parent(s): 690bf48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -253,6 +253,7 @@ def save_memory(purpose, history):
253
  else:
254
  lod = []
255
  for i,line in enumerate(lines):
 
256
  print(f'LINE:: {line}')
257
  if ":" in line:
258
  print(f'line:: {line}')
@@ -263,8 +264,10 @@ def save_memory(purpose, history):
263
  print (keyw)
264
  print (keyw.split("[")[1].split("]")[0])
265
  keyw=keyw.split("[")[1].split("]")[0]
266
- print(keyw)
267
- lod.append({"file_name":timename,"keywords":[keyw]})
 
 
268
  json_object = json.dumps(lod, indent=4)
269
  with open(f"tmp2-{uid}.json", "w") as outfile2:
270
  outfile2.write(json_object)
 
253
  else:
254
  lod = []
255
  for i,line in enumerate(lines):
256
+ key_box=[]
257
  print(f'LINE:: {line}')
258
  if ":" in line:
259
  print(f'line:: {line}')
 
264
  print (keyw)
265
  print (keyw.split("[")[1].split("]")[0])
266
  keyw=keyw.split("[")[1].split("]")[0]
267
+ for ea in keyw.split(","):
268
+ print(ea)
269
+ key_box.append(ea)
270
+ lod.append({"file_name":timename,"keywords":key_box})
271
  json_object = json.dumps(lod, indent=4)
272
  with open(f"tmp2-{uid}.json", "w") as outfile2:
273
  outfile2.write(json_object)