import{s as ua,o as da,n as x}from"../chunks/scheduler.25b97de1.js";import{S as ha,i as ba,g as c,s as r,r as d,m as js,A as ya,h as f,f as s,c as o,j as ma,u as h,x as u,n as _s,k as ca,l as ga,y as $a,a,v as b,d as y,t as g,w as $}from"../chunks/index.d9030fc9.js";import{T as st}from"../chunks/Tip.baa67368.js";import{C as Z}from"../chunks/CodeBlock.e6cd0d95.js";import{F as fa,M as Ms}from"../chunks/Markdown.7217f838.js";import{H as G,E as Ma}from"../chunks/EditOnGithub.91d95064.js";function ja(v){let n,M='You can also save your configuration file as a dictionary or even just the difference between your custom configuration attributes and the default configuration attributes! See the <a href="main_classes/configuration">configuration</a> documentation for more details.';return{c(){n=c("p"),n.innerHTML=M},l(l){n=f(l,"P",{"data-svelte-h":!0}),u(n)!=="svelte-4asqog"&&(n.innerHTML=M)},m(l,p){a(l,n,p)},p:x,d(l){l&&s(n)}}}function _a(v){let n,M="Load your custom configuration attributes into the model:",l,p,j,_,R="This creates a model with random values instead of pretrained weights. You won’t be able to use this model for anything useful yet until you train it. Training is a costly and time-consuming process. It is generally better to use a pretrained model to obtain better results faster, while using only a fraction of the resources required for training.",W,k,J='Create a pretrained model with <a href="/docs/transformers/pr_29693/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a>:',m,w,V,U,F="When you load pretrained weights, the default model configuration is automatically loaded if the model is provided by 🤗 Transformers. However, you can still replace - some or all of - the default model configuration attributes with your own if you’d like:",z,C,q;return p=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRNb2RlbCUwQSUwQW15X2NvbmZpZyUyMCUzRCUyMERpc3RpbEJlcnRDb25maWcuZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZ5b3VyX21vZGVsX3NhdmVfcGF0aCUyRmNvbmZpZy5qc29uJTIyKSUwQW1vZGVsJTIwJTNEJTIwRGlzdGlsQmVydE1vZGVsKG15X2NvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;./your_model_save_path/config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel(my_config)`,wrap:!1}}),w=new Z({props:{code:"bW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQlMkZkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)',wrap:!1}}),C=new Z({props:{code:"bW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQlMkZkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMiUyQyUyMGNvbmZpZyUzRG15X2NvbmZpZyk=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>, config=my_config)',wrap:!1}}),{c(){n=c("p"),n.textContent=M,l=r(),d(p.$$.fragment),j=r(),_=c("p"),_.textContent=R,W=r(),k=c("p"),k.innerHTML=J,m=r(),d(w.$$.fragment),V=r(),U=c("p"),U.textContent=F,z=r(),d(C.$$.fragment)},l(i){n=f(i,"P",{"data-svelte-h":!0}),u(n)!=="svelte-16yp9sj"&&(n.textContent=M),l=o(i),h(p.$$.fragment,i),j=o(i),_=f(i,"P",{"data-svelte-h":!0}),u(_)!=="svelte-17byrht"&&(_.textContent=R),W=o(i),k=f(i,"P",{"data-svelte-h":!0}),u(k)!=="svelte-bukn0n"&&(k.innerHTML=J),m=o(i),h(w.$$.fragment,i),V=o(i),U=f(i,"P",{"data-svelte-h":!0}),u(U)!=="svelte-1dfgiok"&&(U.textContent=F),z=o(i),h(C.$$.fragment,i)},m(i,T){a(i,n,T),a(i,l,T),b(p,i,T),a(i,j,T),a(i,_,T),a(i,W,T),a(i,k,T),a(i,m,T),b(w,i,T),a(i,V,T),a(i,U,T),a(i,z,T),b(C,i,T),q=!0},p:x,i(i){q||(y(p.$$.fragment,i),y(w.$$.fragment,i),y(C.$$.fragment,i),q=!0)},o(i){g(p.$$.fragment,i),g(w.$$.fragment,i),g(C.$$.fragment,i),q=!1},d(i){i&&(s(n),s(l),s(j),s(_),s(W),s(k),s(m),s(V),s(U),s(z)),$(p,i),$(w,i),$(C,i)}}}function ka(v){let n,M;return n=new Ms({props:{$$slots:{default:[_a]},$$scope:{ctx:v}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){b(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(y(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function wa(v){let n,M="Load your custom configuration attributes into the model:",l,p,j,_,R="This creates a model with random values instead of pretrained weights. You won’t be able to use this model for anything useful yet until you train it. Training is a costly and time-consuming process. It is generally better to use a pretrained model to obtain better results faster, while using only a fraction of the resources required for training.",W,k,J='Create a pretrained model with <a href="/docs/transformers/pr_29693/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a>:',m,w,V,U,F="When you load pretrained weights, the default model configuration is automatically loaded if the model is provided by 🤗 Transformers. However, you can still replace - some or all of - the default model configuration attributes with your own if you’d like:",z,C,q;return p=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydE1vZGVsJTBBJTBBbXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnlvdXJfbW9kZWxfc2F2ZV9wYXRoJTJGbXlfY29uZmlnLmpzb24lMjIpJTBBdGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbChteV9jb25maWcp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDistilBertModel

<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;./your_model_save_path/my_config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel(my_config)`,wrap:!1}}),w=new Z({props:{code:"dGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)',wrap:!1}}),C=new Z({props:{code:"dGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyJTJDJTIwY29uZmlnJTNEbXlfY29uZmlnKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>, config=my_config)',wrap:!1}}),{c(){n=c("p"),n.textContent=M,l=r(),d(p.$$.fragment),j=r(),_=c("p"),_.textContent=R,W=r(),k=c("p"),k.innerHTML=J,m=r(),d(w.$$.fragment),V=r(),U=c("p"),U.textContent=F,z=r(),d(C.$$.fragment)},l(i){n=f(i,"P",{"data-svelte-h":!0}),u(n)!=="svelte-16yp9sj"&&(n.textContent=M),l=o(i),h(p.$$.fragment,i),j=o(i),_=f(i,"P",{"data-svelte-h":!0}),u(_)!=="svelte-17byrht"&&(_.textContent=R),W=o(i),k=f(i,"P",{"data-svelte-h":!0}),u(k)!=="svelte-pyvi85"&&(k.innerHTML=J),m=o(i),h(w.$$.fragment,i),V=o(i),U=f(i,"P",{"data-svelte-h":!0}),u(U)!=="svelte-1dfgiok"&&(U.textContent=F),z=o(i),h(C.$$.fragment,i)},m(i,T){a(i,n,T),a(i,l,T),b(p,i,T),a(i,j,T),a(i,_,T),a(i,W,T),a(i,k,T),a(i,m,T),b(w,i,T),a(i,V,T),a(i,U,T),a(i,z,T),b(C,i,T),q=!0},p:x,i(i){q||(y(p.$$.fragment,i),y(w.$$.fragment,i),y(C.$$.fragment,i),q=!0)},o(i){g(p.$$.fragment,i),g(w.$$.fragment,i),g(C.$$.fragment,i),q=!1},d(i){i&&(s(n),s(l),s(j),s(_),s(W),s(k),s(m),s(V),s(U),s(z)),$(p,i),$(w,i),$(C,i)}}}function Ta(v){let n,M;return n=new Ms({props:{$$slots:{default:[wa]},$$scope:{ctx:v}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){b(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(y(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function Za(v){let n,M='For example, <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.DistilBertForSequenceClassification">DistilBertForSequenceClassification</a> is a base DistilBERT model with a sequence classification head. The sequence classification head is a linear layer on top of the pooled outputs.',l,p,j,_,R='Easily reuse this checkpoint for another task by switching to a different model head. For a question answering task, you would use the <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.DistilBertForQuestionAnswering">DistilBertForQuestionAnswering</a> model head. The question answering head is similar to the sequence classification head except it is a linear layer on top of the hidden states output.',W,k,J;return p=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),k=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQSUwQW1vZGVsJTIwJTNEJTIwRGlzdGlsQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0JTJGZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),{c(){n=c("p"),n.innerHTML=M,l=r(),d(p.$$.fragment),j=r(),_=c("p"),_.innerHTML=R,W=r(),d(k.$$.fragment)},l(m){n=f(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-160u2cy"&&(n.innerHTML=M),l=o(m),h(p.$$.fragment,m),j=o(m),_=f(m,"P",{"data-svelte-h":!0}),u(_)!=="svelte-11vp2xe"&&(_.innerHTML=R),W=o(m),h(k.$$.fragment,m)},m(m,w){a(m,n,w),a(m,l,w),b(p,m,w),a(m,j,w),a(m,_,w),a(m,W,w),b(k,m,w),J=!0},p:x,i(m){J||(y(p.$$.fragment,m),y(k.$$.fragment,m),J=!0)},o(m){g(p.$$.fragment,m),g(k.$$.fragment,m),J=!1},d(m){m&&(s(n),s(l),s(j),s(_),s(W)),$(p,m),$(k,m)}}}function va(v){let n,M;return n=new Ms({props:{$$slots:{default:[Za]},$$scope:{ctx:v}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){b(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(y(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function Ja(v){let n,M='For example, <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.TFDistilBertForSequenceClassification">TFDistilBertForSequenceClassification</a> is a base DistilBERT model with a sequence classification head. The sequence classification head is a linear layer on top of the pooled outputs.',l,p,j,_,R='Easily reuse this checkpoint for another task by switching to a different model head. For a question answering task, you would use the <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.TFDistilBertForQuestionAnswering">TFDistilBertForQuestionAnswering</a> model head. The question answering head is similar to the sequence classification head except it is a linear layer on top of the hidden states output.',W,k,J;return p=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0Zl9tb2RlbCUyMCUzRCUyMFRGRGlzdGlsQmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQlMkZkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDistilBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),k=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBJTBBdGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFDistilBertForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),{c(){n=c("p"),n.innerHTML=M,l=r(),d(p.$$.fragment),j=r(),_=c("p"),_.innerHTML=R,W=r(),d(k.$$.fragment)},l(m){n=f(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-33kwt6"&&(n.innerHTML=M),l=o(m),h(p.$$.fragment,m),j=o(m),_=f(m,"P",{"data-svelte-h":!0}),u(_)!=="svelte-q2o2o2"&&(_.innerHTML=R),W=o(m),h(k.$$.fragment,m)},m(m,w){a(m,n,w),a(m,l,w),b(p,m,w),a(m,j,w),a(m,_,w),a(m,W,w),b(k,m,w),J=!0},p:x,i(m){J||(y(p.$$.fragment,m),y(k.$$.fragment,m),J=!0)},o(m){g(p.$$.fragment,m),g(k.$$.fragment,m),J=!1},d(m){m&&(s(n),s(l),s(j),s(_),s(W)),$(p,m),$(k,m)}}}function Wa(v){let n,M;return n=new Ms({props:{$$slots:{default:[Ja]},$$scope:{ctx:v}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){b(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(y(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function Ua(v){let n,M='Not every model supports a fast tokenizer. Take a look at this <a href="index#supported-frameworks">table</a> to check if a model has fast tokenizer support.';return{c(){n=c("p"),n.innerHTML=M},l(l){n=f(l,"P",{"data-svelte-h":!0}),u(n)!=="svelte-18y3slz"&&(n.innerHTML=M)},m(l,p){a(l,n,p)},p:x,d(l){l&&s(n)}}}function Ca(v){let n,M='By default, <a href="/docs/transformers/pr_29693/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a> will try to load a fast tokenizer. You can disable this behavior by setting <code>use_fast=False</code> in <code>from_pretrained</code>.';return{c(){n=c("p"),n.innerHTML=M},l(l){n=f(l,"P",{"data-svelte-h":!0}),u(n)!=="svelte-tjnsn9"&&(n.innerHTML=M)},m(l,p){a(l,n,p)},p:x,d(l){l&&s(n)}}}function Ra(v){let n,M="If you aren’t looking for any customization, just use the <code>from_pretrained</code> method to load a model’s default image processor parameters.";return{c(){n=c("p"),n.innerHTML=M},l(l){n=f(l,"P",{"data-svelte-h":!0}),u(n)!=="svelte-10var38"&&(n.innerHTML=M)},m(l,p){a(l,n,p)},p:x,d(l){l&&s(n)}}}function Va(v){let n,M="If you aren’t looking for any customization, just use the <code>from_pretrained</code> method to load a model’s default feature extractor parameters.";return{c(){n=c("p"),n.innerHTML=M},l(l){n=f(l,"P",{"data-svelte-h":!0}),u(n)!=="svelte-1e7p61z"&&(n.innerHTML=M)},m(l,p){a(l,n,p)},p:x,d(l){l&&s(n)}}}function qa(v){let n,M,l,p,j,_,R,W='An <a href="model_doc/auto"><code>AutoClass</code></a> automatically infers the model architecture and downloads pretrained configuration and weights. Generally, we recommend using an <code>AutoClass</code> to produce checkpoint-agnostic code. But users who want more control over specific model parameters can create a custom 🤗 Transformers model from just a few base classes. This could be particularly useful for anyone who is interested in studying, training or experimenting with a 🤗 Transformers model. In this guide, dive deeper into creating a custom model without an <code>AutoClass</code>. Learn how to:',k,J,m="<li>Load and customize a model configuration.</li> <li>Create a model architecture.</li> <li>Create a slow and fast tokenizer for text.</li> <li>Create an image processor for vision tasks.</li> <li>Create a feature extractor for audio tasks.</li> <li>Create a processor for multimodal tasks.</li>",w,V,U,F,z='A <a href="main_classes/configuration">configuration</a> refers to a model’s specific attributes. Each model configuration has different attributes; for instance, all NLP models have the <code>hidden_size</code>, <code>num_attention_heads</code>, <code>num_hidden_layers</code> and <code>vocab_size</code> attributes in common. These attributes specify the number of attention heads or hidden layers to construct a model with.',C,q,i='Get a closer look at <a href="model_doc/distilbert">DistilBERT</a> by accessing <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.DistilBertConfig">DistilBertConfig</a> to inspect it’s attributes:',T,L,at,S,ks='<a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.DistilBertConfig">DistilBertConfig</a> displays all the default attributes used to build a base <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.DistilBertModel">DistilBertModel</a>. All attributes are customizable, creating space for experimentation. For example, you can customize a default model to:',nt,P,ws="<li>Try a different activation function with the <code>activation</code> parameter.</li> <li>Use a higher dropout ratio for the attention probabilities with the <code>attention_dropout</code> parameter.</li>",lt,D,rt,A,Ts='Pretrained model attributes can be modified in the <a href="/docs/transformers/pr_29693/en/main_classes/configuration#transformers.PretrainedConfig.from_pretrained">from_pretrained()</a> function:',ot,K,it,O,Zs='Once you are satisfied with your model configuration, you can save it with <a href="/docs/transformers/pr_29693/en/main_classes/configuration#transformers.PretrainedConfig.save_pretrained">save_pretrained()</a>. Your configuration file is stored as a JSON file in the specified save directory:',pt,ee,mt,te,vs='To reuse the configuration file, load it with <a href="/docs/transformers/pr_29693/en/main_classes/configuration#transformers.PretrainedConfig.from_pretrained">from_pretrained()</a>:',ct,se,ft,Y,ut,ae,dt,ne,Js='The next step is to create a <a href="main_classes/models">model</a>. The model - also loosely referred to as the architecture - defines what each layer is doing and what operations are happening. Attributes like <code>num_hidden_layers</code> from the configuration are used to define the architecture. Every model shares the base class <a href="/docs/transformers/pr_29693/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> and a few common methods like resizing input embeddings and pruning self-attention heads. In addition, all models are also either a <a href="https://pytorch.org/docs/stable/generated/torch.nn.Module.html" rel="nofollow"><code>torch.nn.Module</code></a>, <a href="https://www.tensorflow.org/api_docs/python/tf/keras/Model" rel="nofollow"><code>tf.keras.Model</code></a> or <a href="https://flax.readthedocs.io/en/latest/api_reference/flax.linen/module.html" rel="nofollow"><code>flax.linen.Module</code></a> subclass. This means models are compatible with each of their respective framework’s usage.',ht,B,bt,le,yt,re,Ws="At this point, you have a base DistilBERT model which outputs the <em>hidden states</em>. The hidden states are passed as inputs to a model head to produce the final output. 🤗 Transformers provides a different model head for each task as long as a model supports the task (i.e., you can’t use DistilBERT for a sequence-to-sequence task like translation).",gt,X,$t,oe,Mt,ie,Us='The last base class you need before using a model for textual data is a <a href="main_classes/tokenizer">tokenizer</a> to convert raw text to tensors. There are two types of tokenizers you can use with 🤗 Transformers:',jt,pe,Cs='<li><a href="/docs/transformers/pr_29693/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>: a Python implementation of a tokenizer.</li> <li><a href="/docs/transformers/pr_29693/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>: a tokenizer from our Rust-based <a href="https://huggingface.co/docs/tokenizers/python/latest/" rel="nofollow">🤗 Tokenizer</a> library. This tokenizer type is significantly faster - especially during batch tokenization - due to its Rust implementation. The fast tokenizer also offers additional methods like <em>offset mapping</em> which maps tokens to their original words or characters.</li>',_t,me,Rs="Both tokenizers support common methods such as encoding and decoding, adding new tokens, and managing special tokens.",kt,N,wt,ce,Vs="If you trained your own tokenizer, you can create one from your <em>vocabulary</em> file:",Tt,fe,Zt,ue,qs='It is important to remember the vocabulary from a custom tokenizer will be different from the vocabulary generated by a pretrained model’s tokenizer. You need to use a pretrained model’s vocabulary if you are using a pretrained model, otherwise the inputs won’t make sense. Create a tokenizer with a pretrained model’s vocabulary with the <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.DistilBertTokenizer">DistilBertTokenizer</a> class:',vt,de,Jt,he,Fs='Create a fast tokenizer with the <a href="/docs/transformers/pr_29693/en/model_doc/distilbert#transformers.DistilBertTokenizerFast">DistilBertTokenizerFast</a> class:',Wt,be,Ut,H,Ct,ye,Rt,ge,zs='An image processor processes vision inputs. It inherits from the base <a href="/docs/transformers/pr_29693/en/main_classes/image_processor#transformers.ImageProcessingMixin">ImageProcessingMixin</a> class.',Vt,$e,Gs='To use, create an image processor associated with the model you’re using. For example, create a default <a href="/docs/transformers/pr_29693/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> if you are using <a href="model_doc/vit">ViT</a> for image classification:',qt,Me,Ft,E,zt,je,xs='Modify any of the <a href="/docs/transformers/pr_29693/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> parameters to create your custom image processor:',Gt,_e,xt,ke,Yt,I,Ys='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/Backbone.png"/>',Bt,we,Bs="Computer vision models consist of a backbone, neck, and head. The backbone extracts features from an input image, the neck combines and enhances the extracted features, and the head is used for the main task (e.g., object detection). Start by initializing a backbone in the model config and specify whether you want to load pretrained weights or load randomly initialized weights. Then you can pass the model config to the model head.",Xt,Te,Xs='For example, to load a <a href="../model_doc/resnet">ResNet</a> backbone into a <a href="../model_doc/maskformer">MaskFormer</a> model with an instance segmentation head:',Nt,Ze,Ns="Set <code>use_pretrained_backbone=True</code> to load pretrained ResNet weights for the backbone.",Ht,ve,Et,Je,Hs="Set <code>use_pretrained_backbone=False</code> to randomly initialize a ResNet backbone.",It,We,Qt,Ue,Es="You could also load the backbone config separately and then pass it to the model config.",Lt,Ce,St,Re,Is='<a href="https://hf.co/docs/timm/index" rel="nofollow">timm</a> models are loaded within a model with <code>use_timm_backbone=True</code> or with <a href="/docs/transformers/pr_29693/en/main_classes/backbones#transformers.TimmBackbone">TimmBackbone</a> and <a href="/docs/transformers/pr_29693/en/main_classes/backbones#transformers.TimmBackboneConfig">TimmBackboneConfig</a>.',Pt,Ve,Qs="Use <code>use_timm_backbone=True</code> and <code>use_pretrained_backbone=True</code> to load pretrained timm weights for the backbone.",Dt,qe,At,Fe,Ls="Set <code>use_timm_backbone=True</code> and <code>use_pretrained_backbone=False</code> to load a randomly initialized timm backbone.",Kt,ze,Ot,Ge,Ss="You could also load the backbone config and use it to create a <code>TimmBackbone</code> or pass it to the model config. Timm backbones will load pretrained weights by default. Set <code>use_pretrained_backbone=False</code> to load randomly initialized weights.",es,xe,ts,Ye,ss,Be,Ps='A feature extractor processes audio inputs. It inherits from the base <a href="/docs/transformers/pr_29693/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin">FeatureExtractionMixin</a> class, and may also inherit from the <a href="/docs/transformers/pr_29693/en/main_classes/feature_extractor#transformers.SequenceFeatureExtractor">SequenceFeatureExtractor</a> class for processing audio inputs.',as,Xe,Ds='To use, create a feature extractor associated with the model you’re using. For example, create a default <a href="/docs/transformers/pr_29693/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a> if you are using <a href="model_doc/wav2vec2">Wav2Vec2</a> for audio classification:',ns,Ne,ls,Q,rs,He,As='Modify any of the <a href="/docs/transformers/pr_29693/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a> parameters to create your custom feature extractor:',os,Ee,is,Ie,ps,Qe,Ks='For models that support multimodal tasks, 🤗 Transformers offers a processor class that conveniently wraps processing classes such as a feature extractor and a tokenizer into a single object. For example, let’s use the <a href="/docs/transformers/pr_29693/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a> for an automatic speech recognition task (ASR). ASR transcribes audio to text, so you will need a feature extractor and a tokenizer.',ms,Le,Os="Create a feature extractor to handle the audio inputs:",cs,Se,fs,Pe,ea="Create a tokenizer to handle the text inputs:",us,De,ds,Ae,ta='Combine the feature extractor and tokenizer in <a href="/docs/transformers/pr_29693/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a>:',hs,Ke,bs,Oe,sa="With two basic classes - configuration and model - and an additional preprocessing class (tokenizer, image processor, feature extractor, or processor), you can create any of the models supported by 🤗 Transformers. Each of these base classes are configurable, allowing you to use the specific attributes you want. You can easily setup a model for training or modify an existing pretrained model to fine-tune.",ys,et,gs,tt,$s;return j=new G({props:{title:"Create a custom architecture",local:"create-a-custom-architecture",headingTag:"h1"}}),V=new G({props:{title:"Configuration",local:"configuration",headingTag:"h2"}}),L=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRDb25maWclMEElMEFjb25maWclMjAlM0QlMjBEaXN0aWxCZXJ0Q29uZmlnKCklMEFwcmludChjb25maWcp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>config = DistilBertConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(config)
DistilBertConfig {
  <span class="hljs-string">&quot;activation&quot;</span>: <span class="hljs-string">&quot;gelu&quot;</span>,
  <span class="hljs-string">&quot;attention_dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;dim&quot;</span>: <span class="hljs-number">768</span>,
  <span class="hljs-string">&quot;dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;hidden_dim&quot;</span>: <span class="hljs-number">3072</span>,
  <span class="hljs-string">&quot;initializer_range&quot;</span>: <span class="hljs-number">0.02</span>,
  <span class="hljs-string">&quot;max_position_embeddings&quot;</span>: <span class="hljs-number">512</span>,
  <span class="hljs-string">&quot;model_type&quot;</span>: <span class="hljs-string">&quot;distilbert&quot;</span>,
  <span class="hljs-string">&quot;n_heads&quot;</span>: <span class="hljs-number">12</span>,
  <span class="hljs-string">&quot;n_layers&quot;</span>: <span class="hljs-number">6</span>,
  <span class="hljs-string">&quot;pad_token_id&quot;</span>: <span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;qa_dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;seq_classif_dropout&quot;</span>: <span class="hljs-number">0.2</span>,
  <span class="hljs-string">&quot;sinusoidal_pos_embds&quot;</span>: false,
  <span class="hljs-string">&quot;transformers_version&quot;</span>: <span class="hljs-string">&quot;4.16.2&quot;</span>,
  <span class="hljs-string">&quot;vocab_size&quot;</span>: <span class="hljs-number">30522</span>
}`,wrap:!1}}),D=new Z({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZyhhY3RpdmF0aW9uJTNEJTIycmVsdSUyMiUyQyUyMGF0dGVudGlvbl9kcm9wb3V0JTNEMC40KSUwQXByaW50KG15X2NvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig(activation=<span class="hljs-string">&quot;relu&quot;</span>, attention_dropout=<span class="hljs-number">0.4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(my_config)
DistilBertConfig {
  <span class="hljs-string">&quot;activation&quot;</span>: <span class="hljs-string">&quot;relu&quot;</span>,
  <span class="hljs-string">&quot;attention_dropout&quot;</span>: <span class="hljs-number">0.4</span>,
  <span class="hljs-string">&quot;dim&quot;</span>: <span class="hljs-number">768</span>,
  <span class="hljs-string">&quot;dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;hidden_dim&quot;</span>: <span class="hljs-number">3072</span>,
  <span class="hljs-string">&quot;initializer_range&quot;</span>: <span class="hljs-number">0.02</span>,
  <span class="hljs-string">&quot;max_position_embeddings&quot;</span>: <span class="hljs-number">512</span>,
  <span class="hljs-string">&quot;model_type&quot;</span>: <span class="hljs-string">&quot;distilbert&quot;</span>,
  <span class="hljs-string">&quot;n_heads&quot;</span>: <span class="hljs-number">12</span>,
  <span class="hljs-string">&quot;n_layers&quot;</span>: <span class="hljs-number">6</span>,
  <span class="hljs-string">&quot;pad_token_id&quot;</span>: <span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;qa_dropout&quot;</span>: <span class="hljs-number">0.1</span>,
  <span class="hljs-string">&quot;seq_classif_dropout&quot;</span>: <span class="hljs-number">0.2</span>,
  <span class="hljs-string">&quot;sinusoidal_pos_embds&quot;</span>: false,
  <span class="hljs-string">&quot;transformers_version&quot;</span>: <span class="hljs-string">&quot;4.16.2&quot;</span>,
  <span class="hljs-string">&quot;vocab_size&quot;</span>: <span class="hljs-number">30522</span>
}`,wrap:!1}}),K=new Z({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyJTJDJTIwYWN0aXZhdGlvbiUzRCUyMnJlbHUlMjIlMkMlMjBhdHRlbnRpb25fZHJvcG91dCUzRDAuNCk=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>, activation=<span class="hljs-string">&quot;relu&quot;</span>, attention_dropout=<span class="hljs-number">0.4</span>)',wrap:!1}}),ee=new Z({props:{code:"bXlfY29uZmlnLnNhdmVfcHJldHJhaW5lZChzYXZlX2RpcmVjdG9yeSUzRCUyMi4lMkZ5b3VyX21vZGVsX3NhdmVfcGF0aCUyMik=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>my_config.save_pretrained(save_directory=<span class="hljs-string">&quot;./your_model_save_path&quot;</span>)',wrap:!1}}),se=new Z({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnlvdXJfbW9kZWxfc2F2ZV9wYXRoJTJGY29uZmlnLmpzb24lMjIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;./your_model_save_path/config.json&quot;</span>)',wrap:!1}}),Y=new st({props:{$$slots:{default:[ja]},$$scope:{ctx:v}}}),ae=new G({props:{title:"Model",local:"model",headingTag:"h2"}}),B=new fa({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ta],pytorch:[ka]},$$scope:{ctx:v}}}),le=new G({props:{title:"Model heads",local:"model-heads",headingTag:"h3"}}),X=new fa({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Wa],pytorch:[va]},$$scope:{ctx:v}}}),oe=new G({props:{title:"Tokenizer",local:"tokenizer",headingTag:"h2"}}),N=new st({props:{warning:!0,$$slots:{default:[Ua]},$$scope:{ctx:v}}}),fe=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXIlMEElMEFteV90b2tlbml6ZXIlMjAlM0QlMjBEaXN0aWxCZXJ0VG9rZW5pemVyKHZvY2FiX2ZpbGUlM0QlMjJteV92b2NhYl9maWxlLnR4dCUyMiUyQyUyMGRvX2xvd2VyX2Nhc2UlM0RGYWxzZSUyQyUyMHBhZGRpbmdfc2lkZSUzRCUyMmxlZnQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>my_tokenizer = DistilBertTokenizer(vocab_file=<span class="hljs-string">&quot;my_vocab_file.txt&quot;</span>, do_lower_case=<span class="hljs-literal">False</span>, padding_side=<span class="hljs-string">&quot;left&quot;</span>)`,wrap:!1}}),de=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXIlMEElMEFzbG93X3Rva2VuaXplciUyMCUzRCUyMERpc3RpbEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQlMkZkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>slow_tokenizer = DistilBertTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),be=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXJGYXN0JTBBJTBBZmFzdF90b2tlbml6ZXIlMjAlM0QlMjBEaXN0aWxCZXJ0VG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DistilBertTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>fast_tokenizer = DistilBertTokenizerFast.from_pretrained(<span class="hljs-string">&quot;distilbert/distilbert-base-uncased&quot;</span>)`,wrap:!1}}),H=new st({props:{$$slots:{default:[Ca]},$$scope:{ctx:v}}}),ye=new G({props:{title:"Image processor",local:"image-processor",headingTag:"h2"}}),Me=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEltYWdlUHJvY2Vzc29yJTBBJTBBdml0X2V4dHJhY3RvciUyMCUzRCUyMFZpVEltYWdlUHJvY2Vzc29yKCklMEFwcmludCh2aXRfZXh0cmFjdG9yKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTImageProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>vit_extractor = ViTImageProcessor()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(vit_extractor)
ViTImageProcessor {
  <span class="hljs-string">&quot;do_normalize&quot;</span>: true,
  <span class="hljs-string">&quot;do_resize&quot;</span>: true,
  <span class="hljs-string">&quot;image_processor_type&quot;</span>: <span class="hljs-string">&quot;ViTImageProcessor&quot;</span>,
  <span class="hljs-string">&quot;image_mean&quot;</span>: [
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>
  ],
  <span class="hljs-string">&quot;image_std&quot;</span>: [
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>
  ],
  <span class="hljs-string">&quot;resample&quot;</span>: <span class="hljs-number">2</span>,
  <span class="hljs-string">&quot;size&quot;</span>: <span class="hljs-number">224</span>
}`,wrap:!1}}),E=new st({props:{$$slots:{default:[Ra]},$$scope:{ctx:v}}}),_e=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEltYWdlUHJvY2Vzc29yJTBBJTBBbXlfdml0X2V4dHJhY3RvciUyMCUzRCUyMFZpVEltYWdlUHJvY2Vzc29yKHJlc2FtcGxlJTNEJTIyUElMLkltYWdlLkJPWCUyMiUyQyUyMGRvX25vcm1hbGl6ZSUzREZhbHNlJTJDJTIwaW1hZ2VfbWVhbiUzRCU1QjAuMyUyQyUyMDAuMyUyQyUyMDAuMyU1RCklMEFwcmludChteV92aXRfZXh0cmFjdG9yKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTImageProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>my_vit_extractor = ViTImageProcessor(resample=<span class="hljs-string">&quot;PIL.Image.BOX&quot;</span>, do_normalize=<span class="hljs-literal">False</span>, image_mean=[<span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(my_vit_extractor)
ViTImageProcessor {
  <span class="hljs-string">&quot;do_normalize&quot;</span>: false,
  <span class="hljs-string">&quot;do_resize&quot;</span>: true,
  <span class="hljs-string">&quot;image_processor_type&quot;</span>: <span class="hljs-string">&quot;ViTImageProcessor&quot;</span>,
  <span class="hljs-string">&quot;image_mean&quot;</span>: [
    <span class="hljs-number">0.3</span>,
    <span class="hljs-number">0.3</span>,
    <span class="hljs-number">0.3</span>
  ],
  <span class="hljs-string">&quot;image_std&quot;</span>: [
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>,
    <span class="hljs-number">0.5</span>
  ],
  <span class="hljs-string">&quot;resample&quot;</span>: <span class="hljs-string">&quot;PIL.Image.BOX&quot;</span>,
  <span class="hljs-string">&quot;size&quot;</span>: <span class="hljs-number">224</span>
}`,wrap:!1}}),ke=new G({props:{title:"Backbone",local:"backbone",headingTag:"h2"}}),ve=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hc2tGb3JtZXJDb25maWclMkMlMjBNYXNrRm9ybWVyRm9ySW5zdGFuY2VTZWdtZW50YXRpb24lMEElMEFjb25maWclMjAlM0QlMjBNYXNrRm9ybWVyQ29uZmlnKGJhY2tib25lJTNEJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyJTJDJTIwdXNlX3ByZXRyYWluZWRfYmFja2JvbmUlM0RUcnVlKSUyMCUyMyUyMGJhY2tib25lJTIwYW5kJTIwbmVjayUyMGNvbmZpZyUwQW1vZGVsJTIwJTNEJTIwTWFza0Zvcm1lckZvckluc3RhbmNlU2VnbWVudGF0aW9uKGNvbmZpZyklMjAlMjMlMjBoZWFk",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerConfig, MaskFormerForInstanceSegmentation

