Spaces:
Build error
Build error
Update app.py
Browse files69 unmodified lines70717273747576450 unmodified lines52752852953053153253353453553653753869 unmodified lines# Database setupdb = SQLDatabase.from_uri(db_uri)user_email = "lakshmivairamani@gmail.com"warehouse_name = ""warehouse_id = ""inventory_date = datetime.today().strftime('%Y-%m-%d')450 unmodified linesif os.getenv("IMAGE_PATH") in response_text:# Open the image fileimg = Image.open(os.getenv("IMAGE_PATH"))# Convert the PIL Image to a base64 encoded stringbuffered = BytesIO()img.save(buffered, format="PNG")img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")# print(img_str)img = f'<img src="data:image/png;base64,{img_str}" style="width:500px; height:400px;">'# image = gr.Image(value=img_str)chatbot.append((user_question, img))69 unmodified lines70717273747576450 unmodified lines52752852953053153253353453553653753869 unmodified lines# Database setupdb = SQLDatabase.from_uri(db_uri)user_email = ""warehouse_name = ""warehouse_id = ""inventory_date = datetime.today().strftime('%Y-%m-%d')450 unmodified linesif os.getenv("IMAGE_PATH") in response_text:# Open the image fileimg = Image.open(os.getenv("IMAGE_PATH"))print(img)# Convert the PIL Image to a base64 encoded stringbuffered = BytesIO()img.save(buffered, format="PNG")img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")print(img_str)img = f'<img src="data:image/png;base64,{img_str}" style="width:500px; height:400px;">'# image = gr.Image(value=img_str)chatbot.append((user_question, img))
app.py+3-3