Spaces:
Runtime error
Runtime error
Commit
·
d351071
1
Parent(s):
8239be3
Update app.py
Browse files
app.py
CHANGED
@@ -81,14 +81,15 @@ st.title("Image Description Generator")
|
|
81 |
# Change the file_uploader to accept multiple files
|
82 |
uploaded_files = st.file_uploader("Upload one or more images here", type=["png", "jpg", "jpeg"], accept_multiple_files=True)
|
83 |
|
|
|
|
|
|
|
84 |
# Loop through the uploaded files and display them
|
85 |
for uploaded_file in uploaded_files:
|
86 |
# Display the image
|
87 |
st.image(uploaded_file)
|
88 |
|
89 |
-
#
|
90 |
-
image_question = st.text_input(f"Ask something about {uploaded_file.name}:")
|
91 |
-
|
92 |
if image_question:
|
93 |
image_parts = [
|
94 |
{
|
@@ -109,4 +110,4 @@ for uploaded_file in uploaded_files:
|
|
109 |
)
|
110 |
|
111 |
response = model.generate_content(prompt_parts)
|
112 |
-
st.markdown(f"**Model's answer:** {response.text}")
|
|
|
81 |
# Change the file_uploader to accept multiple files
|
82 |
uploaded_files = st.file_uploader("Upload one or more images here", type=["png", "jpg", "jpeg"], accept_multiple_files=True)
|
83 |
|
84 |
+
# Text input for asking questions about the images
|
85 |
+
image_question = st.text_input("Ask something about the images:")
|
86 |
+
|
87 |
# Loop through the uploaded files and display them
|
88 |
for uploaded_file in uploaded_files:
|
89 |
# Display the image
|
90 |
st.image(uploaded_file)
|
91 |
|
92 |
+
# Check if the user has entered a question
|
|
|
|
|
93 |
if image_question:
|
94 |
image_parts = [
|
95 |
{
|
|
|
110 |
)
|
111 |
|
112 |
response = model.generate_content(prompt_parts)
|
113 |
+
st.markdown(f"**Model's answer for {uploaded_file.name}:** {response.text}")
|