Spaces:
Sleeping
Sleeping
from huggingface_hub import from_pretrained_fastai | |
import gradio as gr | |
# Cargar modelo FastAI desde Hugging Face | |
learn = from_pretrained_fastai("jeancguerrero/fastai-lm-climate") | |
# Funci贸n de generaci贸n de texto | |
def generate(text): | |
output = learn.predict(text)[0] | |
return output | |
# Interfaz Gradio | |
gr.Interface( | |
fn=generate, | |
inputs=gr.Textbox(lines=2, placeholder="Introduce un inicio de texto sobre cambio clim谩tico..."), | |
outputs=gr.Textbox(label="Texto generado"), | |
title="Generador clim谩tico - FastAI", | |
description="Modelo de lenguaje entrenado con FastAI para generar frases sobre cambio clim谩tico." | |
).launch() | |