Skip to content

Commit

Permalink
Black reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
smlindauer committed Jan 31, 2024
1 parent eb4e267 commit 426282b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions src/sasctl/pzmm/mlflow_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,20 @@ def read_mlflow_model_file(cls, m_path=Path.cwd()):
var_dict = {
"python_version": m_yml["flavors"]["python_function"]["python_version"],
"model_path": m_yml["flavors"]["python_function"]["model_path"],
"serialization_format": m_yml["flavors"]["sklearn"]["serialization_format"],
"serialization_format": m_yml["flavors"]["sklearn"][
"serialization_format"
],
"run_id": m_yml["run_id"],
"mlflowPath": m_path
"mlflowPath": m_path,
}
except KeyError:
raise ValueError("This MLFlow model type is not currently supported.") from None
raise ValueError(
"This MLFlow model type is not currently supported."
) from None
except TypeError:
raise ValueError("This MLFlow model type is not currently supported.") from None
raise ValueError(
"This MLFlow model type is not currently supported."
) from None

# Read in the input and output variables
try:
Expand All @@ -57,5 +63,5 @@ def read_mlflow_model_file(cls, m_path=Path.cwd()):
"Improper or unset signature values for model. No input or output "
"dicts could be generated. "
) from None

return var_dict, inputs_dict, outputs_dict
2 changes: 1 addition & 1 deletion src/sasctl/pzmm/write_json_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def write_file_metadata_json(
dict_list.append({"role": "scoreResource", "name": model_prefix + ".mojo"})
elif is_tf_keras_model:
dict_list.append({"role": "scoreResource", "name": model_prefix + ".h5"})
#conditions added for pytorch.
# conditions added for pytorch.
elif is_pytorch_model:
dict_list.append(({"role": "scoreResource", "name": model_prefix + ".pth"}))
else:
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/pzmm/write_score_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def _viya35_model_load(
)
elif pytorch_model:
cls.score_code += (
f"model = torch.load(\"/models/resources/viya/{model_id}/\" + "
f'model = torch.load("/models/resources/viya/{model_id}/" + '
f"{model_file_name})\n\n"
)
return (
Expand Down

0 comments on commit 426282b

Please sign in to comment.