Skip to content

Commit

Permalink
FIX: avoid crash if rf model has to be obtained from S3
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfidan committed Nov 14, 2024
1 parent 7178359 commit 9bdd03a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rainforest/ml/rfdefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ def read_rf(rf_name, filepath=''):
raise IOError('RF model {:s} does not exist!'.format(rf_name))

if is_compressed:
with gzip.open(open(ObjStorage.check_file(rf_name), 'rb')) as f:
with gzip.open(open(rf_name, 'rb')) as f:
return MyCustomUnpickler(f).load()
else:
with open(ObjStorage.check_file(rf_name), 'rb') as f:
with open(rf_name, 'rb') as f:
return MyCustomUnpickler(f).load()

0 comments on commit 9bdd03a

Please sign in to comment.