Spaces:
Sleeping
Sleeping
williamagyapong
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -125,8 +125,8 @@ def process_user_msg(message, mobile):
|
|
125 |
image_path = os.path.join(response2)
|
126 |
print("My image path:", image_path)
|
127 |
with open(image_path, "rb") as file:
|
128 |
-
|
129 |
-
|
130 |
|
131 |
# Upload image to Imgur and get URL
|
132 |
response2 = requests.post(url, headers=headers, data={"image": base64_data})
|
|
|
125 |
image_path = os.path.join(response2)
|
126 |
print("My image path:", image_path)
|
127 |
with open(image_path, "rb") as file:
|
128 |
+
data = file.read()
|
129 |
+
base64_data = base64.b64encode(data)
|
130 |
|
131 |
# Upload image to Imgur and get URL
|
132 |
response2 = requests.post(url, headers=headers, data={"image": base64_data})
|