Update app.py
Browse files
app.py
CHANGED
@@ -32,13 +32,35 @@ def generate_product_description(image, description_type, custom_instruction=Non
|
|
32 |
|
33 |
# Set the description type or custom instruction
|
34 |
description_prompts = {
|
35 |
-
"Short Formal": "
|
36 |
-
"Bullet Points": "
|
37 |
-
"Amazon Optimized": "
|
38 |
-
"Fashion": "Generate a stylish and trendy product description
|
39 |
-
"Sport": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
|
|
42 |
if description_type == "Other" and custom_instruction:
|
43 |
instruction = custom_instruction
|
44 |
else:
|
@@ -96,14 +118,35 @@ with gr.Blocks(css=css) as demo:
|
|
96 |
description_type = gr.Dropdown(
|
97 |
label="Select Description Type",
|
98 |
choices=[
|
99 |
-
"Short Formal",
|
100 |
-
"Bullet Points",
|
101 |
-
"Amazon Optimized",
|
102 |
-
"Fashion",
|
103 |
-
"Sport",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
"Other",
|
105 |
],
|
106 |
-
value="Short Formal",
|
107 |
)
|
108 |
custom_instruction = gr.Textbox(
|
109 |
label="Custom Instruction (Only for 'Other')", visible=False
|
|
|
32 |
|
33 |
# Set the description type or custom instruction
|
34 |
description_prompts = {
|
35 |
+
"Short Formal π": "Based on the image, craft a concise and compelling product description that highlights key features and benefits in a formal tone.",
|
36 |
+
"Bullet Points π": "From the image, provide a detailed list of bullet points describing the product's features, benefits, and unique selling points.",
|
37 |
+
"Amazon Optimized π": "Create an Amazon-style product description based on the image, including key features, benefits, relevant keywords for SEO, and a persuasive call to action.",
|
38 |
+
"Fashion π": "Generate a stylish and trendy product description for a fashion item shown in the image, emphasizing its design, materials, and how it fits into current fashion trends.",
|
39 |
+
"Sport π": "Using the image, develop an energetic and engaging product description for a sports-related item, highlighting its performance features and benefits for athletic activities.",
|
40 |
+
"Technical Specifications βοΈ": "Extract and present the product's technical specifications from the image in a clear and concise manner, suitable for tech-savvy customers.",
|
41 |
+
"SEO Optimized π": "Write an SEO-friendly product description based on the image, incorporating relevant keywords and phrases to enhance search engine visibility.",
|
42 |
+
"Social Media Style π±": "Create a catchy and engaging product description suitable for social media platforms, using the image as inspiration.",
|
43 |
+
"Luxury π": "Craft an elegant and sophisticated product description for the luxury item shown in the image, emphasizing exclusivity, premium quality, and craftsmanship.",
|
44 |
+
"Kid-Friendly π§Έ": "Generate a fun and appealing product description for a children's product based on the image, using language that resonates with both kids and parents.",
|
45 |
+
"Health and Beauty π": "Develop a compelling product description for a health or beauty item shown in the image, highlighting its benefits, ingredients, and usage tips.",
|
46 |
+
"Electronic Gadgets π±": "Write a tech-focused product description for the electronic gadget in the image, focusing on its innovative features, specifications, and user advantages.",
|
47 |
+
"Eco-Friendly π±": "Create an eco-conscious product description for the environmentally friendly product shown in the image, emphasizing sustainability and green benefits.",
|
48 |
+
"Personalized Gifts π": "Generate a heartfelt product description for the personalized gift in the image, highlighting customization options and sentimental value.",
|
49 |
+
"Seasonal Promotion π": "Craft a seasonal promotional product description based on the image, incorporating festive themes and limited-time offers to encourage immediate purchase.",
|
50 |
+
"Clearance Sale π·οΈ": "Write an urgent and enticing product description for the item in the image, emphasizing discounted prices and limited stock availability.",
|
51 |
+
"Cross-Selling π": "Develop a product description that not only highlights the item in the image but also suggests complementary products, encouraging additional purchases.",
|
52 |
+
"Up-Selling β¬οΈ": "Create a persuasive product description that highlights premium features of the item in the image, encouraging customers to consider higher-end versions.",
|
53 |
+
"Multi-Language Support π": "Provide a product description based on the image in multiple languages to cater to a diverse customer base.",
|
54 |
+
"User Testimonials β": "Incorporate fictional user testimonials or reviews into the product description based on the image, adding credibility and social proof.",
|
55 |
+
"Instructional π": "Write a product description that includes usage instructions or assembly steps for the item shown in the image.",
|
56 |
+
"Bundle Offer π¦": "Craft a product description that promotes the item in the image as part of a bundle deal, highlighting the added value.",
|
57 |
+
"Gift Guide Entry π": "Generate a product description suitable for inclusion in a gift guide, emphasizing why the item in the image makes a great gift.",
|
58 |
+
"Limited Edition π": "Create an exclusive product description for the limited-edition item shown in the image, highlighting its uniqueness and scarcity.",
|
59 |
+
"Subscription Model π": "Write a product description that promotes the item in the image as part of a subscription service, detailing recurring benefits.",
|
60 |
+
"B2B Focused π’": "Develop a professional product description suitable for business-to-business contexts, emphasizing features relevant to corporate clients.",
|
61 |
}
|
62 |
|
63 |
+
|
64 |
if description_type == "Other" and custom_instruction:
|
65 |
instruction = custom_instruction
|
66 |
else:
|
|
|
118 |
description_type = gr.Dropdown(
|
119 |
label="Select Description Type",
|
120 |
choices=[
|
121 |
+
"Short Formal π",
|
122 |
+
"Bullet Points π",
|
123 |
+
"Amazon Optimized π",
|
124 |
+
"Fashion π",
|
125 |
+
"Sport π",
|
126 |
+
"Technical Specifications βοΈ",
|
127 |
+
"SEO Optimized π",
|
128 |
+
"Social Media Style π±",
|
129 |
+
"Luxury π",
|
130 |
+
"Kid-Friendly π§Έ",
|
131 |
+
"Health and Beauty π",
|
132 |
+
"Electronic Gadgets π±",
|
133 |
+
"Eco-Friendly π±",
|
134 |
+
"Personalized Gifts π",
|
135 |
+
"Seasonal Promotion π",
|
136 |
+
"Clearance Sale π·οΈ",
|
137 |
+
"Cross-Selling π",
|
138 |
+
"Up-Selling β¬οΈ",
|
139 |
+
"Multi-Language Support π",
|
140 |
+
"User Testimonials β",
|
141 |
+
"Instructional π",
|
142 |
+
"Bundle Offer π¦",
|
143 |
+
"Gift Guide Entry π",
|
144 |
+
"Limited Edition π",
|
145 |
+
"Subscription Model π",
|
146 |
+
"B2B Focused π’",
|
147 |
"Other",
|
148 |
],
|
149 |
+
value="Short Formal π",
|
150 |
)
|
151 |
custom_instruction = gr.Textbox(
|
152 |
label="Custom Instruction (Only for 'Other')", visible=False
|