[Bugfix] Fix handling of Tensorizer arguments for LoadConfig (#20643)

Signed-off-by: Sanger Steel <sangersteel@gmail.com>
This commit is contained in:
Sanger Steel
2025-07-09 15:36:37 +00:00
committed by GitHub
parent efe73d0575
commit 4ac9c33f78
4 changed files with 21 additions and 52 deletions
@@ -223,9 +223,11 @@ class TensorizerConfig(MutableMapping):
and re.search(r'%0\dd', self.tensorizer_uri) is not None
if self.tensorizer_dir and self.tensorizer_uri:
raise ValueError(
"Either tensorizer_dir or tensorizer_uri must be provided, "
"not both.")
logger.warning_once(
"Provided both tensorizer_dir and tensorizer_uri. "
"Inferring tensorizer_dir from tensorizer_uri as the "
"latter takes precedence.")
self.tensorizer_dir = os.path.dirname(self.tensorizer_uri)
if self.tensorizer_dir and self.lora_dir:
raise ValueError(
"Only one of tensorizer_dir or lora_dir may be specified. "