test-chatgpt / app.py
akhaliq's picture
akhaliq HF staff
Create app.py
96b496e
raw
history blame
No virus
316 Bytes
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()