import{s as ua,o as da,n as x}from"../chunks/scheduler.25b97de1.js";import{S as ha,i as ya,g as c,s as r,r as d,m as js,A as ba,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 y,d as b,t as g,w as $}from"../chunks/index.d9030fc9.js";import{T as st}from"../chunks/Tip.baa67368.js";import{C as v}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(Z){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(Z){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,w,J='Create a pretrained model with <a href="/docs/transformers/pr_29261/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a>:',m,k,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 v({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}}),k=new v({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 v({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(),w=c("p"),w.innerHTML=J,m=r(),d(k.$$.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),w=f(i,"P",{"data-svelte-h":!0}),u(w)!=="svelte-1vkykzi"&&(w.innerHTML=J),m=o(i),h(k.$$.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),y(p,i,T),a(i,j,T),a(i,_,T),a(i,W,T),a(i,w,T),a(i,m,T),y(k,i,T),a(i,V,T),a(i,U,T),a(i,z,T),y(C,i,T),q=!0},p:x,i(i){q||(b(p.$$.fragment,i),b(k.$$.fragment,i),b(C.$$.fragment,i),q=!0)},o(i){g(p.$$.fragment,i),g(k.$$.fragment,i),g(C.$$.fragment,i),q=!1},d(i){i&&(s(n),s(l),s(j),s(_),s(W),s(w),s(m),s(V),s(U),s(z)),$(p,i),$(k,i),$(C,i)}}}function wa(Z){let n,M;return n=new Ms({props:{$$slots:{default:[_a]},$$scope:{ctx:Z}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){y(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(b(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function ka(Z){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,w,J='Create a pretrained model with <a href="/docs/transformers/pr_29261/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a>:',m,k,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 v({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}}),k=new v({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 v({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(),w=c("p"),w.innerHTML=J,m=r(),d(k.$$.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),w=f(i,"P",{"data-svelte-h":!0}),u(w)!=="svelte-emhb1w"&&(w.innerHTML=J),m=o(i),h(k.$$.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),y(p,i,T),a(i,j,T),a(i,_,T),a(i,W,T),a(i,w,T),a(i,m,T),y(k,i,T),a(i,V,T),a(i,U,T),a(i,z,T),y(C,i,T),q=!0},p:x,i(i){q||(b(p.$$.fragment,i),b(k.$$.fragment,i),b(C.$$.fragment,i),q=!0)},o(i){g(p.$$.fragment,i),g(k.$$.fragment,i),g(C.$$.fragment,i),q=!1},d(i){i&&(s(n),s(l),s(j),s(_),s(W),s(w),s(m),s(V),s(U),s(z)),$(p,i),$(k,i),$(C,i)}}}function Ta(Z){let n,M;return n=new Ms({props:{$$slots:{default:[ka]},$$scope:{ctx:Z}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){y(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(b(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function va(Z){let n,M='For example, <a href="/docs/transformers/pr_29261/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_29261/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,w,J;return p=new v({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}}),w=new v({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(w.$$.fragment)},l(m){n=f(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-3dbnf"&&(n.innerHTML=M),l=o(m),h(p.$$.fragment,m),j=o(m),_=f(m,"P",{"data-svelte-h":!0}),u(_)!=="svelte-1wz00dj"&&(_.innerHTML=R),W=o(m),h(w.$$.fragment,m)},m(m,k){a(m,n,k),a(m,l,k),y(p,m,k),a(m,j,k),a(m,_,k),a(m,W,k),y(w,m,k),J=!0},p:x,i(m){J||(b(p.$$.fragment,m),b(w.$$.fragment,m),J=!0)},o(m){g(p.$$.fragment,m),g(w.$$.fragment,m),J=!1},d(m){m&&(s(n),s(l),s(j),s(_),s(W)),$(p,m),$(w,m)}}}function Za(Z){let n,M;return n=new Ms({props:{$$slots:{default:[va]},$$scope:{ctx:Z}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){y(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(b(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function Ja(Z){let n,M='For example, <a href="/docs/transformers/pr_29261/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_29261/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,w,J;return p=new v({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}}),w=new v({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(w.$$.fragment)},l(m){n=f(m,"P",{"data-svelte-h":!0}),u(n)!=="svelte-366foz"&&(n.innerHTML=M),l=o(m),h(p.$$.fragment,m),j=o(m),_=f(m,"P",{"data-svelte-h":!0}),u(_)!=="svelte-1ngv79z"&&(_.innerHTML=R),W=o(m),h(w.$$.fragment,m)},m(m,k){a(m,n,k),a(m,l,k),y(p,m,k),a(m,j,k),a(m,_,k),a(m,W,k),y(w,m,k),J=!0},p:x,i(m){J||(b(p.$$.fragment,m),b(w.$$.fragment,m),J=!0)},o(m){g(p.$$.fragment,m),g(w.$$.fragment,m),J=!1},d(m){m&&(s(n),s(l),s(j),s(_),s(W)),$(p,m),$(w,m)}}}function Wa(Z){let n,M;return n=new Ms({props:{$$slots:{default:[Ja]},$$scope:{ctx:Z}}}),{c(){d(n.$$.fragment)},l(l){h(n.$$.fragment,l)},m(l,p){y(n,l,p),M=!0},p(l,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:l}),n.$set(j)},i(l){M||(b(n.$$.fragment,l),M=!0)},o(l){g(n.$$.fragment,l),M=!1},d(l){$(n,l)}}}function Ua(Z){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(Z){let n,M='By default, <a href="/docs/transformers/pr_29261/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-thhzvu"&&(n.innerHTML=M)},m(l,p){a(l,n,p)},p:x,d(l){l&&s(n)}}}function Ra(Z){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(Z){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(Z){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:',w,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>",k,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_29261/en/model_doc/distilbert#transformers.DistilBertConfig">DistilBertConfig</a> to inspect it’s attributes:',T,L,at,S,ws='<a href="/docs/transformers/pr_29261/en/model_doc/distilbert#transformers.DistilBertConfig">DistilBertConfig</a> displays all the default attributes used to build a base <a href="/docs/transformers/pr_29261/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,ks="<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_29261/en/main_classes/configuration#transformers.PretrainedConfig.from_pretrained">from_pretrained()</a> function:',ot,K,it,O,vs='Once you are satisfied with your model configuration, you can save it with <a href="/docs/transformers/pr_29261/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,Zs='To reuse the configuration file, load it with <a href="/docs/transformers/pr_29261/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_29261/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,yt,le,bt,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_29261/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>: a Python implementation of a tokenizer.</li> <li><a href="/docs/transformers/pr_29261/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.",wt,N,kt,ce,Vs="If you trained your own tokenizer, you can create one from your <em>vocabulary</em> file:",Tt,fe,vt,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_29261/en/model_doc/distilbert#transformers.DistilBertTokenizer">DistilBertTokenizer</a> class:',Zt,de,Jt,he,Fs='Create a fast tokenizer with the <a href="/docs/transformers/pr_29261/en/model_doc/distilbert#transformers.DistilBertTokenizerFast">DistilBertTokenizerFast</a> class:',Wt,ye,Ut,H,Ct,be,Rt,ge,zs='An image processor processes vision inputs. It inherits from the base <a href="/docs/transformers/pr_29261/en/internal/image_processing_utils#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_29261/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_29261/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> parameters to create your custom image processor:',Gt,_e,xt,we,Yt,I,Ys='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/Backbone.png"/>',Bt,ke,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,ve,Ns="Set <code>use_pretrained_backbone=True</code> to load pretrained ResNet weights for the backbone.",Ht,Ze,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_29261/en/main_classes/backbones#transformers.TimmBackbone">TimmBackbone</a> and <a href="/docs/transformers/pr_29261/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_29261/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin">FeatureExtractionMixin</a> class, and may also inherit from the <a href="/docs/transformers/pr_29261/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_29261/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_29261/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_29261/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_29261/en/model_doc/wav2vec2#transformers.Wav2Vec2Processor">Wav2Vec2Processor</a>:',hs,Ke,ys,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.",bs,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 v({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 v({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 v({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 v({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 v({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:Z}}}),ae=new G({props:{title:"Model",local:"model",headingTag:"h2"}}),B=new fa({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ta],pytorch:[wa]},$$scope:{ctx:Z}}}),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:[Za]},$$scope:{ctx:Z}}}),oe=new G({props:{title:"Tokenizer",local:"tokenizer",headingTag:"h2"}}),N=new st({props:{warning:!0,$$slots:{default:[Ua]},$$scope:{ctx:Z}}}),fe=new v({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 v({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}}),ye=new v({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:Z}}}),be=new G({props:{title:"Image processor",local:"image-processor",headingTag:"h2"}}),Me=new v({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:Z}}}),_e=new v({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}}),we=new G({props:{title:"Backbone",local:"backbone",headingTag:"h2"}}),Ze=new v({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 v({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 v({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 v({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 v({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 v({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 v({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:Z}}}),Ee=new v({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 v({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 v({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 v({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,w=r(),J=c("ul"),J.innerHTML=m,k=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=ws,nt=r(),P=c("ul"),P.innerHTML=ks,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=vs,pt=r(),d(ee.$$.fragment),mt=r(),te=c("p"),te.innerHTML=Zs,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),yt=r(),d(le.$$.fragment),bt=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,wt=r(),d(N.$$.fragment),kt=r(),ce=c("p"),ce.innerHTML=Vs,Tt=r(),d(fe.$$.fragment),vt=r(),ue=c("p"),ue.innerHTML=qs,Zt=r(),d(de.$$.fragment),Jt=r(),he=c("p"),he.innerHTML=Fs,Wt=r(),d(ye.$$.fragment),Ut=r(),d(H.$$.fragment),Ct=r(),d(be.$$.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(we.$$.fragment),Yt=r(),I=c("div"),I.innerHTML=Ys,Bt=r(),ke=c("p"),ke.textContent=Bs,Xt=r(),Te=c("p"),Te.innerHTML=Xs,Nt=js(`
<hfoptions id="backbone">
<hfoption id="pretrained weights">
`),ve=c("p"),ve.innerHTML=Ns,Ht=r(),d(Ze.$$.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),ys=r(),Oe=c("p"),Oe.textContent=sa,bs=r(),d(et.$$.fragment),gs=r(),tt=c("p"),this.h()},l(e){const t=ba("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),w=o(e),J=f(e,"UL",{"data-svelte-h":!0}),u(J)!=="svelte-p41iia"&&(J.innerHTML=m),k=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-1logmz4"&&(q.innerHTML=i),T=o(e),h(L.$$.fragment,e),at=o(e),S=f(e,"P",{"data-svelte-h":!0}),u(S)!=="svelte-2v52gw"&&(S.innerHTML=ws),nt=o(e),P=f(e,"UL",{"data-svelte-h":!0}),u(P)!=="svelte-1ohji3r"&&(P.innerHTML=ks),lt=o(e),h(D.$$.fragment,e),rt=o(e),A=f(e,"P",{"data-svelte-h":!0}),u(A)!=="svelte-v97hda"&&(A.innerHTML=Ts),ot=o(e),h(K.$$.fragment,e),it=o(e),O=f(e,"P",{"data-svelte-h":!0}),u(O)!=="svelte-172808u"&&(O.innerHTML=vs),pt=o(e),h(ee.$$.fragment,e),mt=o(e),te=f(e,"P",{"data-svelte-h":!0}),u(te)!=="svelte-1gk9ez3"&&(te.innerHTML=Zs),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-roox42"&&(ne.innerHTML=Js),ht=o(e),h(B.$$.fragment,e),yt=o(e),h(le.$$.fragment,e),bt=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-1ryuh5k"&&(pe.innerHTML=Cs),_t=o(e),me=f(e,"P",{"data-svelte-h":!0}),u(me)!=="svelte-9binde"&&(me.textContent=Rs),wt=o(e),h(N.$$.fragment,e),kt=o(e),ce=f(e,"P",{"data-svelte-h":!0}),u(ce)!=="svelte-9kjh08"&&(ce.innerHTML=Vs),Tt=o(e),h(fe.$$.fragment,e),vt=o(e),ue=f(e,"P",{"data-svelte-h":!0}),u(ue)!=="svelte-erp31z"&&(ue.innerHTML=qs),Zt=o(e),h(de.$$.fragment,e),Jt=o(e),he=f(e,"P",{"data-svelte-h":!0}),u(he)!=="svelte-1uvy4jq"&&(he.innerHTML=Fs),Wt=o(e),h(ye.$$.fragment,e),Ut=o(e),h(H.$$.fragment,e),Ct=o(e),h(be.$$.fragment,e),Rt=o(e),ge=f(e,"P",{"data-svelte-h":!0}),u(ge)!=="svelte-158fzvk"&&(ge.innerHTML=zs),Vt=o(e),$e=f(e,"P",{"data-svelte-h":!0}),u($e)!=="svelte-gwft8m"&&($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-14n1ypu"&&(je.innerHTML=xs),Gt=o(e),h(_e.$$.fragment,e),xt=o(e),h(we.$$.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),ke=f(e,"P",{"data-svelte-h":!0}),u(ke)!=="svelte-1q0lfob"&&(ke.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">
`),ve=f(e,"P",{"data-svelte-h":!0}),u(ve)!=="svelte-2cal1y"&&(ve.innerHTML=Ns),Ht=o(e),h(Ze.$$.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-l1l3yz"&&(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-6kv2o6"&&(Be.innerHTML=Ps),as=o(e),Xe=f(e,"P",{"data-svelte-h":!0}),u(Xe)!=="svelte-jjzvml"&&(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-1d7zkpa"&&(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-1a1h7pm"&&(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-1dpsony"&&(Ae.innerHTML=ta),hs=o(e),h(Ke.$$.fragment,e),ys=o(e),Oe=f(e,"P",{"data-svelte-h":!0}),u(Oe)!=="svelte-1wdo2ao"&&(Oe.textContent=sa),bs=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),y(j,e,t),a(e,_,t),a(e,R,t),a(e,w,t),a(e,J,t),a(e,k,t),y(V,e,t),a(e,U,t),a(e,F,t),a(e,C,t),a(e,q,t),a(e,T,t),y(L,e,t),a(e,at,t),a(e,S,t),a(e,nt,t),a(e,P,t),a(e,lt,t),y(D,e,t),a(e,rt,t),a(e,A,t),a(e,ot,t),y(K,e,t),a(e,it,t),a(e,O,t),a(e,pt,t),y(ee,e,t),a(e,mt,t),a(e,te,t),a(e,ct,t),y(se,e,t),a(e,ft,t),y(Y,e,t),a(e,ut,t),y(ae,e,t),a(e,dt,t),a(e,ne,t),a(e,ht,t),y(B,e,t),a(e,yt,t),y(le,e,t),a(e,bt,t),a(e,re,t),a(e,gt,t),y(X,e,t),a(e,$t,t),y(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,wt,t),y(N,e,t),a(e,kt,t),a(e,ce,t),a(e,Tt,t),y(fe,e,t),a(e,vt,t),a(e,ue,t),a(e,Zt,t),y(de,e,t),a(e,Jt,t),a(e,he,t),a(e,Wt,t),y(ye,e,t),a(e,Ut,t),y(H,e,t),a(e,Ct,t),y(be,e,t),a(e,Rt,t),a(e,ge,t),a(e,Vt,t),a(e,$e,t),a(e,qt,t),y(Me,e,t),a(e,Ft,t),y(E,e,t),a(e,zt,t),a(e,je,t),a(e,Gt,t),y(_e,e,t),a(e,xt,t),y(we,e,t),a(e,Yt,t),a(e,I,t),a(e,Bt,t),a(e,ke,t),a(e,Xt,t),a(e,Te,t),a(e,Nt,t),a(e,ve,t),a(e,Ht,t),y(Ze,e,t),a(e,Et,t),a(e,Je,t),a(e,It,t),y(We,e,t),a(e,Qt,t),a(e,Ue,t),a(e,Lt,t),y(Ce,e,t),a(e,St,t),a(e,Re,t),a(e,Pt,t),a(e,Ve,t),a(e,Dt,t),y(qe,e,t),a(e,At,t),a(e,Fe,t),a(e,Kt,t),y(ze,e,t),a(e,Ot,t),a(e,Ge,t),a(e,es,t),y(xe,e,t),a(e,ts,t),y(Ye,e,t),a(e,ss,t),a(e,Be,t),a(e,as,t),a(e,Xe,t),a(e,ns,t),y(Ne,e,t),a(e,ls,t),y(Q,e,t),a(e,rs,t),a(e,He,t),a(e,os,t),y(Ee,e,t),a(e,is,t),y(Ie,e,t),a(e,ps,t),a(e,Qe,t),a(e,ms,t),a(e,Le,t),a(e,cs,t),y(Se,e,t),a(e,fs,t),a(e,Pe,t),a(e,us,t),y(De,e,t),a(e,ds,t),a(e,Ae,t),a(e,hs,t),y(Ke,e,t),a(e,ys,t),a(e,Oe,t),a(e,bs,t),y(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||(b(j.$$.fragment,e),b(V.$$.fragment,e),b(L.$$.fragment,e),b(D.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(se.$$.fragment,e),b(Y.$$.fragment,e),b(ae.$$.fragment,e),b(B.$$.fragment,e),b(le.$$.fragment,e),b(X.$$.fragment,e),b(oe.$$.fragment,e),b(N.$$.fragment,e),b(fe.$$.fragment,e),b(de.$$.fragment,e),b(ye.$$.fragment,e),b(H.$$.fragment,e),b(be.$$.fragment,e),b(Me.$$.fragment,e),b(E.$$.fragment,e),b(_e.$$.fragment,e),b(we.$$.fragment,e),b(Ze.$$.fragment,e),b(We.$$.fragment,e),b(Ce.$$.fragment,e),b(qe.$$.fragment,e),b(ze.$$.fragment,e),b(xe.$$.fragment,e),b(Ye.$$.fragment,e),b(Ne.$$.fragment,e),b(Q.$$.fragment,e),b(Ee.$$.fragment,e),b(Ie.$$.fragment,e),b(Se.$$.fragment,e),b(De.$$.fragment,e),b(Ke.$$.fragment,e),b(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(ye.$$.fragment,e),g(H.$$.fragment,e),g(be.$$.fragment,e),g(Me.$$.fragment,e),g(E.$$.fragment,e),g(_e.$$.fragment,e),g(we.$$.fragment,e),g(Ze.$$.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(w),s(J),s(k),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(yt),s(bt),s(re),s(gt),s($t),s(Mt),s(ie),s(jt),s(pe),s(_t),s(me),s(wt),s(kt),s(ce),s(Tt),s(vt),s(ue),s(Zt),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(ke),s(Xt),s(Te),s(Nt),s(ve),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(ys),s(Oe),s(bs),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),$(ye,e),$(H,e),$(be,e),$(Me,e),$(E,e),$(_e,e),$(we,e),$(Ze,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(Z){return da(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ha extends ha{constructor(n){super(),ya(this,n,za,qa,ua,{})}}export{Ha as component};
