Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -290,11 +290,12 @@ def compress_data_og(c, instruct, history):
|
|
290 |
|
291 |
|
292 |
def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=None):
|
|
|
293 |
if inp == "":
|
294 |
inp = "Process this data"
|
295 |
history.clear()
|
296 |
history = [(inp,"Working on it...")]
|
297 |
-
yield "",history,error_box
|
298 |
|
299 |
if pdf_batch.startswith("http"):
|
300 |
c=0
|
@@ -352,7 +353,8 @@ def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=N
|
|
352 |
c +=1
|
353 |
print (f'c:: {c}')
|
354 |
|
355 |
-
json_out = compress_data(c,inp,out)
|
|
|
356 |
out = str(json_out)
|
357 |
rl = len(out)
|
358 |
print(f'rl:: {rl}')
|
@@ -370,7 +372,7 @@ def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=N
|
|
370 |
#task = "complete?"
|
371 |
history.clear()
|
372 |
history.append((inp,rawp))
|
373 |
-
yield "", history,error_box,
|
374 |
|
375 |
#################################
|
376 |
def clear_fn():
|
|
|
290 |
|
291 |
|
292 |
def summarize(inp,history,data=None,files=None,url=None,pdf_url=None,pdf_batch=None):
|
293 |
+
json_box=[]
|
294 |
if inp == "":
|
295 |
inp = "Process this data"
|
296 |
history.clear()
|
297 |
history = [(inp,"Working on it...")]
|
298 |
+
yield "",history,error_box,json_box
|
299 |
|
300 |
if pdf_batch.startswith("http"):
|
301 |
c=0
|
|
|
353 |
c +=1
|
354 |
print (f'c:: {c}')
|
355 |
|
356 |
+
json_out = compress_data(c,inp,out)
|
357 |
+
json_box.append(json_out)
|
358 |
out = str(json_out)
|
359 |
rl = len(out)
|
360 |
print(f'rl:: {rl}')
|
|
|
372 |
#task = "complete?"
|
373 |
history.clear()
|
374 |
history.append((inp,rawp))
|
375 |
+
yield "", history,error_box,json_box
|
376 |
|
377 |
#################################
|
378 |
def clear_fn():
|