config = MaskFormerConfig(backbone=<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>, use_pretrained_backbone=<span class="hljs-literal">True</span>) <span class="hljs-comment"># backbone and neck config</span>
model = MaskFormerForInstanceSegmentation(config) <span class="hljs-comment"># head</span>`,wrap:!1}}),We=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hc2tGb3JtZXJDb25maWclMkMlMjBNYXNrRm9ybWVyRm9ySW5zdGFuY2VTZWdtZW50YXRpb24lMEElMEFjb25maWclMjAlM0QlMjBNYXNrRm9ybWVyQ29uZmlnKGJhY2tib25lJTNEJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyJTJDJTIwdXNlX3ByZXRyYWluZWRfYmFja2JvbmUlM0RGYWxzZSklMjAlMjMlMjBiYWNrYm9uZSUyMGFuZCUyMG5lY2slMjBjb25maWclMEFtb2RlbCUyMCUzRCUyME1hc2tGb3JtZXJGb3JJbnN0YW5jZVNlZ21lbnRhdGlvbihjb25maWcpJTIwJTIzJTIwaGVhZA==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerConfig, MaskFormerForInstanceSegmentation

config = MaskFormerConfig(backbone=<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>, use_pretrained_backbone=<span class="hljs-literal">False</span>) <span class="hljs-comment"># backbone and neck config</span>
model = MaskFormerForInstanceSegmentation(config) <span class="hljs-comment"># head</span>`,wrap:!1}}),Ce=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hc2tGb3JtZXJDb25maWclMkMlMjBNYXNrRm9ybWVyRm9ySW5zdGFuY2VTZWdtZW50YXRpb24lMkMlMjBSZXNOZXRDb25maWclMEElMEFiYWNrYm9uZV9jb25maWclMjAlM0QlMjBSZXNOZXRDb25maWcoKSUwQWNvbmZpZyUyMCUzRCUyME1hc2tGb3JtZXJDb25maWcoYmFja2JvbmVfY29uZmlnJTNEYmFja2JvbmVfY29uZmlnKSUwQW1vZGVsJTIwJTNEJTIwTWFza0Zvcm1lckZvckluc3RhbmNlU2VnbWVudGF0aW9uKGNvbmZpZyk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerConfig, MaskFormerForInstanceSegmentation, ResNetConfig

