Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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="
|
6 |
-
|
7 |
|
8 |
def generate_description(title, tags):
|
9 |
-
prompt = f"
|
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 |
|