Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -477,13 +477,29 @@ def summarize(inp,history,data=None,files=None,directory=None,url=None,pdf_url=N
|
|
477 |
except Exception as e:
|
478 |
print (e)
|
479 |
chart_out = get_chart(str(json_out))
|
480 |
-
|
481 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
else:
|
483 |
rawp = "Provide a valid data source"
|
484 |
history.clear()
|
485 |
history.append((inp,chart_out))
|
486 |
-
yield "", history,chart_html,
|
487 |
|
488 |
#################################
|
489 |
def clear_fn():
|
|
|
477 |
except Exception as e:
|
478 |
print (e)
|
479 |
chart_out = get_chart(str(json_out))
|
480 |
+
chart_list=chart_out.split("\n")
|
481 |
+
go=True
|
482 |
+
cnti=1
|
483 |
+
line_out=""
|
484 |
+
for ii, line in enumerate(chart_list):
|
485 |
+
if go:
|
486 |
+
line=line.strip()
|
487 |
+
if "```" in chart_list[ii]:
|
488 |
+
while True:
|
489 |
+
line_out+=line[ii+cnti]
|
490 |
+
cnti+=1
|
491 |
+
if "```" in line[ii+cnti]:
|
492 |
+
go=False
|
493 |
+
break
|
494 |
+
|
495 |
+
|
496 |
+
chart_html=mm(line_out)
|
497 |
+
#print(chart_out)
|
498 |
else:
|
499 |
rawp = "Provide a valid data source"
|
500 |
history.clear()
|
501 |
history.append((inp,chart_out))
|
502 |
+
yield "", history,chart_html,line_out,json_out
|
503 |
|
504 |
#################################
|
505 |
def clear_fn():
|