Unverified Commit a34abc49 authored by maang's avatar maang Committed by GitHub
Browse files

[FixBug] Improve exception string in `tensorizer.py` (#31680)


Signed-off-by: default avatarmaang <maang_h@163.com>
Signed-off-by: default avatarmaang-h <55082429+maang-h@users.noreply.github.com>
Co-authored-by: default avatargemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent d70249e2
...@@ -764,7 +764,10 @@ def tensorize_lora_adapter(lora_path: str, tensorizer_config: TensorizerConfig): ...@@ -764,7 +764,10 @@ def tensorize_lora_adapter(lora_path: str, tensorizer_config: TensorizerConfig):
elif tensor_path.endswith(".bin"): elif tensor_path.endswith(".bin"):
tensors = torch.load(tensor_path, weights_only=True) tensors = torch.load(tensor_path, weights_only=True)
else: else:
raise ValueError("Unsupported file: %s", tensor_path) raise ValueError(
f"Unsupported adapter model file: {tensor_path}. "
f"Must be a .safetensors or .bin file."
)
with open(config_path) as f: with open(config_path) as f:
config = json.load(f) config = json.load(f)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment