Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register models using catalogue #351

Merged
merged 3 commits into from
Oct 5, 2023
Merged

Conversation

danieldk
Copy link
Contributor

@danieldk danieldk commented Oct 5, 2023

Description

So far we have hardcoded the available encoders/decoders/causal LMs in the auto classes. This has the downside that the auto classes only work with models that are provided by Curated Transformers.

This change adds registries for encoders/decoders/causal LMs. The auto classes query the relevant registry and check which registered model supports the downloaded model (through the hf_model_types method of the FromHFHub mixin). This makes it possible to register external models with Curated Transformers, so that they can also be used with the auto classes.

Adding registries for tokenizers and generators is deferred to future PRs.

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.

So far we have hardcoded the available encoders/decoders/causal LMs in
the auto classes. This has the downside that the auto classes only work
with models that are provided by Curated Transformers.

This change adds registries for encoders/decoders/causal LMs. The auto
classes query the relevant registry and check which registered model
supports the downloaded model (through the `hf_model_types` method of
the `FromHFHub` mixin). This makes it possible to register external
models with Curated Transformers, so that they can also be used with the
auto classes.

Adding registries for tokenizers and generators is deferred to future
PRs.
@danieldk danieldk added type/feature Type: Feature feat/model Feature: models labels Oct 5, 2023
curated_transformers/models/auto_model.py Outdated Show resolved Hide resolved
docs/source/registries.rst Show resolved Hide resolved
docs/source/registries.rst Outdated Show resolved Hide resolved
@danieldk danieldk merged commit 7f9ff97 into explosion:main Oct 5, 2023
7 checks passed
@danieldk danieldk deleted the feature/catalogue branch October 5, 2023 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/model Feature: models type/feature Type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants