Spaces:
Build error
Build error
import gradio as gr | |
from transformers import pipeline | |
nlp = pipeline('text-generation') | |
def generate_text(prompt): | |
response = nlp(prompt, max_length=100, num_return_sequences=1)[0] | |
return response['generated_text'] | |
iface = gr.Interface(generate_text, gr.inputs.Textbox(), gr.outputs.Textbox()) | |
iface.launch() | |