Skip to content

Commit 4bfb4a6

Browse files
committed
feat: enhance AutoConfig to support path-based model configuration
1 parent 9fa55b8 commit 4bfb4a6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cccv/auto/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AutoConfig:
1212
@staticmethod
1313
def from_pretrained(
1414
pretrained_model_name_or_path: Union[ConfigType, str, Path],
15+
*,
1516
model_dir: Optional[Union[Path, str]] = None,
1617
**kwargs: Any,
1718
) -> Any:

cccv/auto/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def from_pretrained(
4040
:param gh_proxy: The proxy for downloading from github release. Example: https://github.abskoop.workers.dev/
4141
:return:
4242
"""
43-
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
43+
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, model_dir=model_dir, **kwargs)
4444

4545
return AutoModel.from_config(
4646
config=config,

0 commit comments

Comments
 (0)