Skip to content

Commit eaedb4d

Browse files
committed
Update for pyyaml 6.0 (#435)
* yaml.safe_load instead of yaml.load * Use yaml.safe_load in converters __init__.py
1 parent 738d673 commit eaedb4d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hls4ml/converters/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def construct_keras_model(loader, node):
9393

9494
print('Loading configuration from', config_file)
9595
with open(config_file, 'r') as file:
96-
parsed_config = yaml.load(file, Loader=yaml.SafeLoader)
96+
parsed_config = yaml.safe_load(file)
9797
return parsed_config
9898

9999
def convert_from_config(config):

test/pytest/test_cnn_mnist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def mnist_model():
3737
def hls_model(settings):
3838
io_type = settings[0]
3939
strategy = settings[1]
40-
config = yaml.load(open('../../example-models/config-files/qkeras_mnist_cnn_config.yml').read())
40+
config = yaml.safe_load(open('../../example-models/config-files/qkeras_mnist_cnn_config.yml').read())
4141
config['KerasJson'] = '../../example-models/keras/qkeras_mnist_cnn.json'
4242
config['KerasH5'] = '../../example-models/keras/qkeras_mnist_cnn_weights.h5'
4343
config['OutputDir'] = 'hls4mlprj_cnn_mnist_{}_{}'.format(io_type, strategy)

0 commit comments

Comments
 (0)