Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import pipeline | |
generator = pipeline("text-generation", model="gpt2") | |
def enhance_description(category, location, custom_name): | |
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." | |
result = generator(prompt, max_length=120, num_return_sequences=1)[0]['generated_text'] | |
return result | |
iface = gr.Interface( | |
fn=enhance_description, | |
inputs=[ | |
gr.Textbox(label="Business Category", value="Website design services", placeholder="e.g. coffee shop"), | |
gr.Textbox(label="Location", value="Colombia", placeholder="e.g. Medellín, Colombia"), | |
gr.Textbox(label="Business Name", value="Webpy", placeholder="e.g. Webpy") | |
], | |
outputs="text", | |
title="GMB Description Optimizer - Powered by Webpy", | |
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.", | |
theme="default" | |
) | |
iface.launch() |