The new impl for CONFIG_MAPPING prevents users from adding any custom models
See original GitHub issueEnvironment info
transformers
version: 4.10+- Platform: Ubuntu 18.04
- Python version: 3.7.11
- PyTorch version (GPU?): N/A
- Tensorflow version (GPU?): N/A
- Using GPU in script?: N/A
- Using distributed or parallel set-up in script?: No.
Who can help
Information
Model I am using (Bert, XLNet …): Custom model
The problem arises when using:
- the official example scripts: (give details below)
- my own modified scripts: (give details below)
The tasks I am working on is:
- an official GLUE/SQUaD task: (give the name)
- my own task or dataset: (give details below)
To reproduce
This was changed from the design in version 4.9
which used an OrderedDict
instead of the new _LazyConfigMapping
. The current design makes it so users cannot add their own custom models by assigning names and classes to the following registries (example: classification tasks):
CONFIG_MAPPING
intransformers.models.auto.configuration_auto
, andMODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
intransformers.models.auto.modeling_auto
.
Expected behavior
Either a mechanism to add custom Config
s (and the corresponding models) with documentation for it, or documentation for whatever other recommended method. Possibly that already exists, but I haven’t found it yet.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Arc: Regression issue when mapping @ConfigMapping using ...
Describe the bug This issue affects all users that provide a custom config source (org.eclipse.microprofile.config.spi.ConfigSource).
Read more >Mapping configuration to objects - Quarkus
A config mapping requires an interface with minimal metadata configuration and annotated with the @io.smallrye.config.ConfigMapping annotation. ... The Server ...
Read more >Core Features - Spring
This section dives into the details of Spring Boot. Here you can learn about the key features that you may want to use...
Read more >Custom Resources - Kubernetes
Custom resources are extensions of the Kubernetes API. This page discusses when to add a custom resource to your Kubernetes cluster and when ......
Read more >SOLID Design Principles Explained: The Open/Closed ...
All 5 SOLID design principles are broadly used, If you don't know them by name, you will quickly recognize that they describe the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @aleSuglia, @sgugger is working on that API here: https://github.com/huggingface/transformers/pull/13989
It should land in the next few days.
@sgugger @LysandreJik any updates on this? Thanks!