ThanaritKanjanametawat
Add demo pipeline
f87f969
raw
history blame
460 Bytes
import streamlit as st
from transformers import pipeline
# Add a title
st.title('GPT Detection Demo')
# Add 4 options for 4 models
option = st.sidebar.selectbox(
'Which model do you want to use?',
('GPT-2', 'GPT-3', 'GPT-Neo', 'GPT-J')
)
pipe = pipeline('text-generation', model=option)
text = st.text_area('Enter text here', 'Type here')
if st.button('Generate'):
st.write(pipe(text)[0]['generated_text'])