Skip to content

Commit

Permalink
added comments for better understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
ronylpatil committed Mar 18, 2024
1 parent 0771299 commit bf4baae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions prod/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

if 'final_model' not in st.session_state :
with st.spinner('Loading Models') :
# loading model using version, achieve same using alias
st.session_state['final_model'] = load_model(f"models:/{model.name}/{model.version}")
st.sidebar.info('##### Server is Up 🔥')
except :
Expand Down Expand Up @@ -84,7 +85,10 @@
user_input['total_minerals']]]

if st.button('Predict ⚙️') :
with st.spinner('Training the model...') :
with st.spinner('Processing data...') :
op = st.session_state['final_model'].predict(input_data)[0]
pred_prob = st.session_state['final_model'].predict_proba(input_data)[0]
st.success(f'Predicted Quality is {op} with {(max(pred_prob) * 100):.2f}% model\'s confidence.')
st.success(f'Predicted Quality is {op} with {(max(pred_prob) * 100):.2f}% confidence.')

# cmd: streamlit run ./prod/client.py

0 comments on commit bf4baae

Please sign in to comment.