Spaces:
Runtime error
Runtime error
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() |