Spaces:
Sleeping
Sleeping
Update ui/suggestions_tab.py
Browse files- ui/suggestions_tab.py +24 -5
ui/suggestions_tab.py
CHANGED
@@ -6,8 +6,7 @@ def create_suggestions_tab():
|
|
6 |
# π· Header
|
7 |
gr.Markdown(
|
8 |
"""
|
9 |
-
## π€ Ask RetailGenie for Recommendations
|
10 |
-
|
11 |
π§ Just type your need β e.g., _"shampoo for dry hair under 500"_, _"gift sets"_, or _"budget skin care"_
|
12 |
and let Genie do the rest!
|
13 |
""",
|
@@ -21,13 +20,11 @@ def create_suggestions_tab():
|
|
21 |
lines=1
|
22 |
)
|
23 |
|
24 |
-
# π Add vertical spacing
|
25 |
gr.Markdown("<div style='margin-top: 8px;'></div>")
|
26 |
|
27 |
# π¦ Button
|
28 |
suggest_btn = gr.Button("π Get Suggestions")
|
29 |
|
30 |
-
# π Add vertical spacing
|
31 |
gr.Markdown("<div style='margin-top: 12px;'></div>")
|
32 |
|
33 |
# π¨ Output Section
|
@@ -41,7 +38,29 @@ def create_suggestions_tab():
|
|
41 |
|
42 |
# π§ Connect logic to FLAN model
|
43 |
suggest_btn.click(
|
44 |
-
generate_product_description,
|
45 |
inputs=suggestion_input,
|
46 |
outputs=suggestions_output
|
47 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
# π· Header
|
7 |
gr.Markdown(
|
8 |
"""
|
9 |
+
## π€ Ask RetailGenie for Recommendations
|
|
|
10 |
π§ Just type your need β e.g., _"shampoo for dry hair under 500"_, _"gift sets"_, or _"budget skin care"_
|
11 |
and let Genie do the rest!
|
12 |
""",
|
|
|
20 |
lines=1
|
21 |
)
|
22 |
|
|
|
23 |
gr.Markdown("<div style='margin-top: 8px;'></div>")
|
24 |
|
25 |
# π¦ Button
|
26 |
suggest_btn = gr.Button("π Get Suggestions")
|
27 |
|
|
|
28 |
gr.Markdown("<div style='margin-top: 12px;'></div>")
|
29 |
|
30 |
# π¨ Output Section
|
|
|
38 |
|
39 |
# π§ Connect logic to FLAN model
|
40 |
suggest_btn.click(
|
41 |
+
fn=generate_product_description,
|
42 |
inputs=suggestion_input,
|
43 |
outputs=suggestions_output
|
44 |
)
|
45 |
+
|
46 |
+
# π
CSS for centered text and consistent spacing
|
47 |
+
gr.Markdown(
|
48 |
+
"""
|
49 |
+
<style>
|
50 |
+
.centered-text {
|
51 |
+
text-align: center;
|
52 |
+
font-size: 16px;
|
53 |
+
font-weight: 500;
|
54 |
+
}
|
55 |
+
#suggestion-box textarea {
|
56 |
+
font-family: 'Courier New', monospace;
|
57 |
+
font-size: 14px;
|
58 |
+
background-color: #111827;
|
59 |
+
color: #e5e7eb;
|
60 |
+
border-radius: 10px;
|
61 |
+
padding: 10px;
|
62 |
+
white-space: pre-line; /* important for preserving line breaks */
|
63 |
+
}
|
64 |
+
</style>
|
65 |
+
"""
|
66 |
+
)
|