Spaces:
Running
Running
File size: 571 Bytes
51348d0 f87f969 445e717 c9004d2 f87f969 c9004d2 f87f969 445e717 67bc30c f87f969 67bc30c 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 27 28 29 30 |
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])
|