From c96dcd094ac2e7082a8cb0151396bb48be57f8ff Mon Sep 17 00:00:00 2001 From: JingyaHuang Date: Fri, 13 Dec 2024 17:13:11 +0000 Subject: [PATCH] cleaned --- optimum/exporters/neuron/convert.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/optimum/exporters/neuron/convert.py b/optimum/exporters/neuron/convert.py index fdd085cce..b9b1a79c5 100644 --- a/optimum/exporters/neuron/convert.py +++ b/optimum/exporters/neuron/convert.py @@ -125,17 +125,17 @@ def validate_models_outputs( else output_dir.joinpath(model_name + ".neuron") ) neuron_paths.append(neuron_model_path) - # try: - logger.info(f"Validating {model_name} model...") - validate_model_outputs( - config=sub_neuron_config, - reference_model=ref_submodel, - neuron_model_path=neuron_model_path, - neuron_named_outputs=neuron_named_outputs[model_name], - atol=atol, - ) - # except Exception as e: - # exceptions.append(f"Validation of {model_name} fails: {e}") + try: + logger.info(f"Validating {model_name} model...") + validate_model_outputs( + config=sub_neuron_config, + reference_model=ref_submodel, + neuron_model_path=neuron_model_path, + neuron_named_outputs=neuron_named_outputs[model_name], + atol=atol, + ) + except Exception as e: + exceptions.append(f"Validation of {model_name} fails: {e}") if len(exceptions) != 0: for i, exception in enumerate(exceptions[:-1]): @@ -352,8 +352,6 @@ def export_models( total_compilation_time = 0 compile_configs = {} for i, model_name in enumerate(models_and_neuron_configs.keys()): - # if model_name in ["text_encoder", "transformer", "vae_encoder"]: - # continue logger.info(f"***** Compiling {model_name} *****") submodel, sub_neuron_config = models_and_neuron_configs[model_name] output_file_name = (