mirror of
https://github.com/clearml/clearml
synced 2025-03-03 10:42:00 +00:00
Protect against wrong file object type when auto-binding models
This commit is contained in:
parent
ed18949e3f
commit
1e7b35456d
@ -168,7 +168,12 @@ class WeightsFileHandler(object):
|
||||
if task is None:
|
||||
return filepath
|
||||
|
||||
local_model_path = os.path.abspath(filepath) if filepath else filepath
|
||||
try:
|
||||
local_model_path = os.path.abspath(filepath) if filepath else filepath
|
||||
except TypeError:
|
||||
# not a recognized type, we just return it back
|
||||
return filepath
|
||||
|
||||
model_info = WeightsFileHandler.ModelInfo(
|
||||
model=None, upload_filename=None, local_model_path=local_model_path,
|
||||
local_model_id=filepath, framework=framework, task=task)
|
||||
@ -319,7 +324,12 @@ class WeightsFileHandler(object):
|
||||
# WeightsFileHandler._model_out_store_lookup.pop(id(model))
|
||||
# trains_out_model, ref_model = None, None
|
||||
|
||||
local_model_path = os.path.abspath(saved_path) if saved_path else saved_path
|
||||
try:
|
||||
local_model_path = os.path.abspath(saved_path) if saved_path else saved_path
|
||||
except TypeError:
|
||||
# not a recognized type:
|
||||
return saved_path
|
||||
|
||||
model_info = WeightsFileHandler.ModelInfo(
|
||||
model=trains_out_model, upload_filename=None, local_model_path=local_model_path,
|
||||
local_model_id=saved_path, framework=framework, task=task)
|
||||
|
Loading…
Reference in New Issue
Block a user