File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -158,11 +158,11 @@ def validate_environment(
158
158
159
159
if train_environment_version < inference_environment_version :
160
160
invalid_messages ["mismatch" ].append (
161
- f"Version of module { module } was lower in training then in inference: { train_environment_version !s} <= { inference_environment_version !s} "
161
+ f"Version of module { module } was lower in training than in inference: { train_environment_version !s} <= { inference_environment_version !s} "
162
162
)
163
163
elif train_environment_version > inference_environment_version :
164
164
invalid_messages ["critical mismatch" ].append (
165
- f"CRITICAL: Version of module { module } was greater in training then in inference: { train_environment_version !s} > { inference_environment_version !s} "
165
+ f"CRITICAL: Version of module { module } was greater in training than in inference: { train_environment_version !s} > { inference_environment_version !s} "
166
166
)
167
167
168
168
for git_record in train_environment ["git_versions" ].keys ():
Original file line number Diff line number Diff line change @@ -451,6 +451,8 @@ def model(self) -> torch.nn.Module:
451
451
try :
452
452
model = torch .load (self .checkpoint .path , map_location = self .device , weights_only = False ).to (self .device )
453
453
except Exception as e : # Wildcard exception to catch all errors
454
+ if self .report_error :
455
+ self .checkpoint .report_error ()
454
456
validation_result = self .checkpoint .validate_environment (on_difference = "return" )
455
457
error_msg = f"Error loading model - { validation_result } "
456
458
raise RuntimeError (error_msg ) from e
You can’t perform that action at this time.
0 commit comments