Fanwang Meng commited on
Commit
738a752
1 Parent(s): 27f70b5

Update the temp patch

Browse files
Files changed (1) hide show
  1. app.py +39 -38
app.py CHANGED
@@ -231,44 +231,45 @@ st.write(
231
  )
232
  # Generate predictions when the user uploads a file
233
  # if submit_job_button:
234
- print(st.session_state)
235
- if "job_button" in st.session_state:
236
- # when new file is uploaded
237
- # update_uploader_session_info()
238
- st.write(
239
- f"the state of uploaded file changed after checking: {st.session_state.uploaded_file_changed}"
240
- )
241
- # if st.session_state.uploaded_file_changed:
242
- # temp_dir = tempfile.mkdtemp()
243
- # # Create a temporary file path for the uploaded file
244
- # temp_file_path = os.path.join(temp_dir, uploaded_file.name)
245
- # # Save the uploaded file to the temporary file path
246
- # with open(temp_file_path, "wb") as temp_file:
247
- # temp_file.write(uploaded_file.read())
248
-
249
- # mol_features, info_df, results = generate_predictions(
250
- # input_fname=temp_file_path,
251
- # sep="\s+|\t+",
252
- # clf=classifiers_dict[classifier],
253
- # _models_dict=all_models,
254
- # sampling=resample_methods_dict[resampler],
255
- # time_per_mol=120,
256
- # mol_features=None,
257
- # info_df=None,
258
- # )
259
- # st.session_state.mol_features = mol_features
260
- # st.session_state.info_df = info_df
261
- # else:
262
- # mol_features, info_df, results = generate_predictions(
263
- # input_fname=None,
264
- # sep="\s+|\t+",
265
- # clf=classifiers_dict[classifier],
266
- # _models_dict=all_models,
267
- # sampling=resample_methods_dict[resampler],
268
- # time_per_mol=120,
269
- # mol_features=st.session_state.mol_features,
270
- # info_df=st.session_state.info_df,
271
- # )
 
272
  temp_dir = tempfile.mkdtemp()
273
  # Create a temporary file path for the uploaded file
274
  temp_file_path = os.path.join(temp_dir, uploaded_file.name)
 
231
  )
232
  # Generate predictions when the user uploads a file
233
  # if submit_job_button:
234
+
235
+ # if "job_button" in st.session_state:
236
+ # when new file is uploaded
237
+ # update_uploader_session_info()
238
+ # st.write(
239
+ # f"the state of uploaded file changed after checking: {st.session_state.uploaded_file_changed}"
240
+ # )
241
+ # if st.session_state.uploaded_file_changed:
242
+ # temp_dir = tempfile.mkdtemp()
243
+ # # Create a temporary file path for the uploaded file
244
+ # temp_file_path = os.path.join(temp_dir, uploaded_file.name)
245
+ # # Save the uploaded file to the temporary file path
246
+ # with open(temp_file_path, "wb") as temp_file:
247
+ # temp_file.write(uploaded_file.read())
248
+
249
+ # mol_features, info_df, results = generate_predictions(
250
+ # input_fname=temp_file_path,
251
+ # sep="\s+|\t+",
252
+ # clf=classifiers_dict[classifier],
253
+ # _models_dict=all_models,
254
+ # sampling=resample_methods_dict[resampler],
255
+ # time_per_mol=120,
256
+ # mol_features=None,
257
+ # info_df=None,
258
+ # )
259
+ # st.session_state.mol_features = mol_features
260
+ # st.session_state.info_df = info_df
261
+ # else:
262
+ # mol_features, info_df, results = generate_predictions(
263
+ # input_fname=None,
264
+ # sep="\s+|\t+",
265
+ # clf=classifiers_dict[classifier],
266
+ # _models_dict=all_models,
267
+ # sampling=resample_methods_dict[resampler],
268
+ # time_per_mol=120,
269
+ # mol_features=st.session_state.mol_features,
270
+ # info_df=st.session_state.info_df,
271
+ # )
272
+ if submit_job_button and uploaded_file:
273
  temp_dir = tempfile.mkdtemp()
274
  # Create a temporary file path for the uploaded file
275
  temp_file_path = os.path.join(temp_dir, uploaded_file.name)