Arafath10 commited on
Commit
d45bf32
1 Parent(s): e5e2728

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -0
main.py CHANGED
@@ -67,6 +67,7 @@ async def get_image_for_text(email,query,file: UploadFile = File(...)):
67
  code_to_exec = "import matplotlib.pyplot as plt\nimport seaborn as sns\n"
68
  code_to_exec = code_to_exec + sdf.last_code_generated.replace("dfs[0]","dfs")
69
  code_to_exec = code_to_exec.replace("exports/charts/temp_chart.png",email+file_name+".png")
 
70
 
71
  print(code_to_exec)
72
  local_vars = {'dfs': df}
 
67
  code_to_exec = "import matplotlib.pyplot as plt\nimport seaborn as sns\n"
68
  code_to_exec = code_to_exec + sdf.last_code_generated.replace("dfs[0]","dfs")
69
  code_to_exec = code_to_exec.replace("exports/charts/temp_chart.png",email+file_name+".png")
70
+ code_to_exec = code_to_exec+f"\nplt.savefig('{email+file_name}.png')"
71
 
72
  print(code_to_exec)
73
  local_vars = {'dfs': df}