DingShinn commited on
Commit
a026113
·
1 Parent(s): a2d7030

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -6
app.py CHANGED
@@ -1,9 +1,22 @@
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
- from transformers import pipeline
3
 
4
- pipe = pipeline("sentiment-analysis")
5
- text = st.text_area("enter some text")
 
 
 
 
 
 
 
 
6
 
7
- if text:
8
- out = pipe(text)
9
- st.json(out)
 
1
+ # import streamlit as st
2
+ # from transformers import pipeline
3
+
4
+ # pipe = pipeline("sentiment-analysis")
5
+ # text = st.text_area("enter some text")
6
+
7
+ # if text:
8
+ # out = pipe(text)
9
+ # st.json(out)
10
  import streamlit as st
 
11
 
12
+ # adding the text that will show in the text box as default
13
+ default_value = "See how a modern neural network auto-completes your text 🤗 This site, built by the Hugging Face team, lets you write a whole document directly from your browser, and you can trigger the Transformer anywhere using the Tab key. Its like having a smart machine that completes your thoughts 😀 Get started by typing a custom snippet, check out the repository, or try one of the examples. Have fun!"
14
+
15
+ sent = st.text_area("Text", default_value, height = 275)
16
+ max_length = st.sidebar.slider("Max Length", min_value = 10, max_value=30)
17
+ temperature = st.sidebar.slider("Temperature", value = 1.0, min_value = 0.0, max_value=1.0, step=0.05)
18
+ top_k = st.sidebar.slider("Top-k", min_value = 0, max_value=5, value = 0)
19
+ top_p = st.sidebar.slider("Top-p", min_value = 0.0, max_value=1.0, step = 0.05, value = 0.9)
20
+ num_return_sequences = st.sidebar.number_input('Number of Return Sequences', min_value=1, max_value=5, value=1, step=1)
21
+
22