From 011b15c1c75a575fcaee5a50de02ff316881816a Mon Sep 17 00:00:00 2001 From: Maria Khalusova Date: Fri, 3 Nov 2023 08:03:13 -0400 Subject: [PATCH] [docs] Custom model doc update (#27213) doc update --- docs/source/en/custom_models.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/source/en/custom_models.md b/docs/source/en/custom_models.md index d709772eed0..4abc3ce5773 100644 --- a/docs/source/en/custom_models.md +++ b/docs/source/en/custom_models.md @@ -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. + + +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": "--", + "AutoModel": "--", + "AutoModelFor": "--", +}, +``` + + + Next, let's create the config and models as we did before: ```py