Text_Generation / app.py
Nikhitha2310's picture
Update app.py
c7b303d verified
raw
history blame contribute delete
276 Bytes
import streamlit as st
import transformers
from transformers import pipeline
generator = pipeline('text-generation', model='gpt2')
text=st.text_input("Enter a text")
btn=st.button("Submit")
if(text and btn):
output=generator(text)
st.write(output[0]['generated_text'])