[FixBug] Improve exception string in tensorizer.py (#31680)
Signed-off-by: maang <maang_h@163.com> Signed-off-by: maang-h <55082429+maang-h@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent
d70249e2e9
commit
a34abc49b7
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user