From bf4baae6855daf96e2de81e66168bb06942ae948 Mon Sep 17 00:00:00 2001 From: ronilpatil Date: Mon, 18 Mar 2024 11:26:11 +0530 Subject: [PATCH] added comments for better understanding --- prod/client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/prod/client.py b/prod/client.py index 5cfcac7..6210f9f 100644 --- a/prod/client.py +++ b/prod/client.py @@ -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 : @@ -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 + \ No newline at end of file