Spaces:
Sleeping
Sleeping
Pavithiran
commited on
Commit
•
6759c36
1
Parent(s):
2c884a8
Update app.py
Browse files
app.py
CHANGED
@@ -90,10 +90,16 @@ def respond(message: str, image: Image):
|
|
90 |
|
91 |
# Convert the response data (image) into a PIL Image
|
92 |
image_response = Image.open(io.BytesIO(response_data))
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
-
return
|
95 |
except Exception as e:
|
96 |
-
return str(e)
|
97 |
|
98 |
# Define the Gradio interface
|
99 |
def create_interface():
|
|
|
90 |
|
91 |
# Convert the response data (image) into a PIL Image
|
92 |
image_response = Image.open(io.BytesIO(response_data))
|
93 |
+
|
94 |
+
# Format the response in the required 'messages' format
|
95 |
+
response_message = {
|
96 |
+
'role': 'assistant', # Assuming the response is from the assistant
|
97 |
+
'content': image_response
|
98 |
+
}
|
99 |
|
100 |
+
return response_message
|
101 |
except Exception as e:
|
102 |
+
return {"role": "assistant", "content": str(e)}
|
103 |
|
104 |
# Define the Gradio interface
|
105 |
def create_interface():
|