Skip to content

Commit 23a37e7

Browse files
sxjsciencegradientsky
authored andcommitted
[Security] load --> safe_load (#1987)
* load --> safe_load * retrigger ci * Update setup.py * fix for fairscale * up-pin fairscale version * Update test_core.sh (cherry picked from commit 5f4bb24)
1 parent 1a62b44 commit 23a37e7

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

.github/workflow_scripts/test_core.sh

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ source $(dirname "$0")/env_setup.sh
66

77
setup_build_env
88
install_core_all_tests
9+
python3 -m pip install ray_lightning==0.2.0 # TODO Change this line once we support ray_lightning 0.3.0
910

1011
cd core/
1112
python3 -m pytest --junitxml=results.xml --runslow tests

core/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
tests_require = [
5151
'pytest',
52-
'ray_lightning>=0.2.0,<0.3.0', # test ray lightning resource calculation
52+
# TODO(Re-enable ray_lightning once it released 0.3.0) 'ray_lightning>=0.2.0,<0.3.0'
5353
]
5454

5555
all_requires = []

multimodal/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
'torch>=1.9,<1.13',
3131
'torchvision<0.14.0',
3232
'torchtext<0.14.0',
33-
'fairscale>=0.4.5,<0.5.0',
33+
'fairscale>=0.4.5,<=0.4.6',
3434
'scikit-image>=0.19.1,<0.20.0',
3535
'smart_open>=5.2.1,<5.3.0',
3636
'pytorch_lightning>=1.6.0,<1.7.0',

multimodal/src/autogluon/multimodal/predictor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,8 @@ def _top_k_average(
11211121
best_k_models_yaml_path = os.path.join(save_path, BEST_K_MODELS_FILE)
11221122
if os.path.exists(best_k_models_yaml_path):
11231123
with open(best_k_models_yaml_path, "r") as f:
1124-
best_k_models = yaml.load(f, Loader=yaml.Loader)
1124+
best_k_models = yaml.safe_load(f)
1125+
11251126
else:
11261127
# In some cases, the training ends up too early (e.g., due to time_limit) so that there is
11271128
# no saved best_k model checkpoints. In that scenario, we won't perform any model averaging.

0 commit comments

Comments
 (0)