petermutwiri commited on
Commit
ac5da21
·
1 Parent(s): cd82b88

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import AutoTokenizer, AutoConfig, AutoModelForSequenceClassification
3
+ from home import render_home
4
+ from scipy.special import softmax
5
+
6
+
7
+ # Create a sidebar for navigation
8
+ st.sidebar.title("Navigation")
9
+ st.sidebar.markdown("👉 **Choose an option from the sidebar**")
10
+ page = st.sidebar.radio("Go to", ["Home"])
11
+
12
+ # Load the TinyBERT model and tokenizer
13
+ model_path = "petermutwiri/Tiny_Bert_Cupstone"
14
+ model = AutoModelForSequenceClassification.from_pretrained(model_path)
15
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
16
+
17
+
18
+ # Use the selected page function to display the content
19
+ if page == "Home":
20
+ render_home(model, tokenizer)