File size: 425 Bytes
501414a
 
 
4c121be
0be76f4
501414a
4c121be
 
 
501414a
 
4c121be
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()