diff --git a/curated_transformers/generation/auto_generator.py b/curated_transformers/generation/auto_generator.py index d6277015..36e6df3e 100644 --- a/curated_transformers/generation/auto_generator.py +++ b/curated_transformers/generation/auto_generator.py @@ -34,14 +34,14 @@ class AutoGenerator(AutoModel[GeneratorWrapper]): """ @classmethod - def download_to_cache( + def from_hf_hub_to_cache( cls, *, name: str, revision: str = "main", ): generator_cls = _resolve_generator_class(name) - generator_cls.download_to_cache(name=name, revision=revision) + generator_cls.from_hf_hub_to_cache(name=name, revision=revision) @classmethod def from_hf_hub( diff --git a/curated_transformers/generation/default_generator.py b/curated_transformers/generation/default_generator.py index 299e7da1..16d6c9b6 100644 --- a/curated_transformers/generation/default_generator.py +++ b/curated_transformers/generation/default_generator.py @@ -59,14 +59,14 @@ def __init__( ) @classmethod - def download_to_cache( + def from_hf_hub_to_cache( cls: Type[Self], *, name: str, revision: str = "main", ): - AutoTokenizer.download_to_cache(name=name, revision=revision) - AutoCausalLM.download_to_cache(name=name, revision=revision) + AutoTokenizer.from_hf_hub_to_cache(name=name, revision=revision) + AutoCausalLM.from_hf_hub_to_cache(name=name, revision=revision) @classmethod def from_hf_hub( diff --git a/curated_transformers/generation/hf_hub.py b/curated_transformers/generation/hf_hub.py index ba6f3be1..dbb7b363 100644 --- a/curated_transformers/generation/hf_hub.py +++ b/curated_transformers/generation/hf_hub.py @@ -19,7 +19,7 @@ class FromHFHub(ABC): @classmethod @abstractmethod - def download_to_cache( + def from_hf_hub_to_cache( cls: Type[Self], *, name: str, diff --git a/curated_transformers/models/auto_model.py b/curated_transformers/models/auto_model.py index d6e7530e..4ba24234 100644 --- a/curated_transformers/models/auto_model.py +++ b/curated_transformers/models/auto_model.py @@ -90,7 +90,7 @@ def from_hf_hub( raise NotImplementedError @classmethod - def download_to_cache( + def from_hf_hub_to_cache( cls, *, name: str, @@ -108,7 +108,7 @@ def download_to_cache( Model revision. """ module_cls = cls._resolve_model_cls(name, revision) - module_cls.download_to_cache(name=name, revision=revision) + module_cls.from_hf_hub_to_cache(name=name, revision=revision) class AutoEncoder(AutoModel[EncoderModule]): diff --git a/curated_transformers/models/hf_hub.py b/curated_transformers/models/hf_hub.py index 9413b802..b632db78 100644 --- a/curated_transformers/models/hf_hub.py +++ b/curated_transformers/models/hf_hub.py @@ -72,7 +72,7 @@ def from_hf_config( raise NotImplementedError @classmethod - def download_to_cache( + def from_hf_hub_to_cache( cls: Type[Self], *, name: str, diff --git a/curated_transformers/tests/models/test_hf_hub.py b/curated_transformers/tests/models/test_hf_hub.py index 29519761..b5633d93 100644 --- a/curated_transformers/tests/models/test_hf_hub.py +++ b/curated_transformers/tests/models/test_hf_hub.py @@ -23,8 +23,8 @@ def test_sharded_model_checkpoints(torch_device): ) -def test_download_to_cache(): - BERTEncoder.download_to_cache( +def test_from_hf_hub_to_cache(): + BERTEncoder.from_hf_hub_to_cache( name="explosion-testing/bert-test-caching", revision="96a29a07d0fa4c24fd2675521add643e3c2581fc", ) diff --git a/curated_transformers/tests/tokenizers/test_hf_hub.py b/curated_transformers/tests/tokenizers/test_hf_hub.py index d36fbdb2..e1fcf8c1 100644 --- a/curated_transformers/tests/tokenizers/test_hf_hub.py +++ b/curated_transformers/tests/tokenizers/test_hf_hub.py @@ -4,8 +4,8 @@ from curated_transformers.tokenizers.legacy import BERTTokenizer -def test_download_to_cache(): - Tokenizer.download_to_cache( +def test_from_hf_hub_to_cache(): + Tokenizer.from_hf_hub_to_cache( name="EleutherAI/gpt-neox-20b", revision="9369f145ca7b66ef62760f9351af951b2d53b77f", ) @@ -26,8 +26,8 @@ def test_download_to_cache(): ) -def test_download_to_cache_legacy(): - BERTTokenizer.download_to_cache( +def test_from_hf_hub_to_cache_legacy(): + BERTTokenizer.from_hf_hub_to_cache( name="bert-base-uncased", revision="1dbc166cf8765166998eff31ade2eb64c8a40076", ) diff --git a/curated_transformers/tokenizers/auto_tokenizer.py b/curated_transformers/tokenizers/auto_tokenizer.py index 81a6cc90..e4496055 100644 --- a/curated_transformers/tokenizers/auto_tokenizer.py +++ b/curated_transformers/tokenizers/auto_tokenizer.py @@ -42,7 +42,7 @@ class AutoTokenizer: # requires that the return type is Self. @classmethod - def download_to_cache( + def from_hf_hub_to_cache( cls, *, name: str, @@ -60,7 +60,7 @@ def download_to_cache( Model revision. """ tokenizer_cls = _resolve_tokenizer_class(name, revision) - tokenizer_cls.download_to_cache(name=name, revision=revision) + tokenizer_cls.from_hf_hub_to_cache(name=name, revision=revision) @classmethod def from_hf_hub(cls, *, name: str, revision: str = "main") -> TokenizerBase: diff --git a/curated_transformers/tokenizers/hf_hub.py b/curated_transformers/tokenizers/hf_hub.py index 3547d8d9..a628062b 100644 --- a/curated_transformers/tokenizers/hf_hub.py +++ b/curated_transformers/tokenizers/hf_hub.py @@ -19,7 +19,7 @@ class FromHFHub(ABC): @classmethod @abstractmethod - def download_to_cache( + def from_hf_hub_to_cache( cls: Type[SelfFromHFHub], *, name: str, @@ -94,7 +94,7 @@ def _load_from_vocab_files( raise NotImplementedError @classmethod - def download_to_cache( + def from_hf_hub_to_cache( cls: Type[SelfLegacyFromHFHub], *, name: str, diff --git a/curated_transformers/tokenizers/tokenizer.py b/curated_transformers/tokenizers/tokenizer.py index 064599f2..85dc6395 100644 --- a/curated_transformers/tokenizers/tokenizer.py +++ b/curated_transformers/tokenizers/tokenizer.py @@ -338,7 +338,7 @@ def from_dir(cls: Type[Self], path: Path) -> Self: ) @classmethod - def download_to_cache( + def from_hf_hub_to_cache( cls: Type[Self], *, name: str,