Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
267 |
-
|
|
|
|
|
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)
|