akruti24 commited on
Commit
769e011
·
verified ·
1 Parent(s): 99bc998

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -2,11 +2,10 @@ import gradio as gr
2
  from transformers import pipeline
3
 
4
  # Load model (You can replace this with any model like GPT-2 or your custom one)
5
- generator = pipeline("text-generation", model="aniketmaurya/product-description-generator")
6
-
7
 
8
  def generate_description(title, tags):
9
- prompt = f"Generate an SEO-friendly product description for a product titled '{title}' with tags: {tags}."
10
  result = generator(prompt, max_length=100, num_return_sequences=1)
11
  return result[0]['generated_text']
12
 
 
2
  from transformers import pipeline
3
 
4
  # Load model (You can replace this with any model like GPT-2 or your custom one)
5
+ generator = pipeline("text-generation", model="gpt2")
 
6
 
7
  def generate_description(title, tags):
8
+ prompt = f"Write a clear, professional, and SEO-optimized product description for an e-commerce listing. The product title is: '{title}'. The relevant tags or features include: {tags}. Mention key benefits, usage, and appeal to buyers."
9
  result = generator(prompt, max_length=100, num_return_sequences=1)
10
  return result[0]['generated_text']
11