# -*- coding: utf-8 -*- | |
"""app.ipynb | |
Automatically generated by Colaboratory. | |
Original file is located at | |
https://colab.research.google.com/drive/19167B_f_iSL9n-syr-urLCEIq5RZFmcZ | |
""" | |
!pip install gradio | |
!pip install transformers | |
from transformers import pipeline, set_seed | |
generator = pipeline('text-generation', model='gpt2') | |
import gradio as gr | |
def func(text): | |
generated = generator(text) | |
return generated | |
app = gr.Interface(fn=func, inputs="textbox", outputs="textbox", title="Text Generator") | |
app.launch() | |