Spaces:
Running
Running
File size: 460 Bytes
51348d0 f87f969 51348d0 |
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 |
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'])
|