diff --git a/oss-model-connector/ossmodelconnector/oss_model_connector.py b/oss-model-connector/ossmodelconnector/oss_model_connector.py index 7838992..852c4f1 100644 --- a/oss-model-connector/ossmodelconnector/oss_model_connector.py +++ b/oss-model-connector/ossmodelconnector/oss_model_connector.py @@ -116,7 +116,8 @@ def _from_file_helper(self, filename, shared, nbytes): def _connector_open(self, file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None): if isinstance(file, pathlib.Path): file = str(file) - if self._hook_dir and file.startswith(self._hook_dir): + + if self._hook_dir and isinstance(file, str) and file.startswith(self._hook_dir): binary = False if 'b' in mode: binary = True