dominguezdaniel commited on
Commit
a20ff57
·
verified ·
1 Parent(s): afc6bfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -15
app.py CHANGED
@@ -3,22 +3,15 @@ from transformers import pipeline
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()
 
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()