joko333 commited on
Commit
e7d2b25
·
1 Parent(s): 14f84b3

Load prediction model and update Streamlit app interface

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -1,16 +1,12 @@
1
  import streamlit as st
 
2
  #import transformers
3
  #from transformers import pipeline
4
 
5
  st.title('My first app')
6
  x = st.slider('Select a value')
7
  st.write(x, 'squared is', x * x)
 
 
 
8
 
9
- # classifier = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")
10
-
11
- # # Example input text
12
- # input_text = "I love using Hugging Face models!"
13
-
14
- # # Get the classification result
15
- # result = classifier(input_text)
16
- # st.write(result)
 
1
  import streamlit as st
2
+ from utils.prediction import load_model_for_prediction
3
  #import transformers
4
  #from transformers import pipeline
5
 
6
  st.title('My first app')
7
  x = st.slider('Select a value')
8
  st.write(x, 'squared is', x * x)
9
+ # load the model and cache it
10
+ model, label_encoder, tokenizer = load_model_for_prediction()
11
+ st.write('Model loaded')
12