Kewl commited on
Commit
1bfcbd4
1 Parent(s): 9403c49

Milestone 2 (#8)

Browse files

* merge (#3)

* Create main.yml

* Update main.yml

* Update main.yml

* Update main.yml

* adding sentiment analysis for dummy text

* update version

* testing deployment

Files changed (3) hide show
  1. app.py +5 -3
  2. dockerfile +14 -0
  3. requirements.txt +1 -1
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
- classifier = pipeline(task="sentiment-analysis")
5
 
6
  st.title("Sentiment Analysis App")
7
 
@@ -10,7 +10,9 @@ NEGATIVE = "You are a terrible person!"
10
 
11
  st.caption(POSITIVE)
12
  if st.button("Get sentiment", key=1):
13
- st.write(classifier(POSITIVE)[0]['label'])
 
14
  st.caption(NEGATIVE)
15
  if st.button("Get sentiment", key=2):
16
- st.write(classifier(NEGATIVE)[0]['label'])
 
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ # classifier = pipeline(task="sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english")
5
 
6
  st.title("Sentiment Analysis App")
7
 
 
10
 
11
  st.caption(POSITIVE)
12
  if st.button("Get sentiment", key=1):
13
+ # st.write(classifier(POSITIVE)[0]['label'])
14
+ st.write("POSITIVE")
15
  st.caption(NEGATIVE)
16
  if st.button("Get sentiment", key=2):
17
+ st.write("POSITIVE")
18
+ # st.write(classifier(NEGATIVE)[0]['label'])
dockerfile ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3
2
+
3
+ WORKDIR /usr/src/app
4
+
5
+ COPY requirements.txt ./
6
+ RUN pip install --no-cache-dir -r requirements.txt
7
+
8
+ COPY . .
9
+
10
+ EXPOSE 8501
11
+
12
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
13
+
14
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
requirements.txt CHANGED
@@ -2,4 +2,4 @@ streamlit
2
  numpy
3
  transformers
4
  datasets
5
- tensorflow==2.9.3
 
2
  numpy
3
  transformers
4
  datasets
5
+ tensorflow==2.12.0