Spaces:
Runtime error
Runtime error
File size: 1,010 Bytes
6e00735 f0a4457 afc6bfd 6e00735 f0a4457 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
from transformers import pipeline
generator = pipeline("text-generation", model="gpt2")
def improve_description(description):
prompt = f"Improve this Google Business Profile description. Make it clear, professional, and SEO-friendly:\n\n{description}\n\nImproved version:"
result = generator(prompt, max_length=120, num_return_sequences=1)[0]['generated_text']
return result
with gr.Blocks() as demo:
gr.Markdown("## Webpy - GMB Optimizer")
gr.Markdown("Paste your Google Business Profile URL (optional):")
url = gr.Textbox(label="Google My Business URL (optional)")
gr.Markdown("Then paste your current description below:")
input_desc = gr.Textbox(lines=4, label="Current Description", placeholder="e.g. We create affordable websites for small businesses in Colombia.")
output = gr.Textbox(label="Improved Description")
submit = gr.Button("Enhance")
submit.click(fn=improve_description, inputs=input_desc, outputs=output)
demo.launch() |