frankiePizza commited on
Commit
b4a4e9d
·
verified ·
1 Parent(s): 6cff188

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -1,21 +1,19 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
- pipe = pipeline("sentiment-analysis")
5
- st.title("Sentiment")
6
- text = st.text_area("Enter some text here")
7
 
8
- if text:
9
- out = pipe(text)
10
- st.json(out)
11
 
 
 
12
 
13
- text_generator = pipeline("text-generation")
14
  st.title("Text Generator")
15
- input_text = st.text_area("Enter generator prompt: ")
16
 
17
  if input_text:
18
- st.json(text_generator(input_text))
19
-
20
 
 
 
21
 
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ sentiment = pipeline("sentiment-analysis")
5
+ text_generator = pipeline("text-generation")
 
6
 
 
 
 
7
 
8
+ st.title("Sentiment")
9
+ sentiment_text = st.text_area("Enter some text here")
10
 
 
11
  st.title("Text Generator")
12
+ generator_text = st.text_area("Enter generator prompt: ")
13
 
14
  if input_text:
15
+ st.json(text_generator(generator_text))
 
16
 
17
+ if text:
18
+ st.json(sentiment(sentiment_text))
19