Skip to content

Commit

Permalink
Improved error handling for check_test_time_input in inference.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
aecelaya committed Oct 8, 2024
1 parent f711e0c commit a153f3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mist/inference/main_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ def check_test_time_input(
# Convert input to pandas dataframe
if isinstance(patients, pd.DataFrame):
return patients
if '.csv' in patients:
if '.csv' in patients and isinstance(patients, str):
return pd.read_csv(patients)
if isinstance(patients, dict):
return utils.convert_dict_to_df(patients)
if '.json' in patients:
if '.json' in patients and isinstance(patients, str):
patients = utils.read_json_file(patients)
return utils.convert_dict_to_df(patients)
raise ValueError(f"Received invalid input format: {type(patients)}")
Expand Down

0 comments on commit a153f3f

Please sign in to comment.