Spaces:
Sleeping
Sleeping
Update ui/suggestions_tab.py
Browse files- ui/suggestions_tab.py +21 -15
ui/suggestions_tab.py
CHANGED
@@ -1,15 +1,21 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from
|
3 |
-
|
4 |
-
def create_suggestions_tab():
|
5 |
-
with gr.TabItem("π Smart Suggestions"):
|
6 |
-
gr.Markdown("### π€ Ask RetailGenie for Recommendations")
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from smart_suggestion.flan_suggestor import generate_product_description # Updated import
|
3 |
+
|
4 |
+
def create_suggestions_tab():
|
5 |
+
with gr.TabItem("π Smart Suggestions"):
|
6 |
+
gr.Markdown("### π€ Ask RetailGenie for Recommendations")
|
7 |
+
|
8 |
+
suggestion_input = gr.Textbox(
|
9 |
+
label="Ask something like:",
|
10 |
+
placeholder="e.g. Shampoo under 500 for dry hair",
|
11 |
+
lines=1
|
12 |
+
)
|
13 |
+
|
14 |
+
suggest_btn = gr.Button("π‘ Get Suggestions")
|
15 |
+
suggestions_output = gr.Textbox(label="π Suggestions", lines=10)
|
16 |
+
|
17 |
+
suggest_btn.click(
|
18 |
+
generate_product_description, # Updated function
|
19 |
+
inputs=suggestion_input,
|
20 |
+
outputs=suggestions_output
|
21 |
+
)
|