ThanaritKanjanametawat commited on
Commit
f87f969
1 Parent(s): 51348d0

Add demo pipeline

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -1,5 +1,25 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
5
 
 
1
  import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ # Add a title
5
+ st.title('GPT Detection Demo')
6
+
7
+ # Add 4 options for 4 models
8
+ option = st.sidebar.selectbox(
9
+ 'Which model do you want to use?',
10
+ ('GPT-2', 'GPT-3', 'GPT-Neo', 'GPT-J')
11
+ )
12
+
13
+
14
+ pipe = pipeline('text-generation', model=option)
15
+ text = st.text_area('Enter text here', 'Type here')
16
+
17
+ if st.button('Generate'):
18
+ st.write(pipe(text)[0]['generated_text'])
19
+
20
+
21
+
22
+
23
+
24
 
 
 
25