From c9a97d3eec8f5d4f524632cabec8372a918aed8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=87=E8=BD=A9?= Date: Wed, 30 Nov 2022 09:50:28 +0000 Subject: [PATCH 1/2] update TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/configurable.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张文轩 --- .../Transformer_ID0004_for_TensorFlow/noahnmt/configurable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/configurable.py b/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/configurable.py index efc5e9631..4263eb8b9 100644 --- a/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/configurable.py +++ b/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/configurable.py @@ -80,7 +80,7 @@ def _maybe_load_yaml(item): it is returned as-is. """ if isinstance(item, six.string_types): - return yaml.load(item) + return yaml.safe_load(item) elif isinstance(item, dict): return item else: -- Gitee From a2a8033379402e5908867225029257bb2d192651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=87=E8=BD=A9?= Date: Wed, 30 Nov 2022 09:55:49 +0000 Subject: [PATCH 2/2] update TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/bin/train.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张文轩 --- .../nlp/Transformer_ID0004_for_TensorFlow/noahnmt/bin/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/bin/train.py b/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/bin/train.py index a7ba28400..2995636e2 100644 --- a/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/bin/train.py +++ b/TensorFlow/built-in/nlp/Transformer_ID0004_for_TensorFlow/noahnmt/bin/train.py @@ -85,7 +85,7 @@ def load_config_and_update_flags(): config_path = os.path.abspath(config_path) tf.logging.info("Loading config from %s", config_path) with tf.gfile.GFile(config_path.strip()) as config_file: - config_flags = yaml.load(config_file) + config_flags = yaml.safe_load(config_file) final_config = _deep_merge_dict(final_config, config_flags) tf.logging.info("Final Config:\n%s", yaml.dump(final_config)) -- Gitee