Commit
·
2bdeb9c
1
Parent(s):
f74dde6
updated
Browse files
app.py
CHANGED
@@ -127,14 +127,11 @@ if st.button("Submit"):
|
|
127 |
f.write(image_bytes)
|
128 |
image_urls.append(f"data:image/jpeg;base64,{page.base64}")
|
129 |
|
130 |
-
# Display the first image initially
|
131 |
-
st.image(filename, caption="Reference Image", use_column_width=True)
|
132 |
-
|
133 |
# Get model response
|
134 |
response = client.chat.completions.create(
|
135 |
model=selected_model,
|
136 |
messages=[
|
137 |
-
{"role": "system", "content": "You are a helpful assistant. You only answer the question based on the provided
|
138 |
{
|
139 |
"role": "user",
|
140 |
"content": [
|
@@ -158,4 +155,4 @@ if st.button("Submit"):
|
|
158 |
except Exception as e:
|
159 |
st.error(f"An error occurred: {e}")
|
160 |
else:
|
161 |
-
st.warning("Please enter a query.")
|
|
|
127 |
f.write(image_bytes)
|
128 |
image_urls.append(f"data:image/jpeg;base64,{page.base64}")
|
129 |
|
|
|
|
|
|
|
130 |
# Get model response
|
131 |
response = client.chat.completions.create(
|
132 |
model=selected_model,
|
133 |
messages=[
|
134 |
+
{"role": "system", "content": "You are a helpful assistant. You only answer the question based on the provided images."},
|
135 |
{
|
136 |
"role": "user",
|
137 |
"content": [
|
|
|
155 |
except Exception as e:
|
156 |
st.error(f"An error occurred: {e}")
|
157 |
else:
|
158 |
+
st.warning("Please enter a query.")
|