Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ db_uri = os.getenv("POSTGRESQL_CONNECTION")
|
|
70 |
# Database setup
|
71 |
|
72 |
db = SQLDatabase.from_uri(db_uri)
|
73 |
-
user_email = "
|
74 |
warehouse_name = ""
|
75 |
warehouse_id = ""
|
76 |
inventory_date = datetime.today().strftime('%Y-%m-%d')
|
@@ -527,12 +527,12 @@ def answer_question(user_question, chatbot, audio=None):
|
|
527 |
if os.getenv("IMAGE_PATH") in response_text:
|
528 |
# Open the image file
|
529 |
img = Image.open(os.getenv("IMAGE_PATH"))
|
530 |
-
|
531 |
# Convert the PIL Image to a base64 encoded string
|
532 |
buffered = BytesIO()
|
533 |
img.save(buffered, format="PNG")
|
534 |
img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
535 |
-
|
536 |
img = f'<img src="data:image/png;base64,{img_str}" style="width:500px; height:400px;">'
|
537 |
# image = gr.Image(value=img_str)
|
538 |
chatbot.append((user_question, img))
|
|
|
70 |
# Database setup
|
71 |
|
72 |
db = SQLDatabase.from_uri(db_uri)
|
73 |
+
user_email = ""
|
74 |
warehouse_name = ""
|
75 |
warehouse_id = ""
|
76 |
inventory_date = datetime.today().strftime('%Y-%m-%d')
|
|
|
527 |
if os.getenv("IMAGE_PATH") in response_text:
|
528 |
# Open the image file
|
529 |
img = Image.open(os.getenv("IMAGE_PATH"))
|
530 |
+
print(img)
|
531 |
# Convert the PIL Image to a base64 encoded string
|
532 |
buffered = BytesIO()
|
533 |
img.save(buffered, format="PNG")
|
534 |
img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
535 |
+
print(img_str)
|
536 |
img = f'<img src="data:image/png;base64,{img_str}" style="width:500px; height:400px;">'
|
537 |
# image = gr.Image(value=img_str)
|
538 |
chatbot.append((user_question, img))
|