File size: 531 Bytes
0808a61 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# -*- 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()
|