Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -100,7 +100,7 @@ def qa_infer_interface(property_choice, query_question):
|
|
100 |
qa_infer = QAInfer()
|
101 |
if not property_choice and user_choices:
|
102 |
property_choice = user_choices[0]
|
103 |
-
print("property_choice",property_choice
|
104 |
print("row",[row for row in data])
|
105 |
property_row = [row for row in data if row[1] == property_choice][0] # Find the row corresponding to the selected property
|
106 |
if not query_question:
|
@@ -142,12 +142,10 @@ with gr.Blocks(title="House Excel Query") as demo:
|
|
142 |
inputs=properties_text,
|
143 |
# "textbox",
|
144 |
outputs=interface_1_output,
|
145 |
-
# live=True,
|
146 |
-
# cache_examples=["Give me all details of properties from India"],
|
147 |
cache_examples=False,
|
148 |
examples=["Properties in France "," Properties greater than a acre","Properties with more than 400 bedrooms"],
|
149 |
)
|
150 |
-
|
151 |
|
152 |
|
153 |
interface_2 = gr.Interface(
|
@@ -156,10 +154,6 @@ with gr.Blocks(title="House Excel Query") as demo:
|
|
156 |
# inputs=[gr.Dropdown.change(fn=update_choices),gr.components.Textbox(lines=2,label="Question on property",placeholder="Enter a question to know more about the properties")],
|
157 |
outputs=stage2_output,
|
158 |
cache_examples=False,
|
159 |
-
# examples=stage2_examples,
|
160 |
-
# live=True,
|
161 |
-
# gr.Button("Next"),
|
162 |
-
# Button.click(next,value="Next"),
|
163 |
|
164 |
)
|
165 |
|
@@ -170,20 +164,6 @@ with gr.Blocks(title="House Excel Query") as demo:
|
|
170 |
interface_1_output.change(update_choices,inputs=[interface_1_output],outputs=[user_dropdown])
|
171 |
|
172 |
|
173 |
-
# user_dropdown.change(update_examples, inputs=[user_dropdown], outputs=[stage2_examples])
|
174 |
-
|
175 |
-
# properties_text.change(update_choices,inputs=[stage2_examples],outputs=[interface_2.examples])
|
176 |
-
# interface_1_output.change(update_choices,inputs=[stage2_examples],outputs=[interface_2.examples])
|
177 |
-
|
178 |
-
# user_dropdown.change(update_choices, inputs=[user_dropdown], outputs=[user_dropdown, interface_2])
|
179 |
-
|
180 |
-
# user_dropdown.change(fn=update_choices,inputs=[user_dropdown],outputs=[user_dropdown])
|
181 |
-
|
182 |
-
# with gr.Row():
|
183 |
-
# save_btn = gr.Button("Next")
|
184 |
-
|
185 |
-
# Button.click(next,value="Next",),
|
186 |
-
|
187 |
if __name__ == "__main__":
|
188 |
demo.launch(share=True)
|
189 |
|
|
|
100 |
qa_infer = QAInfer()
|
101 |
if not property_choice and user_choices:
|
102 |
property_choice = user_choices[0]
|
103 |
+
print("property_choice",property_choice)
|
104 |
print("row",[row for row in data])
|
105 |
property_row = [row for row in data if row[1] == property_choice][0] # Find the row corresponding to the selected property
|
106 |
if not query_question:
|
|
|
142 |
inputs=properties_text,
|
143 |
# "textbox",
|
144 |
outputs=interface_1_output,
|
|
|
|
|
145 |
cache_examples=False,
|
146 |
examples=["Properties in France "," Properties greater than a acre","Properties with more than 400 bedrooms"],
|
147 |
)
|
148 |
+
|
149 |
|
150 |
|
151 |
interface_2 = gr.Interface(
|
|
|
154 |
# inputs=[gr.Dropdown.change(fn=update_choices),gr.components.Textbox(lines=2,label="Question on property",placeholder="Enter a question to know more about the properties")],
|
155 |
outputs=stage2_output,
|
156 |
cache_examples=False,
|
|
|
|
|
|
|
|
|
157 |
|
158 |
)
|
159 |
|
|
|
164 |
interface_1_output.change(update_choices,inputs=[interface_1_output],outputs=[user_dropdown])
|
165 |
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
if __name__ == "__main__":
|
168 |
demo.launch(share=True)
|
169 |
|