From cc6da4524fc17c354cbd61b4138d9a6cb2b6b4ca Mon Sep 17 00:00:00 2001 From: Max de Bayser Date: Wed, 6 Nov 2024 06:09:45 -0300 Subject: [PATCH] add changes required by linter Signed-off-by: Max de Bayser --- examples/fp8/quantizer/quantize.py | 4 ++-- vllm/transformers_utils/config.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/fp8/quantizer/quantize.py b/examples/fp8/quantizer/quantize.py index 15f1a06b1219b..d75cc8b3d1cf7 100644 --- a/examples/fp8/quantizer/quantize.py +++ b/examples/fp8/quantizer/quantize.py @@ -230,7 +230,7 @@ def calibrate_loop(): def main(args): if not torch.cuda.is_available(): - raise EnvironmentError("GPU is required for inference.") + raise OSError("GPU is required for inference.") random.seed(RAND_SEED) np.random.seed(RAND_SEED) @@ -314,7 +314,7 @@ def main(args): # Workaround for wo quantization if args.qformat in ["int8_wo", "int4_wo", "full_prec"]: - with open(f"{export_path}/config.json", 'r') as f: + with open(f"{export_path}/config.json") as f: tensorrt_llm_config = json.load(f) if args.qformat == "int8_wo": tensorrt_llm_config["quantization"]["quant_algo"] = 'W8A16' diff --git a/vllm/transformers_utils/config.py b/vllm/transformers_utils/config.py index 5f7863b6fe940..6b371343fe714 100644 --- a/vllm/transformers_utils/config.py +++ b/vllm/transformers_utils/config.py @@ -274,7 +274,7 @@ def get_hf_file_to_dict(file_name: str, return None file_path = Path(hf_hub_file) - with open(file_path, "r") as file: + with open(file_path) as file: return json.load(file) return None