backbone_config = ResNetConfig()
config = MaskFormerConfig(backbone_config=backbone_config)
model = MaskFormerForInstanceSegmentation(config)`,wrap:!1}}),qe=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hc2tGb3JtZXJDb25maWclMkMlMjBNYXNrRm9ybWVyRm9ySW5zdGFuY2VTZWdtZW50YXRpb24lMEElMEFjb25maWclMjAlM0QlMjBNYXNrRm9ybWVyQ29uZmlnKGJhY2tib25lJTNEJTIycmVzbmV0NTAlMjIlMkMlMjB1c2VfcHJldHJhaW5lZF9iYWNrYm9uZSUzRFRydWUlMkMlMjB1c2VfdGltbV9iYWNrYm9uZSUzRFRydWUpJTIwJTIzJTIwYmFja2JvbmUlMjBhbmQlMjBuZWNrJTIwY29uZmlnJTBBbW9kZWwlMjAlM0QlMjBNYXNrRm9ybWVyRm9ySW5zdGFuY2VTZWdtZW50YXRpb24oY29uZmlnKSUyMCUyMyUyMGhlYWQ=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerConfig, MaskFormerForInstanceSegmentation

config = MaskFormerConfig(backbone=<span class="hljs-string">&quot;resnet50&quot;</span>, use_pretrained_backbone=<span class="hljs-literal">True</span>, use_timm_backbone=<span class="hljs-literal">True</span>) <span class="hljs-comment"># backbone and neck config</span>
model = MaskFormerForInstanceSegmentation(config) <span class="hljs-comment"># head</span>`,wrap:!1}}),ze=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hc2tGb3JtZXJDb25maWclMkMlMjBNYXNrRm9ybWVyRm9ySW5zdGFuY2VTZWdtZW50YXRpb24lMEElMEFjb25maWclMjAlM0QlMjBNYXNrRm9ybWVyQ29uZmlnKGJhY2tib25lJTNEJTIycmVzbmV0NTAlMjIlMkMlMjB1c2VfcHJldHJhaW5lZF9iYWNrYm9uZSUzREZhbHNlJTJDJTIwdXNlX3RpbW1fYmFja2JvbmUlM0RUcnVlKSUyMCUyMyUyMGJhY2tib25lJTIwYW5kJTIwbmVjayUyMGNvbmZpZyUwQW1vZGVsJTIwJTNEJTIwTWFza0Zvcm1lckZvckluc3RhbmNlU2VnbWVudGF0aW9uKGNvbmZpZyklMjAlMjMlMjBoZWFk",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerConfig, MaskFormerForInstanceSegmentation

