Spaces:
Runtime error
Runtime error
samarthagarwal23
commited on
Commit
·
ac84a4a
1
Parent(s):
15ecd97
Update app.py
Browse files
app.py
CHANGED
@@ -29,18 +29,16 @@ def user_query_recommend(query, min_p, max_p):
|
|
29 |
recommendations = recommendations.sort_values('sim', ascending=False)
|
30 |
recommendations = recommendations.loc[(recommendations.price >= min_p) &
|
31 |
(recommendations.price <= max_p),
|
32 |
-
['name', '
|
33 |
|
34 |
-
return recommendations
|
35 |
|
36 |
interface = gr.Interface(
|
37 |
user_query_recommend,
|
38 |
inputs=[gr.inputs.Textbox(),
|
39 |
gr.inputs.Slider(minimum=1, maximum=100, default=30, label='Min Price'),
|
40 |
gr.inputs.Slider(minimum=1, maximum=1000, default=70, label='Max Price')],
|
41 |
-
outputs=
|
42 |
-
gr.outputs.Textbox(label="Recommendations"),
|
43 |
-
],
|
44 |
title = "Scotch Recommendation",
|
45 |
examples=[["very sweet with lemons and oranges and marmalades", 20,50],
|
46 |
["smoky peaty earthy and spicy",50,100]],
|
|
|
29 |
recommendations = recommendations.sort_values('sim', ascending=False)
|
30 |
recommendations = recommendations.loc[(recommendations.price >= min_p) &
|
31 |
(recommendations.price <= max_p),
|
32 |
+
['name', 'price', 'description']].head(3)
|
33 |
|
34 |
+
return recommendations.reset_index(drop=True)
|
35 |
|
36 |
interface = gr.Interface(
|
37 |
user_query_recommend,
|
38 |
inputs=[gr.inputs.Textbox(),
|
39 |
gr.inputs.Slider(minimum=1, maximum=100, default=30, label='Min Price'),
|
40 |
gr.inputs.Slider(minimum=1, maximum=1000, default=70, label='Max Price')],
|
41 |
+
outputs="dataframe",
|
|
|
|
|
42 |
title = "Scotch Recommendation",
|
43 |
examples=[["very sweet with lemons and oranges and marmalades", 20,50],
|
44 |
["smoky peaty earthy and spicy",50,100]],
|