Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,21 +3,15 @@ from transformers import pipeline
|
|
| 3 |
|
| 4 |
generator = pipeline("text-generation", model="gpt2")
|
| 5 |
|
| 6 |
-
def
|
| 7 |
-
prompt = f"
|
| 8 |
-
result = generator(prompt, max_length=
|
| 9 |
return result
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
gr.
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
output = gr.Textbox(label="Improved Description")
|
| 19 |
-
|
| 20 |
-
submit = gr.Button("Enhance")
|
| 21 |
-
submit.click(fn=improve_description, inputs=input_desc, outputs=output)
|
| 22 |
-
|
| 23 |
-
demo.launch()
|
|
|
|
| 3 |
|
| 4 |
generator = pipeline("text-generation", model="gpt2")
|
| 5 |
|
| 6 |
+
def generate_description(business_name):
|
| 7 |
+
prompt = f"Write a professional and SEO-friendly Google My Business description for a business named '{business_name}'. Highlight its quality, trust, and services."
|
| 8 |
+
result = generator(prompt, max_length=100, num_return_sequences=1)[0]['generated_text']
|
| 9 |
return result
|
| 10 |
|
| 11 |
+
gr.Interface(
|
| 12 |
+
fn=generate_description,
|
| 13 |
+
inputs=gr.Textbox(label="Business Name", placeholder="e.g. Webpy"),
|
| 14 |
+
outputs="text",
|
| 15 |
+
title="Google My Business Description Generator",
|
| 16 |
+
description="Enter your business name and get a professional, AI-enhanced description for your GMB profile.",
|
| 17 |
+
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|