config = MaskFormerConfig(backbone=<span class="hljs-string">&quot;resnet50&quot;</span>, use_pretrained_backbone=<span class="hljs-literal">False</span>, use_timm_backbone=<span class="hljs-literal">True</span>) <span class="hljs-comment"># backbone and neck config</span>
model = MaskFormerForInstanceSegmentation(config) <span class="hljs-comment"># head</span>`,wrap:!1}}),xe=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRpbW1CYWNrYm9uZUNvbmZpZyUyQyUyMFRpbW1CYWNrYm9uZSUwQSUwQWJhY2tib25lX2NvbmZpZyUyMCUzRCUyMFRpbW1CYWNrYm9uZUNvbmZpZyglMjJyZXNuZXQ1MCUyMiUyQyUyMHVzZV9wcmV0cmFpbmVkX2JhY2tib25lJTNERmFsc2UpJTBBJTBBJTIzJTIwQ3JlYXRlJTIwYSUyMGJhY2tib25lJTIwY2xhc3MlMEFiYWNrYm9uZSUyMCUzRCUyMFRpbW1CYWNrYm9uZShjb25maWclM0RiYWNrYm9uZV9jb25maWcpJTBBJTBBJTIzJTIwQ3JlYXRlJTIwYSUyMG1vZGVsJTIwd2l0aCUyMGElMjB0aW1tJTIwYmFja2JvbmUlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwTWFza0Zvcm1lckNvbmZpZyUyQyUyME1hc2tGb3JtZXJGb3JJbnN0YW5jZVNlZ21lbnRhdGlvbiUwQSUwQWNvbmZpZyUyMCUzRCUyME1hc2tGb3JtZXJDb25maWcoYmFja2JvbmVfY29uZmlnJTNEYmFja2JvbmVfY29uZmlnKSUwQW1vZGVsJTIwJTNEJTIwTWFza0Zvcm1lckZvckluc3RhbmNlU2VnbWVudGF0aW9uKGNvbmZpZyk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TimmBackboneConfig, TimmBackbone

