Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,20 +3,22 @@ from transformers import pipeline
|
|
3 |
|
4 |
generator = pipeline("text-generation", model="gpt2")
|
5 |
|
6 |
-
def enhance_description(category, location):
|
7 |
-
prompt = f"Write a compelling Google Business Profile description for a {category}
|
8 |
-
result = generator(prompt, max_length=
|
9 |
return result
|
10 |
|
11 |
iface = gr.Interface(
|
12 |
fn=enhance_description,
|
13 |
inputs=[
|
14 |
-
gr.Textbox(label="Business Category", placeholder="e.g. coffee shop"),
|
15 |
-
gr.Textbox(label="Location", placeholder="e.g. Medellín, Colombia")
|
|
|
16 |
],
|
17 |
outputs="text",
|
18 |
-
title="GMB Description
|
19 |
-
description="
|
|
|
20 |
)
|
21 |
|
22 |
iface.launch()
|
|
|
3 |
|
4 |
generator = pipeline("text-generation", model="gpt2")
|
5 |
|
6 |
+
def enhance_description(category, location, custom_name):
|
7 |
+
prompt = f"Write a compelling Google Business Profile description for a business named '{custom_name}', which is a {category} based in {location}. Highlight quality, trust, and innovation."
|
8 |
+
result = generator(prompt, max_length=120, num_return_sequences=1)[0]['generated_text']
|
9 |
return result
|
10 |
|
11 |
iface = gr.Interface(
|
12 |
fn=enhance_description,
|
13 |
inputs=[
|
14 |
+
gr.Textbox(label="Business Category", value="Website design services", placeholder="e.g. coffee shop"),
|
15 |
+
gr.Textbox(label="Location", value="Colombia", placeholder="e.g. Medellín, Colombia"),
|
16 |
+
gr.Textbox(label="Business Name", value="Webpy", placeholder="e.g. Webpy")
|
17 |
],
|
18 |
outputs="text",
|
19 |
+
title="GMB Description Optimizer - Powered by Webpy",
|
20 |
+
description="Boost your Google My Business profile with an AI-generated description. Enter your business info and get an SEO-friendly, trustworthy summary in seconds.",
|
21 |
+
theme="default"
|
22 |
)
|
23 |
|
24 |
iface.launch()
|