Aryan-EcoClim commited on
Commit
90433fe
·
1 Parent(s): f2681cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -102,8 +102,11 @@ st.sidebar.title("Options")
102
  # Create a radio button widget for training mode
103
  training_mode = st.sidebar.radio("Select training mode", ["None", "Dropout", "Batch Normalization"])
104
 
105
- # Create a select box widget for user choice
106
- user_choice = st.sidebar.selectbox("Select what you want to do", ["Predict", "Train"])
 
 
 
107
 
108
  # Display the current training mode and user choice
109
  st.write(f"Training mode: {training_mode}")
@@ -123,9 +126,9 @@ try:
123
  # Generate some dummy target data for demonstration
124
  # You can replace this with your actual target data
125
  target = np.random.randint(0, 6, size=(1,))
126
- # Call the model with the training mode argument
127
- # Use a dictionary to map the training mode to the corresponding boolean value
128
- loss = model.train_on_batch(image[np.newaxis, ...], target, training={"None": False, "Dropout": True, "Batch Normalization": True}[training_mode])
129
  st.success(f'Loss: {loss}')
 
130
  except Exception as e:
131
  st.error(f"An error occurred: {e}. Please contact us EcoClim Solutions at EcoClimSolutions.wordpress.com.")
 
102
  # Create a radio button widget for training mode
103
  training_mode = st.sidebar.radio("Select training mode", ["None", "Dropout", "Batch Normalization"])
104
 
105
+ if training_mode == 'None':
106
+ user_choice == 'Predict'
107
+ elif training_mode == "Dropout" ot "Batch Normalization":
108
+ user_choice == 'Train'
109
+
110
 
111
  # Display the current training mode and user choice
112
  st.write(f"Training mode: {training_mode}")
 
126
  # Generate some dummy target data for demonstration
127
  # You can replace this with your actual target data
128
  target = np.random.randint(0, 6, size=(1,))
129
+ # Call the model without the training argument
130
+ loss = model.train_on_batch(image[np.newaxis, ...], target)
 
131
  st.success(f'Loss: {loss}')
132
+
133
  except Exception as e:
134
  st.error(f"An error occurred: {e}. Please contact us EcoClim Solutions at EcoClimSolutions.wordpress.com.")