diff --git a/examples/text-generation/utils.py b/examples/text-generation/utils.py index 5ef9c5c858..610cad83a2 100644 --- a/examples/text-generation/utils.py +++ b/examples/text-generation/utils.py @@ -315,6 +315,9 @@ def setup_model(args, model_dtype, model_kwargs, logger): if args.torch_compile: model = get_torch_compiled_model(model, logger) + assert "PT_HPU_LAZY_MODE" in os.environ and os.environ["PT_HPU_LAZY_MODE"] == "0", ( + "Please set PT_HPU_LAZY_MODE=0 on command line when using `--torch_compile`" + ) # if args.assistant_model is not None: # assistant_model = get_torch_compiled_model(assistant_model, logger) return model, assistant_model