Spaces:
Build error

TalalMosaik commited on
Commit
ecb8ca2
·
verified ·
1 Parent(s): 89017af

add both image and text

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -10,6 +10,7 @@ import requests
10
 
11
  IMAGE_PROMPT = """
12
  You are an expert in identifying features from images. The user will ask a query and you have to answer whether that feature exists in images or not.
 
13
 
14
  Response should be Yes or No
15
  """
@@ -91,19 +92,24 @@ if input_type == "Text":
91
  else:
92
  # Text input for query
93
  query = st.text_input("Enter your query:")
 
94
 
95
  # File uploader for multiple files
96
  uploaded_files = st.file_uploader("Choose images...", type=["jpg", "jpeg", "png"], accept_multiple_files=True)
97
 
98
  # Submit button
99
  if st.button("Submit"):
100
- if input_type == "Image" and uploaded_files and query:
101
  cols = st.columns(3)
102
  content = []
103
  content.append({
104
  "type": "text",
105
  "text": query
106
  })
 
 
 
 
107
  limit = 10
108
 
109
  for idx, uploaded_file in enumerate(uploaded_files):
 
10
 
11
  IMAGE_PROMPT = """
12
  You are an expert in identifying features from images. The user will ask a query and you have to answer whether that feature exists in images or not.
13
+ Also User provide you description about property from which you can also answer user questions.
14
 
15
  Response should be Yes or No
16
  """
 
92
  else:
93
  # Text input for query
94
  query = st.text_input("Enter your query:")
95
+ property_listing = st.text_input("Enter your Property Listing")
96
 
97
  # File uploader for multiple files
98
  uploaded_files = st.file_uploader("Choose images...", type=["jpg", "jpeg", "png"], accept_multiple_files=True)
99
 
100
  # Submit button
101
  if st.button("Submit"):
102
+ if input_type == "Image" or uploaded_files and query:
103
  cols = st.columns(3)
104
  content = []
105
  content.append({
106
  "type": "text",
107
  "text": query
108
  })
109
+ content.append({
110
+ "type":"text",
111
+ "text":f"Context of Property Listing: {property_listing}"
112
+ })
113
  limit = 10
114
 
115
  for idx, uploaded_file in enumerate(uploaded_files):