backbone_config = TimmBackboneConfig(<span class="hljs-string">&quot;resnet50&quot;</span>, use_pretrained_backbone=<span class="hljs-literal">False</span>)

<span class="hljs-comment"># Create a backbone class</span>
backbone = TimmBackbone(config=backbone_config)

<span class="hljs-comment"># Create a model with a timm backbone</span>
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MaskFormerConfig, MaskFormerForInstanceSegmentation

config = MaskFormerConfig(backbone_config=backbone_config)
model = MaskFormerForInstanceSegmentation(config)`,wrap:!1}}),Ye=new G({props:{title:"Feature extractor",local:"feature-extractor",headingTag:"h2"}}),Ne=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRmVhdHVyZUV4dHJhY3RvciUwQSUwQXcydjJfZXh0cmFjdG9yJTIwJTNEJTIwV2F2MlZlYzJGZWF0dXJlRXh0cmFjdG9yKCklMEFwcmludCh3MnYyX2V4dHJhY3Rvcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>w2v2_extractor = Wav2Vec2FeatureExtractor()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(w2v2_extractor)
Wav2Vec2FeatureExtractor {
  <span class="hljs-string">&quot;do_normalize&quot;</span>: true,
  <span class="hljs-string">&quot;feature_extractor_type&quot;</span>: <span class="hljs-string">&quot;Wav2Vec2FeatureExtractor&quot;</span>,
  <span class="hljs-string">&quot;feature_size&quot;</span>: <span class="hljs-number">1</span>,
  <span class="hljs-string">&quot;padding_side&quot;</span>: <span class="hljs-string">&quot;right&quot;</span>,
  <span class="hljs-string">&quot;padding_value&quot;</span>: <span class="hljs-number">0.0</span>,
  <span class="hljs-string">&quot;return_attention_mask&quot;</span>: false,
  <span class="hljs-string">&quot;sampling_rate&quot;</span>: <span class="hljs-number">16000</span>
}`,wrap:!1}}),Q=new st({props:{$$slots:{default:[Va]},$$scope:{ctx:v}}}),Ee=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRmVhdHVyZUV4dHJhY3RvciUwQSUwQXcydjJfZXh0cmFjdG9yJTIwJTNEJTIwV2F2MlZlYzJGZWF0dXJlRXh0cmFjdG9yKHNhbXBsaW5nX3JhdGUlM0Q4MDAwJTJDJTIwZG9fbm9ybWFsaXplJTNERmFsc2UpJTBBcHJpbnQodzJ2Ml9leHRyYWN0b3Ip",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>w2v2_extractor = Wav2Vec2FeatureExtractor(sampling_rate=<span class="hljs-number">8000</span>, do_normalize=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(w2v2_extractor)
Wav2Vec2FeatureExtractor {
  <span class="hljs-string">&quot;do_normalize&quot;</span>: false,
  <span class="hljs-string">&quot;feature_extractor_type&quot;</span>: <span class="hljs-string">&quot;Wav2Vec2FeatureExtractor&quot;</span>,
  <span class="hljs-string">&quot;feature_size&quot;</span>: <span class="hljs-number">1</span>,
  <span class="hljs-string">&quot;padding_side&quot;</span>: <span class="hljs-string">&quot;right&quot;</span>,
  <span class="hljs-string">&quot;padding_value&quot;</span>: <span class="hljs-number">0.0</span>,
  <span class="hljs-string">&quot;return_attention_mask&quot;</span>: false,
  <span class="hljs-string">&quot;sampling_rate&quot;</span>: <span class="hljs-number">8000</span>
}`,wrap:!1}}),Ie=new G({props:{title:"Processor",local:"processor",headingTag:"h2"}}),Se=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRmVhdHVyZUV4dHJhY3RvciUwQSUwQWZlYXR1cmVfZXh0cmFjdG9yJTIwJTNEJTIwV2F2MlZlYzJGZWF0dXJlRXh0cmFjdG9yKHBhZGRpbmdfdmFsdWUlM0QxLjAlMkMlMjBkb19ub3JtYWxpemUlM0RUcnVlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2FeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = Wav2Vec2FeatureExtractor(padding_value=<span class="hljs-number">1.0</span>, do_normalize=<span class="hljs-literal">True</span>)`,wrap:!1}}),De=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyQ1RDVG9rZW5pemVyJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwV2F2MlZlYzJDVENUb2tlbml6ZXIodm9jYWJfZmlsZSUzRCUyMm15X3ZvY2FiX2ZpbGUudHh0JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2CTCTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Wav2Vec2CTCTokenizer(vocab_file=<span class="hljs-string">&quot;my_vocab_file.txt&quot;</span>)`,wrap:!1}}),Ke=new Z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyUHJvY2Vzc29yJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwV2F2MlZlYzJQcm9jZXNzb3IoZmVhdHVyZV9leHRyYWN0b3IlM0RmZWF0dXJlX2V4dHJhY3RvciUyQyUyMHRva2VuaXplciUzRHRva2VuaXplcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2Processor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Wav2Vec2Processor(feature_extractor=feature_extractor, tokenizer=tokenizer)`,wrap:!1}}),et=new Ma({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/create_a_model.md"}}),{c(){n=c("meta"),M=r(),l=c("p"),p=r(),d(j.$$.fragment),_=r(),R=c("p"),R.innerHTML=W,k=r(),J=c("ul"),J.innerHTML=m,w=r(),d(V.$$.fragment),U=r(),F=c("p"),F.innerHTML=z,C=r(),q=c("p"),q.innerHTML=i,T=r(),d(L.$$.fragment),at=r(),S=c("p"),S.innerHTML=ks,nt=r(),P=c("ul"),P.innerHTML=ws,lt=r(),d(D.$$.fragment),rt=r(),A=c("p"),A.innerHTML=Ts,ot=r(),d(K.$$.fragment),it=r(),O=c("p"),O.innerHTML=Zs,pt=r(),d(ee.$$.fragment),mt=r(),te=c("p"),te.innerHTML=vs,ct=r(),d(se.$$.fragment),ft=r(),d(Y.$$.fragment),ut=r(),d(ae.$$.fragment),dt=r(),ne=c("p"),ne.innerHTML=Js,ht=r(),d(B.$$.fragment),bt=r(),d(le.$$.fragment),yt=r(),re=c("p"),re.innerHTML=Ws,gt=r(),d(X.$$.fragment),$t=r(),d(oe.$$.fragment),Mt=r(),ie=c("p"),ie.innerHTML=Us,jt=r(),pe=c("ul"),pe.innerHTML=Cs,_t=r(),me=c("p"),me.textContent=Rs,kt=r(),d(N.$$.fragment),wt=r(),ce=c("p"),ce.innerHTML=Vs,Tt=r(),d(fe.$$.fragment),Zt=r(),ue=c("p"),ue.innerHTML=qs,vt=r(),d(de.$$.fragment),Jt=r(),he=c("p"),he.innerHTML=Fs,Wt=r(),d(be.$$.fragment),Ut=r(),d(H.$$.fragment),Ct=r(),d(ye.$$.fragment),Rt=r(),ge=c("p"),ge.innerHTML=zs,Vt=r(),$e=c("p"),$e.innerHTML=Gs,qt=r(),d(Me.$$.fragment),Ft=r(),d(E.$$.fragment),zt=r(),je=c("p"),je.innerHTML=xs,Gt=r(),d(_e.$$.fragment),xt=r(),d(ke.$$.fragment),Yt=r(),I=c("div"),I.innerHTML=Ys,Bt=r(),we=c("p"),we.textContent=Bs,Xt=r(),Te=c("p"),Te.innerHTML=Xs,Nt=js(`
<hfoptions id="backbone">
<hfoption id="pretrained weights">
`),Ze=c("p"),Ze.innerHTML=Ns,Ht=r(),d(ve.$$.fragment),Et=js(`
</hfoption>
<hfoption id="random weights">
`),Je=c("p"),Je.innerHTML=Hs,It=r(),d(We.$$.fragment),Qt=r(),Ue=c("p"),Ue.textContent=Es,Lt=r(),d(Ce.$$.fragment),St=js(`
</hfoption>
</hfoptions id="timm backbone">
`),Re=c("p"),Re.innerHTML=Is,Pt=r(),Ve=c("p"),Ve.innerHTML=Qs,Dt=r(),d(qe.$$.fragment),At=r(),Fe=c("p"),Fe.innerHTML=Ls,Kt=r(),d(ze.$$.fragment),Ot=r(),Ge=c("p"),Ge.innerHTML=Ss,es=r(),d(xe.$$.fragment),ts=r(),d(Ye.$$.fragment),ss=r(),Be=c("p"),Be.innerHTML=Ps,as=r(),Xe=c("p"),Xe.innerHTML=Ds,ns=r(),d(Ne.$$.fragment),ls=r(),d(Q.$$.fragment),rs=r(),He=c("p"),He.innerHTML=As,os=r(),d(Ee.$$.fragment),is=r(),d(Ie.$$.fragment),ps=r(),Qe=c("p"),Qe.innerHTML=Ks,ms=r(),Le=c("p"),Le.textContent=Os,cs=r(),d(Se.$$.fragment),fs=r(),Pe=c("p"),Pe.textContent=ea,us=r(),d(De.$$.fragment),ds=r(),Ae=c("p"),Ae.innerHTML=ta,hs=r(),d(Ke.$$.fragment),bs=r(),Oe=c("p"),Oe.textContent=sa,ys=r(),d(et.$$.fragment),gs=r(),tt=c("p"),this.h()},l(e){const t=ya("svelte-u9bgzb",document.head);n=f(t,"META",{name:!0,content:!0}),t.forEach(s),M=o(e),l=f(e,"P",{}),ma(l).forEach(s),p=o(e),h(j.$$.fragment,e),_=o(e),R=f(e,"P",{"data-svelte-h":!0}),u(R)!=="svelte-1rebmo9"&&(R.innerHTML=W),k=o(e),J=f(e,"UL",{"data-svelte-h":!0}),u(J)!=="svelte-p41iia"&&(J.innerHTML=m),w=o(e),h(V.$$.fragment,e),U=o(e),F=f(e,"P",{"data-svelte-h":!0}),u(F)!=="svelte-mxa1qr"&&(F.innerHTML=z),C=o(e),q=f(e,"P",{"data-svelte-h":!0}),u(q)!=="svelte-ev4koj"&&(q.innerHTML=i),T=o(e),h(L.$$.fragment,e),at=o(e),S=f(e,"P",{"data-svelte-h":!0}),u(S)!=="svelte-s3f7ke"&&(S.innerHTML=ks),nt=o(e),P=f(e,"UL",{"data-svelte-h":!0}),u(P)!=="svelte-1ohji3r"&&(P.innerHTML=ws),lt=o(e),h(D.$$.fragment,e),rt=o(e),A=f(e,"P",{"data-svelte-h":!0}),u(A)!=="svelte-p4dxh7"&&(A.innerHTML=Ts),ot=o(e),h(K.$$.fragment,e),it=o(e),O=f(e,"P",{"data-svelte-h":!0}),u(O)!=="svelte-18tg5i3"&&(O.innerHTML=Zs),pt=o(e),h(ee.$$.fragment,e),mt=o(e),te=f(e,"P",{"data-svelte-h":!0}),u(te)!=="svelte-1l0o03s"&&(te.innerHTML=vs),ct=o(e),h(se.$$.fragment,e),ft=o(e),h(Y.$$.fragment,e),ut=o(e),h(ae.$$.fragment,e),dt=o(e),ne=f(e,"P",{"data-svelte-h":!0}),u(ne)!=="svelte-1ilk311"&&(ne.innerHTML=Js),ht=o(e),h(B.$$.fragment,e),bt=o(e),h(le.$$.fragment,e),yt=o(e),re=f(e,"P",{"data-svelte-h":!0}),u(re)!=="svelte-1a6phur"&&(re.innerHTML=Ws),gt=o(e),h(X.$$.fragment,e),$t=o(e),h(oe.$$.fragment,e),Mt=o(e),ie=f(e,"P",{"data-svelte-h":!0}),u(ie)!=="svelte-1czw1fm"&&(ie.innerHTML=Us),jt=o(e),pe=f(e,"UL",{"data-svelte-h":!0}),u(pe)!=="svelte-1go9ncc"&&(pe.innerHTML=Cs),_t=o(e),me=f(e,"P",{"data-svelte-h":!0}),u(me)!=="svelte-9binde"&&(me.textContent=Rs),kt=o(e),h(N.$$.fragment,e),wt=o(e),ce=f(e,"P",{"data-svelte-h":!0}),u(ce)!=="svelte-9kjh08"&&(ce.innerHTML=Vs),Tt=o(e),h(fe.$$.fragment,e),Zt=o(e),ue=f(e,"P",{"data-svelte-h":!0}),u(ue)!=="svelte-xgeviy"&&(ue.innerHTML=qs),vt=o(e),h(de.$$.fragment,e),Jt=o(e),he=f(e,"P",{"data-svelte-h":!0}),u(he)!=="svelte-1v218or"&&(he.innerHTML=Fs),Wt=o(e),h(be.$$.fragment,e),Ut=o(e),h(H.$$.fragment,e),Ct=o(e),h(ye.$$.fragment,e),Rt=o(e),ge=f(e,"P",{"data-svelte-h":!0}),u(ge)!=="svelte-1n918xx"&&(ge.innerHTML=zs),Vt=o(e),$e=f(e,"P",{"data-svelte-h":!0}),u($e)!=="svelte-1pkz4et"&&($e.innerHTML=Gs),qt=o(e),h(Me.$$.fragment,e),Ft=o(e),h(E.$$.fragment,e),zt=o(e),je=f(e,"P",{"data-svelte-h":!0}),u(je)!=="svelte-11ohhi9"&&(je.innerHTML=xs),Gt=o(e),h(_e.$$.fragment,e),xt=o(e),h(ke.$$.fragment,e),Yt=o(e),I=f(e,"DIV",{style:!0,"data-svelte-h":!0}),u(I)!=="svelte-ymdemd"&&(I.innerHTML=Ys),Bt=o(e),we=f(e,"P",{"data-svelte-h":!0}),u(we)!=="svelte-1q0lfob"&&(we.textContent=Bs),Xt=o(e),Te=f(e,"P",{"data-svelte-h":!0}),u(Te)!=="svelte-10wagau"&&(Te.innerHTML=Xs),Nt=_s(e,`
<hfoptions id="backbone">
<hfoption id="pretrained weights">
`),Ze=f(e,"P",{"data-svelte-h":!0}),u(Ze)!=="svelte-2cal1y"&&(Ze.innerHTML=Ns),Ht=o(e),h(ve.$$.fragment,e),Et=_s(e,`
</hfoption>
<hfoption id="random weights">
`),Je=f(e,"P",{"data-svelte-h":!0}),u(Je)!=="svelte-d4czvf"&&(Je.innerHTML=Hs),It=o(e),h(We.$$.fragment,e),Qt=o(e),Ue=f(e,"P",{"data-svelte-h":!0}),u(Ue)!=="svelte-ioxtxg"&&(Ue.textContent=Es),Lt=o(e),h(Ce.$$.fragment,e),St=_s(e,`
</hfoption>
</hfoptions id="timm backbone">
`),Re=f(e,"P",{"data-svelte-h":!0}),u(Re)!=="svelte-1rlxynb"&&(Re.innerHTML=Is),Pt=o(e),Ve=f(e,"P",{"data-svelte-h":!0}),u(Ve)!=="svelte-1k3hkaj"&&(Ve.innerHTML=Qs),Dt=o(e),h(qe.$$.fragment,e),At=o(e),Fe=f(e,"P",{"data-svelte-h":!0}),u(Fe)!=="svelte-zxts3n"&&(Fe.innerHTML=Ls),Kt=o(e),h(ze.$$.fragment,e),Ot=o(e),Ge=f(e,"P",{"data-svelte-h":!0}),u(Ge)!=="svelte-1puw6di"&&(Ge.innerHTML=Ss),es=o(e),h(xe.$$.fragment,e),ts=o(e),h(Ye.$$.fragment,e),ss=o(e),Be=f(e,"P",{"data-svelte-h":!0}),u(Be)!=="svelte-7jp5jk"&&(Be.innerHTML=Ps),as=o(e),Xe=f(e,"P",{"data-svelte-h":!0}),u(Xe)!=="svelte-6t4xgg"&&(Xe.innerHTML=Ds),ns=o(e),h(Ne.$$.fragment,e),ls=o(e),h(Q.$$.fragment,e),rs=o(e),He=f(e,"P",{"data-svelte-h":!0}),u(He)!=="svelte-144hxod"&&(He.innerHTML=As),os=o(e),h(Ee.$$.fragment,e),is=o(e),h(Ie.$$.fragment,e),ps=o(e),Qe=f(e,"P",{"data-svelte-h":!0}),u(Qe)!=="svelte-7n6mc3"&&(Qe.innerHTML=Ks),ms=o(e),Le=f(e,"P",{"data-svelte-h":!0}),u(Le)!=="svelte-gl9p7k"&&(Le.textContent=Os),cs=o(e),h(Se.$$.fragment,e),fs=o(e),Pe=f(e,"P",{"data-svelte-h":!0}),u(Pe)!=="svelte-1qntmzi"&&(Pe.textContent=ea),us=o(e),h(De.$$.fragment,e),ds=o(e),Ae=f(e,"P",{"data-svelte-h":!0}),u(Ae)!=="svelte-5ydoav"&&(Ae.innerHTML=ta),hs=o(e),h(Ke.$$.fragment,e),bs=o(e),Oe=f(e,"P",{"data-svelte-h":!0}),u(Oe)!=="svelte-1wdo2ao"&&(Oe.textContent=sa),ys=o(e),h(et.$$.fragment,e),gs=o(e),tt=f(e,"P",{}),ma(tt).forEach(s),this.h()},h(){ca(n,"name","hf:doc:metadata"),ca(n,"content",Fa),ga(I,"text-align","center")},m(e,t){$a(document.head,n),a(e,M,t),a(e,l,t),a(e,p,t),b(j,e,t),a(e,_,t),a(e,R,t),a(e,k,t),a(e,J,t),a(e,w,t),b(V,e,t),a(e,U,t),a(e,F,t),a(e,C,t),a(e,q,t),a(e,T,t),b(L,e,t),a(e,at,t),a(e,S,t),a(e,nt,t),a(e,P,t),a(e,lt,t),b(D,e,t),a(e,rt,t),a(e,A,t),a(e,ot,t),b(K,e,t),a(e,it,t),a(e,O,t),a(e,pt,t),b(ee,e,t),a(e,mt,t),a(e,te,t),a(e,ct,t),b(se,e,t),a(e,ft,t),b(Y,e,t),a(e,ut,t),b(ae,e,t),a(e,dt,t),a(e,ne,t),a(e,ht,t),b(B,e,t),a(e,bt,t),b(le,e,t),a(e,yt,t),a(e,re,t),a(e,gt,t),b(X,e,t),a(e,$t,t),b(oe,e,t),a(e,Mt,t),a(e,ie,t),a(e,jt,t),a(e,pe,t),a(e,_t,t),a(e,me,t),a(e,kt,t),b(N,e,t),a(e,wt,t),a(e,ce,t),a(e,Tt,t),b(fe,e,t),a(e,Zt,t),a(e,ue,t),a(e,vt,t),b(de,e,t),a(e,Jt,t),a(e,he,t),a(e,Wt,t),b(be,e,t),a(e,Ut,t),b(H,e,t),a(e,Ct,t),b(ye,e,t),a(e,Rt,t),a(e,ge,t),a(e,Vt,t),a(e,$e,t),a(e,qt,t),b(Me,e,t),a(e,Ft,t),b(E,e,t),a(e,zt,t),a(e,je,t),a(e,Gt,t),b(_e,e,t),a(e,xt,t),b(ke,e,t),a(e,Yt,t),a(e,I,t),a(e,Bt,t),a(e,we,t),a(e,Xt,t),a(e,Te,t),a(e,Nt,t),a(e,Ze,t),a(e,Ht,t),b(ve,e,t),a(e,Et,t),a(e,Je,t),a(e,It,t),b(We,e,t),a(e,Qt,t),a(e,Ue,t),a(e,Lt,t),b(Ce,e,t),a(e,St,t),a(e,Re,t),a(e,Pt,t),a(e,Ve,t),a(e,Dt,t),b(qe,e,t),a(e,At,t),a(e,Fe,t),a(e,Kt,t),b(ze,e,t),a(e,Ot,t),a(e,Ge,t),a(e,es,t),b(xe,e,t),a(e,ts,t),b(Ye,e,t),a(e,ss,t),a(e,Be,t),a(e,as,t),a(e,Xe,t),a(e,ns,t),b(Ne,e,t),a(e,ls,t),b(Q,e,t),a(e,rs,t),a(e,He,t),a(e,os,t),b(Ee,e,t),a(e,is,t),b(Ie,e,t),a(e,ps,t),a(e,Qe,t),a(e,ms,t),a(e,Le,t),a(e,cs,t),b(Se,e,t),a(e,fs,t),a(e,Pe,t),a(e,us,t),b(De,e,t),a(e,ds,t),a(e,Ae,t),a(e,hs,t),b(Ke,e,t),a(e,bs,t),a(e,Oe,t),a(e,ys,t),b(et,e,t),a(e,gs,t),a(e,tt,t),$s=!0},p(e,[t]){const aa={};t&2&&(aa.$$scope={dirty:t,ctx:e}),Y.$set(aa);const na={};t&2&&(na.$$scope={dirty:t,ctx:e}),B.$set(na);const la={};t&2&&(la.$$scope={dirty:t,ctx:e}),X.$set(la);const ra={};t&2&&(ra.$$scope={dirty:t,ctx:e}),N.$set(ra);const oa={};t&2&&(oa.$$scope={dirty:t,ctx:e}),H.$set(oa);const ia={};t&2&&(ia.$$scope={dirty:t,ctx:e}),E.$set(ia);const pa={};t&2&&(pa.$$scope={dirty:t,ctx:e}),Q.$set(pa)},i(e){$s||(y(j.$$.fragment,e),y(V.$$.fragment,e),y(L.$$.fragment,e),y(D.$$.fragment,e),y(K.$$.fragment,e),y(ee.$$.fragment,e),y(se.$$.fragment,e),y(Y.$$.fragment,e),y(ae.$$.fragment,e),y(B.$$.fragment,e),y(le.$$.fragment,e),y(X.$$.fragment,e),y(oe.$$.fragment,e),y(N.$$.fragment,e),y(fe.$$.fragment,e),y(de.$$.fragment,e),y(be.$$.fragment,e),y(H.$$.fragment,e),y(ye.$$.fragment,e),y(Me.$$.fragment,e),y(E.$$.fragment,e),y(_e.$$.fragment,e),y(ke.$$.fragment,e),y(ve.$$.fragment,e),y(We.$$.fragment,e),y(Ce.$$.fragment,e),y(qe.$$.fragment,e),y(ze.$$.fragment,e),y(xe.$$.fragment,e),y(Ye.$$.fragment,e),y(Ne.$$.fragment,e),y(Q.$$.fragment,e),y(Ee.$$.fragment,e),y(Ie.$$.fragment,e),y(Se.$$.fragment,e),y(De.$$.fragment,e),y(Ke.$$.fragment,e),y(et.$$.fragment,e),$s=!0)},o(e){g(j.$$.fragment,e),g(V.$$.fragment,e),g(L.$$.fragment,e),g(D.$$.fragment,e),g(K.$$.fragment,e),g(ee.$$.fragment,e),g(se.$$.fragment,e),g(Y.$$.fragment,e),g(ae.$$.fragment,e),g(B.$$.fragment,e),g(le.$$.fragment,e),g(X.$$.fragment,e),g(oe.$$.fragment,e),g(N.$$.fragment,e),g(fe.$$.fragment,e),g(de.$$.fragment,e),g(be.$$.fragment,e),g(H.$$.fragment,e),g(ye.$$.fragment,e),g(Me.$$.fragment,e),g(E.$$.fragment,e),g(_e.$$.fragment,e),g(ke.$$.fragment,e),g(ve.$$.fragment,e),g(We.$$.fragment,e),g(Ce.$$.fragment,e),g(qe.$$.fragment,e),g(ze.$$.fragment,e),g(xe.$$.fragment,e),g(Ye.$$.fragment,e),g(Ne.$$.fragment,e),g(Q.$$.fragment,e),g(Ee.$$.fragment,e),g(Ie.$$.fragment,e),g(Se.$$.fragment,e),g(De.$$.fragment,e),g(Ke.$$.fragment,e),g(et.$$.fragment,e),$s=!1},d(e){e&&(s(M),s(l),s(p),s(_),s(R),s(k),s(J),s(w),s(U),s(F),s(C),s(q),s(T),s(at),s(S),s(nt),s(P),s(lt),s(rt),s(A),s(ot),s(it),s(O),s(pt),s(mt),s(te),s(ct),s(ft),s(ut),s(dt),s(ne),s(ht),s(bt),s(yt),s(re),s(gt),s($t),s(Mt),s(ie),s(jt),s(pe),s(_t),s(me),s(kt),s(wt),s(ce),s(Tt),s(Zt),s(ue),s(vt),s(Jt),s(he),s(Wt),s(Ut),s(Ct),s(Rt),s(ge),s(Vt),s($e),s(qt),s(Ft),s(zt),s(je),s(Gt),s(xt),s(Yt),s(I),s(Bt),s(we),s(Xt),s(Te),s(Nt),s(Ze),s(Ht),s(Et),s(Je),s(It),s(Qt),s(Ue),s(Lt),s(St),s(Re),s(Pt),s(Ve),s(Dt),s(At),s(Fe),s(Kt),s(Ot),s(Ge),s(es),s(ts),s(ss),s(Be),s(as),s(Xe),s(ns),s(ls),s(rs),s(He),s(os),s(is),s(ps),s(Qe),s(ms),s(Le),s(cs),s(fs),s(Pe),s(us),s(ds),s(Ae),s(hs),s(bs),s(Oe),s(ys),s(gs),s(tt)),s(n),$(j,e),$(V,e),$(L,e),$(D,e),$(K,e),$(ee,e),$(se,e),$(Y,e),$(ae,e),$(B,e),$(le,e),$(X,e),$(oe,e),$(N,e),$(fe,e),$(de,e),$(be,e),$(H,e),$(ye,e),$(Me,e),$(E,e),$(_e,e),$(ke,e),$(ve,e),$(We,e),$(Ce,e),$(qe,e),$(ze,e),$(xe,e),$(Ye,e),$(Ne,e),$(Q,e),$(Ee,e),$(Ie,e),$(Se,e),$(De,e),$(Ke,e),$(et,e)}}}const Fa='{"title":"Create a custom architecture","local":"create-a-custom-architecture","sections":[{"title":"Configuration","local":"configuration","sections":[],"depth":2},{"title":"Model","local":"model","sections":[{"title":"Model heads","local":"model-heads","sections":[],"depth":3}],"depth":2},{"title":"Tokenizer","local":"tokenizer","sections":[],"depth":2},{"title":"Image processor","local":"image-processor","sections":[],"depth":2},{"title":"Backbone","local":"backbone","sections":[],"depth":2},{"title":"Feature extractor","local":"feature-extractor","sections":[],"depth":2},{"title":"Processor","local":"processor","sections":[],"depth":2}],"depth":1}';function za(v){return da(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ha extends ha{constructor(n){super(),ba(this,n,za,qa,ua,{})}}export{Ha as component};
