CoolFace
Apppublic

JanusCR/openclaw-fallback

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
app.py19 linesDownload Raw Back to root
1from transformers import pipeline2import gradio as gr3 4# Usamos un modelo compatible y gratuito de texto5generator = pipeline("text-generation", model="tiiuae/falcon-rw-1b")6 7def responder(prompt):8    result = generator(prompt, max_length=256, do_sample=True)9    return result[0]['generated_text']10 11iface = gr.Interface(12    fn=responder,13    inputs=gr.Textbox(label="Prompt para el modelo"),14    outputs=gr.Textbox(label="Respuesta generada"),15    title="Fallback API para OpenClaw",16    description="Usa Falcon-RW-1B como motor de respaldo gratuito."17)18 19iface.launch()