Update main.py
Browse files
main.py
CHANGED
@@ -37,6 +37,12 @@ def convert_image_to_base64(image_path):
|
|
37 |
img_base64_string = img_base64.decode("utf-8")
|
38 |
return img_base64_string
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
@app.post("/get_image_for_text")
|
41 |
async def get_image_for_text(email,query,file: UploadFile = File(...)):
|
42 |
print(file.filename)
|
|
|
37 |
img_base64_string = img_base64.decode("utf-8")
|
38 |
return img_base64_string
|
39 |
|
40 |
+
df = pd.read_csv("233.csv")
|
41 |
+
sdf = SmartDataframe(df, config={"llm": llm})
|
42 |
+
sdf.chat(query)
|
43 |
+
image_path = "exports/charts/temp_chart.png" # Replace with your image's path
|
44 |
+
base64str = convert_image_to_base64(image_path)
|
45 |
+
|
46 |
@app.post("/get_image_for_text")
|
47 |
async def get_image_for_text(email,query,file: UploadFile = File(...)):
|
48 |
print(file.filename)
|