Spaces:
Runtime error
Runtime error
samarthagarwal23
commited on
Commit
·
cf44989
1
Parent(s):
ac84a4a
Update app.py
Browse files
app.py
CHANGED
@@ -29,20 +29,23 @@ 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', 'price', 'description']].head(
|
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="
|
42 |
title = "Scotch Recommendation",
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
46 |
)
|
47 |
|
48 |
interface.launch(
|
|
|
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(10)
|
33 |
|
34 |
return recommendations.reset_index(drop=True)
|
35 |
|
36 |
interface = gr.Interface(
|
37 |
user_query_recommend,
|
38 |
+
inputs=[gr.inputs.Textbox(lines=5),
|
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=gr.outputs.Dataframe(max_rows=3, overflow_row_behaviour="paginate", type="pandas", label="Recommendations"),
|
42 |
title = "Scotch Recommendation",
|
43 |
+
description = "Looking for scotch recommendations and have some flavours in mind? Get recommendations using semantic search through distilRoberta embeddings at a preferred price range :) ",
|
44 |
+
examples=[["very sweet with lemons and oranges and marmalades", 10,40],
|
45 |
+
["smoky peaty earthy and spicy",50,100],
|
46 |
+
["salty and spicy with exotic fruits", 50,500],
|
47 |
+
],
|
48 |
+
theme="grass",
|
49 |
)
|
50 |
|
51 |
interface.launch(
|