Commit
Β·
895197b
1
Parent(s):
43337aa
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,21 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import AutoTokenizer,
|
3 |
from home import render_home
|
4 |
from scipy.special import softmax
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
st.sidebar.title("Navigation and review examples")
|
9 |
|
10 |
# Use the selected page function to display the content
|
|
|
11 |
|
12 |
-
page
|
|
|
13 |
|
14 |
# An example for a positive movie review
|
15 |
st.sidebar.markdown("π **Positive Review Example:**")
|
@@ -18,12 +24,3 @@ st.sidebar.markdown("> I absolutely loved this movie! It was so thrilling and ca
|
|
18 |
# An example for a negative movie review
|
19 |
st.sidebar.markdown("π **Negative Review Example:**")
|
20 |
st.sidebar.markdown("> This movie was a complete disappointment. The story was boring, and the acting was terrible. I wouldn't recommend it to anyone.")
|
21 |
-
|
22 |
-
if page == "Home":
|
23 |
-
render_home(model, tokenizer)
|
24 |
-
|
25 |
-
# Load the TinyBERT model and tokenizer
|
26 |
-
model_path = "petermutwiri/Tiny_Bert_Cupstone"
|
27 |
-
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
28 |
-
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
29 |
-
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
from home import render_home
|
4 |
from scipy.special import softmax
|
5 |
|
6 |
+
# Load the TinyBERT model and tokenizer
|
7 |
+
model_path = "petermutwiri/Tiny_Bert_Cupstone"
|
8 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_path)
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
10 |
+
|
11 |
+
# Create a sidebar for navigation and review examples
|
12 |
st.sidebar.title("Navigation and review examples")
|
13 |
|
14 |
# Use the selected page function to display the content
|
15 |
+
page = st.sidebar.radio("Go to", ["Home"])
|
16 |
|
17 |
+
if page == "Home":
|
18 |
+
render_home(model, tokenizer)
|
19 |
|
20 |
# An example for a positive movie review
|
21 |
st.sidebar.markdown("π **Positive Review Example:**")
|
|
|
24 |
# An example for a negative movie review
|
25 |
st.sidebar.markdown("π **Negative Review Example:**")
|
26 |
st.sidebar.markdown("> This movie was a complete disappointment. The story was boring, and the acting was terrible. I wouldn't recommend it to anyone.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|