Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
# Load a free, public text-generation model | |
pipe = pipeline("text-generation", model="mrm8488/t5-base-finetuned-common_gen") | |
# Define your function | |
def respond(prompt): | |
output = pipe(prompt, max_new_tokens=50)[0]['generated_text'] | |
return output | |
# Build the interface | |
gr.Interface(fn=respond, inputs="text", outputs="text", title="Free AI Essay Bot").launch() | |