Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
011b15c1
Unverified
Commit
011b15c1
authored
Nov 03, 2023
by
Maria Khalusova
Committed by
GitHub
Nov 03, 2023
Browse files
[docs] Custom model doc update (#27213)
doc update
parent
af8d1dc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
docs/source/en/custom_models.md
docs/source/en/custom_models.md
+16
-0
No files found.
docs/source/en/custom_models.md
View file @
011b15c1
...
...
@@ -272,6 +272,22 @@ Note that there is no need to specify an auto class for the configuration (there
[
`AutoConfig`
]) but it's different for models. Your custom model could be suitable for many different tasks, so you
have to specify which one of the auto classes is the correct one for your model.
<Tip>
Use
`register_for_auto_class()`
if you want the code files to be copied. If you instead prefer to use code on the Hub from another repo,
you don't need to call it. In cases where there's more than one auto class, you can modify the
`config.json`
directly using the
following structure:
```
"auto_map": {
"AutoConfig": "<your-repo-name>--<config-name>",
"AutoModel": "<your-repo-name>--<config-name>",
"AutoModelFor<Task>": "<your-repo-name>--<config-name>",
},
```
</Tip>
Next, let's create the config and models as we did before:
```
py
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment