Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,22 +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=120, num_return_sequences=1)[0]['generated_text']
|
9 |
return result
|
10 |
|
11 |
-
|
12 |
-
fn=
|
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
|
20 |
-
description="
|
21 |
-
|
22 |
-
)
|
23 |
-
|
24 |
-
iface.launch()
|
|
|
3 |
|
4 |
generator = pipeline("text-generation", model="gpt2")
|
5 |
|
6 |
+
def improve_description(description):
|
7 |
+
prompt = f"Improve this business description for a Google My Business profile. Make it sound professional, trustworthy, and SEO-friendly:\n\n{description}\n\nImproved version:"
|
8 |
result = generator(prompt, max_length=120, num_return_sequences=1)[0]['generated_text']
|
9 |
return result
|
10 |
|
11 |
+
gr.Interface(
|
12 |
+
fn=improve_description,
|
13 |
+
inputs=gr.Textbox(label="Your Current Business Description", placeholder="We build websites for small businesses in Colombia..."),
|
|
|
|
|
|
|
|
|
14 |
outputs="text",
|
15 |
+
title="Webpy: GMB Description Enhancer",
|
16 |
+
description="Paste your current Google My Business description and get an AI-enhanced version.",
|
17 |
+
).launch()
|
|
|
|
|
|