blank image issue on multiple req
Browse files- controller.py +0 -6
controller.py
CHANGED
|
@@ -629,9 +629,6 @@ def groq_chart(csv_url: str, question: str):
|
|
| 629 |
"""
|
| 630 |
answer = df.chat(question + instructions)
|
| 631 |
|
| 632 |
-
# Make sure to close figures so they don't conflict between processes
|
| 633 |
-
plt.close('all')
|
| 634 |
-
|
| 635 |
# If process_answer indicates a problem, return a failure message.
|
| 636 |
if process_answer(answer):
|
| 637 |
return "Chart not generated"
|
|
@@ -694,9 +691,6 @@ def langchain_csv_chart(csv_url: str, question: str, chart_required: bool):
|
|
| 694 |
result = agent.invoke({"input": _prompt_generator(question, True)})
|
| 695 |
output = result.get("output", "")
|
| 696 |
|
| 697 |
-
# Close figures to avoid interference
|
| 698 |
-
plt.close('all')
|
| 699 |
-
|
| 700 |
# Extract chart filenames (assuming extract_chart_filenames returns a list)
|
| 701 |
chart_files = extract_chart_filenames(output)
|
| 702 |
if len(chart_files) > 0:
|
|
|
|
| 629 |
"""
|
| 630 |
answer = df.chat(question + instructions)
|
| 631 |
|
|
|
|
|
|
|
|
|
|
| 632 |
# If process_answer indicates a problem, return a failure message.
|
| 633 |
if process_answer(answer):
|
| 634 |
return "Chart not generated"
|
|
|
|
| 691 |
result = agent.invoke({"input": _prompt_generator(question, True)})
|
| 692 |
output = result.get("output", "")
|
| 693 |
|
|
|
|
|
|
|
|
|
|
| 694 |
# Extract chart filenames (assuming extract_chart_filenames returns a list)
|
| 695 |
chart_files = extract_chart_filenames(output)
|
| 696 |
if len(chart_files) > 0:
|