Omnibus commited on
Commit
ea9521e
1 Parent(s): 1dc8e74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -14
app.py CHANGED
@@ -648,19 +648,22 @@ def save_memory(purpose, history):
648
  print(f'trying:: {line}')
649
  keyw=line.split(":")[1]
650
  print (keyw)
651
- print (keyw.split("[")[1].split("]")[0])
652
- keyw=keyw.split("[")[1].split("]")[0]
653
- for ea in keyw.split(","):
654
- s1=""
655
- ea=ea.strip().strip("\n")
656
- for ev in ea:
657
- if ev.isalnum():
658
- s1+=ev
659
- if ev == " ":
660
- s1+=ev
661
- #ea=s1
662
- print(s1)
663
- key_box.append(s1)
 
 
 
664
  if "description" in line and ":" in line:
665
  #print(f'trying:: {line}')
666
  desc=line.split(":")[1]
@@ -723,7 +726,7 @@ def recall_memory(inp,history):
723
  mem_keys = mem[0].keys()
724
  rawp = get_mem(inp,mem_keys)
725
  valid_list(rawp)
726
- valid_list(["123","333"])
727
 
728
  history.clear()
729
  history.append((inp,rawp))
 
648
  print(f'trying:: {line}')
649
  keyw=line.split(":")[1]
650
  print (keyw)
651
+ try:
652
+ print (keyw.split("[")[1].split("]")[0])
653
+ keyw=keyw.split("[")[1].split("]")[0]
654
+ for ea in keyw.split(","):
655
+ s1=""
656
+ ea=ea.strip().strip("\n")
657
+ for ev in ea:
658
+ if ev.isalnum():
659
+ s1+=ev
660
+ if ev == " ":
661
+ s1+=ev
662
+ #ea=s1
663
+ print(s1)
664
+ key_box.append(s1)
665
+ except Exception as e:
666
+ print(f'ERROR SAVING KEYWORD:: {e}')
667
  if "description" in line and ":" in line:
668
  #print(f'trying:: {line}')
669
  desc=line.split(":")[1]
 
726
  mem_keys = mem[0].keys()
727
  rawp = get_mem(inp,mem_keys)
728
  valid_list(rawp)
729
+ #valid_list(["123","333"])
730
 
731
  history.clear()
732
  history.append((inp,rawp))