Spaces:
Running
Running
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 pipeline do you want to use?', | |
('sentiment-analysis', 'ner', 'question-answering', 'text-generation'), | |
) | |
option2 = st.sidebar.selectbox( | |
'Which model do you want to use?', | |
('gpt2', 'gpt2-medium', 'gpt2-large', 'gpt2-xl'), | |
) | |
pipe = pipeline(option) | |
text = st.text_area('Enter text here', '') | |
if st.button('Generate'): | |
st.write(pipe(text)[0]) | |