import{s as ma,o as ua,n as se}from"../chunks/scheduler.d586627e.js";import{S as ca,i as da,g as p,s as l,u as g,A as fa,h as m,f as t,c as i,j as z,v as $,y as d,k,o as T,a,w as v,d as y,t as b,x as j}from"../chunks/index.b757c891.js";import{T as hs}from"../chunks/Tip.4380e997.js";import{I as Se}from"../chunks/IconCopyLink.c074b82b.js";import{C}from"../chunks/CodeBlock.aa8a1a9b.js";import{F as pa,M as gs}from"../chunks/Markdown.c7809abe.js";function ha(x){let o,f='Você pode também salvar seu arquivo de configurações como um dicionário ou até mesmo com a diferença entre as seus atributos de configuração customizados e os atributos de configuração padrões! Olhe a documentação <a href="main_classes/configuration">configuration</a> para mais detalhes.';return{c(){o=p("p"),o.innerHTML=f},l(r){o=m(r,"P",{"data-svelte-h":!0}),d(o)!=="svelte-1w3c9xg"&&(o.innerHTML=f)},m(r,u){a(r,o,u)},p:se,d(r){r&&t(o)}}}function ga(x){let o,f="Carregar seus atributos de configuração customizados em um modelo:",r,u,h,_,W="Isso cria um modelo com valores aleatórios ao invés de pré-treinar os pesos. Você não irá conseguir usar usar esse modelo para nada útil ainda, até você treinar ele. Treino é um processo caro e demorado. Geralmente é melhor utilizar um modelo pré-treinado para obter melhores resultados mais rápido, enquanto usa apenas uma fração dos recursos necessários para treinar.",Z,w,J="Criar um modelo pré-treinado com <code>from_pretrained()</code>:",c,M,U,V,F="Quando você carregar os pesos pré-treinados, a configuração padrão do modelo é automaticamente carregada se o modelo é provido pelo 🤗 Transformers. No entanto, você ainda consegue mudar - alguns ou todos - os atributos padrões de configuração do modelo com os seus próprio atributos, se você preferir:",E,R,G;return u=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRNb2RlbCUwQSUwQW15X2NvbmZpZyUyMCUzRCUyMERpc3RpbEJlcnRDb25maWcuZnJvbV9wcmV0cmFpbmVkKCUyMi4lMkZ5b3VyX21vZGVsX3NhdmVfcGF0aCUyRm15X2NvbmZpZy5qc29uJTIyKSUwQW1vZGVsJTIwJTNEJTIwRGlzdGlsQmVydE1vZGVsKG15X2NvbmZpZyk=",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/my_config.json&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel(my_config)`,wrap:!1}}),M=new C({props:{code:"bW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)',wrap:!1}}),R=new C({props:{code:"bW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyJTJDJTIwY29uZmlnJTNEbXlfY29uZmlnKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model = DistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, config=my_config)',wrap:!1}}),{c(){o=p("p"),o.textContent=f,r=l(),g(u.$$.fragment),h=l(),_=p("p"),_.textContent=W,Z=l(),w=p("p"),w.innerHTML=J,c=l(),g(M.$$.fragment),U=l(),V=p("p"),V.textContent=F,E=l(),g(R.$$.fragment)},l(n){o=m(n,"P",{"data-svelte-h":!0}),d(o)!=="svelte-1c03gen"&&(o.textContent=f),r=i(n),$(u.$$.fragment,n),h=i(n),_=m(n,"P",{"data-svelte-h":!0}),d(_)!=="svelte-13tdbko"&&(_.textContent=W),Z=i(n),w=m(n,"P",{"data-svelte-h":!0}),d(w)!=="svelte-11s0isn"&&(w.innerHTML=J),c=i(n),$(M.$$.fragment,n),U=i(n),V=m(n,"P",{"data-svelte-h":!0}),d(V)!=="svelte-1c3dpxi"&&(V.textContent=F),E=i(n),$(R.$$.fragment,n)},m(n,q){a(n,o,q),a(n,r,q),v(u,n,q),a(n,h,q),a(n,_,q),a(n,Z,q),a(n,w,q),a(n,c,q),v(M,n,q),a(n,U,q),a(n,V,q),a(n,E,q),v(R,n,q),G=!0},p:se,i(n){G||(y(u.$$.fragment,n),y(M.$$.fragment,n),y(R.$$.fragment,n),G=!0)},o(n){b(u.$$.fragment,n),b(M.$$.fragment,n),b(R.$$.fragment,n),G=!1},d(n){n&&(t(o),t(r),t(h),t(_),t(Z),t(w),t(c),t(U),t(V),t(E)),j(u,n),j(M,n),j(R,n)}}}function $a(x){let o,f;return o=new gs({props:{$$slots:{default:[ga]},$$scope:{ctx:x}}}),{c(){g(o.$$.fragment)},l(r){$(o.$$.fragment,r)},m(r,u){v(o,r,u),f=!0},p(r,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:r}),o.$set(h)},i(r){f||(y(o.$$.fragment,r),f=!0)},o(r){b(o.$$.fragment,r),f=!1},d(r){j(o,r)}}}function va(x){let o,f="Carregar os seus próprios atributos padrões de contiguração no modelo:",r,u,h,_,W="Isso cria um modelo com valores aleatórios ao invés de pré-treinar os pesos. Você não irá conseguir usar usar esse modelo para nada útil ainda, até você treinar ele. Treino é um processo caro e demorado. Geralmente é melhor utilizar um modelo pré-treinado para obter melhores resultados mais rápido, enquanto usa apenas uma fração dos recursos necessários para treinar.",Z,w,J="Criar um modelo pré-treinado com <code>from_pretrained()</code>:",c,M,U,V,F="Quando você carregar os pesos pré-treinados, a configuração padrão do modelo é automaticamente carregada se o modelo é provido pelo 🤗 Transformers. No entanto, você ainda consegue mudar - alguns ou todos - os atributos padrões de configuração do modelo com os seus próprio atributos, se você preferir:",E,R,G;return u=new C({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}}),M=new C({props:{code:"dGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)',wrap:!1}}),R=new C({props:{code:"dGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBjb25maWclM0RteV9jb25maWcp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFDistilBertModel.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, config=my_config)',wrap:!1}}),{c(){o=p("p"),o.textContent=f,r=l(),g(u.$$.fragment),h=l(),_=p("p"),_.textContent=W,Z=l(),w=p("p"),w.innerHTML=J,c=l(),g(M.$$.fragment),U=l(),V=p("p"),V.textContent=F,E=l(),g(R.$$.fragment)},l(n){o=m(n,"P",{"data-svelte-h":!0}),d(o)!=="svelte-k13ol"&&(o.textContent=f),r=i(n),$(u.$$.fragment,n),h=i(n),_=m(n,"P",{"data-svelte-h":!0}),d(_)!=="svelte-13tdbko"&&(_.textContent=W),Z=i(n),w=m(n,"P",{"data-svelte-h":!0}),d(w)!=="svelte-11s0isn"&&(w.innerHTML=J),c=i(n),$(M.$$.fragment,n),U=i(n),V=m(n,"P",{"data-svelte-h":!0}),d(V)!=="svelte-1c3dpxi"&&(V.textContent=F),E=i(n),$(R.$$.fragment,n)},m(n,q){a(n,o,q),a(n,r,q),v(u,n,q),a(n,h,q),a(n,_,q),a(n,Z,q),a(n,w,q),a(n,c,q),v(M,n,q),a(n,U,q),a(n,V,q),a(n,E,q),v(R,n,q),G=!0},p:se,i(n){G||(y(u.$$.fragment,n),y(M.$$.fragment,n),y(R.$$.fragment,n),G=!0)},o(n){b(u.$$.fragment,n),b(M.$$.fragment,n),b(R.$$.fragment,n),G=!1},d(n){n&&(t(o),t(r),t(h),t(_),t(Z),t(w),t(c),t(U),t(V),t(E)),j(u,n),j(M,n),j(R,n)}}}function ya(x){let o,f;return o=new gs({props:{$$slots:{default:[va]},$$scope:{ctx:x}}}),{c(){g(o.$$.fragment)},l(r){$(o.$$.fragment,r)},m(r,u){v(o,r,u),f=!0},p(r,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:r}),o.$set(h)},i(r){f||(y(o.$$.fragment,r),f=!0)},o(r){b(o.$$.fragment,r),f=!1},d(r){j(o,r)}}}function ba(x){let o,f="Por exemplo, <code>DistilBertForSequenceClassification</code> é um modelo DistilBERT base com uma head de classificação de sequência. A head de calssificação de sequência é uma camada linear no topo das saídas agrupadas.",r,u,h,_,W="Reutilize facilmente esse ponto de parada para outra tarefe mudando para uma head de modelo diferente. Para uma tarefe de responder questões, você usaria a head do modelo <code>DistilBertForQuestionAnswering</code>. A head de responder questões é similar com a de classificação de sequências exceto o fato de que ela é uma camada no topo dos estados das saídas ocultas.",Z,w,J;return u=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBEaXN0aWxCZXJ0Rm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",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-base-uncased&quot;</span>)`,wrap:!1}}),w=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQSUwQW1vZGVsJTIwJTNEJTIwRGlzdGlsQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",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-base-uncased&quot;</span>)`,wrap:!1}}),{c(){o=p("p"),o.innerHTML=f,r=l(),g(u.$$.fragment),h=l(),_=p("p"),_.innerHTML=W,Z=l(),g(w.$$.fragment)},l(c){o=m(c,"P",{"data-svelte-h":!0}),d(o)!=="svelte-qzae0f"&&(o.innerHTML=f),r=i(c),$(u.$$.fragment,c),h=i(c),_=m(c,"P",{"data-svelte-h":!0}),d(_)!=="svelte-i9bvsw"&&(_.innerHTML=W),Z=i(c),$(w.$$.fragment,c)},m(c,M){a(c,o,M),a(c,r,M),v(u,c,M),a(c,h,M),a(c,_,M),a(c,Z,M),v(w,c,M),J=!0},p:se,i(c){J||(y(u.$$.fragment,c),y(w.$$.fragment,c),J=!0)},o(c){b(u.$$.fragment,c),b(w.$$.fragment,c),J=!1},d(c){c&&(t(o),t(r),t(h),t(_),t(Z)),j(u,c),j(w,c)}}}function ja(x){let o,f;return o=new gs({props:{$$slots:{default:[ba]},$$scope:{ctx:x}}}),{c(){g(o.$$.fragment)},l(r){$(o.$$.fragment,r)},m(r,u){v(o,r,u),f=!0},p(r,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:r}),o.$set(h)},i(r){f||(y(o.$$.fragment,r),f=!0)},o(r){b(o.$$.fragment,r),f=!1},d(r){j(o,r)}}}function _a(x){let o,f="Por exemplo, <code>TFDistilBertForSequenceClassification</code> é um modelo DistilBERT base com uma head de classificação de sequência. A head de calssificação de sequência é uma camada linear no topo das saídas agrupadas.",r,u,h,_,W="Reutilize facilmente esse ponto de parada para outra tarefe mudando para uma head de modelo diferente. Para uma tarefe de responder questões, você usaria a head do modelo <code>TFDistilBertForQuestionAnswering</code>. A head de responder questões é similar com a de classificação de sequências exceto o fato de que ela é uma camada no topo dos estados das saídas ocultas.",Z,w,J;return u=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0Zl9tb2RlbCUyMCUzRCUyMFRGRGlzdGlsQmVydEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",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-base-uncased&quot;</span>)`,wrap:!1}}),w=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGRGlzdGlsQmVydEZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBJTBBdGZfbW9kZWwlMjAlM0QlMjBURkRpc3RpbEJlcnRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",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-base-uncased&quot;</span>)`,wrap:!1}}),{c(){o=p("p"),o.innerHTML=f,r=l(),g(u.$$.fragment),h=l(),_=p("p"),_.innerHTML=W,Z=l(),g(w.$$.fragment)},l(c){o=m(c,"P",{"data-svelte-h":!0}),d(o)!=="svelte-1sg0zkd"&&(o.innerHTML=f),r=i(c),$(u.$$.fragment,c),h=i(c),_=m(c,"P",{"data-svelte-h":!0}),d(_)!=="svelte-s66f56"&&(_.innerHTML=W),Z=i(c),$(w.$$.fragment,c)},m(c,M){a(c,o,M),a(c,r,M),v(u,c,M),a(c,h,M),a(c,_,M),a(c,Z,M),v(w,c,M),J=!0},p:se,i(c){J||(y(u.$$.fragment,c),y(w.$$.fragment,c),J=!0)},o(c){b(u.$$.fragment,c),b(w.$$.fragment,c),J=!1},d(c){c&&(t(o),t(r),t(h),t(_),t(Z)),j(u,c),j(w,c)}}}function Ma(x){let o,f;return o=new gs({props:{$$slots:{default:[_a]},$$scope:{ctx:x}}}),{c(){g(o.$$.fragment)},l(r){$(o.$$.fragment,r)},m(r,u){v(o,r,u),f=!0},p(r,u){const h={};u&2&&(h.$$scope={dirty:u,ctx:r}),o.$set(h)},i(r){f||(y(o.$$.fragment,r),f=!0)},o(r){b(o.$$.fragment,r),f=!1},d(r){j(o,r)}}}function qa(x){let o,f='Nem todo modelo suporta um ‘fast tokenizer’. De uma olhada aqui <a href="index#supported-frameworks">table</a> pra checar se um modelo suporta ‘fast tokenizer’.';return{c(){o=p("p"),o.innerHTML=f},l(r){o=m(r,"P",{"data-svelte-h":!0}),d(o)!=="svelte-za00d2"&&(o.innerHTML=f)},m(r,u){a(r,o,u)},p:se,d(r){r&&t(o)}}}function wa(x){let o,f="Pos padrão, <code>AutoTokenizer</code> tentará carregar um ‘fast tokenizer’. Você pode disabilitar esse comportamento colocando <code>use_fast=False</code> no <code>from_pretrained</code>.";return{c(){o=p("p"),o.innerHTML=f},l(r){o=m(r,"P",{"data-svelte-h":!0}),d(o)!=="svelte-7idicq"&&(o.innerHTML=f)},m(r,u){a(r,o,u)},p:se,d(r){r&&t(o)}}}function ka(x){let o,f="Se você não estiver procurando por nenhuma customização, apenas use o método <code>from_pretrained</code> para carregar parâmetros do modelo de extrator de features padrão.";return{c(){o=p("p"),o.innerHTML=f},l(r){o=m(r,"P",{"data-svelte-h":!0}),d(o)!=="svelte-1y4q9rq"&&(o.innerHTML=f)},m(r,u){a(r,o,u)},p:se,d(r){r&&t(o)}}}function Ta(x){let o,f,r,u,h,_,W,Z,w,J,c="Criar uma arquitetura customizada",M,U,V='Uma <a href="model_doc/auto"><code>AutoClass</code></a> automaticamente infere a arquitetura do modelo e baixa configurações e pesos pré-treinados. Geralmente, nós recomendamos usar uma <code>AutoClass</code> para produzir um código independente de checkpoints. Mas usuários que querem mais contole sobre parâmetros específicos do modelo pode criar um modelo customizado 🤗 Transformers a partir de algumas classes bases. Isso pode ser particulamente útil para alguém que está interessado em estudar, treinar ou fazer experimentos com um modelo 🤗 Transformers. Nesse tutorial, será explicado como criar um modelo customizado sem uma <code>AutoClass</code>. Aprenda como:',F,E,R="<li>Carregar e customizar a configuração de um modelo.</li> <li>Criar a arquitetura de um modelo.</li> <li>Criar um tokenizer rápido e devagar para textos.</li> <li>Criar extrator de features para tarefas envolvendo audio e imagem.</li> <li>Criar um processador para tarefas multimodais.</li>",G,n,q,st,ae,$s,Ae,Ms="configuration",dt,oe,qs='A <a href="main_classes/configuration">configuration</a> refere-se a atributos específicos de um modelo. Cada configuração de modelo tem atributos diferentes; por exemplo, todos modelo de PLN possuem os atributos <code>hidden_size</code>, <code>num_attention_heads</code>, <code>num_hidden_layers</code> e <code>vocab_size</code> em comum. Esse atributos especificam o numero de ‘attention heads’ ou ‘hidden layers’ para construir um modelo.',ft,re,ws='Dê uma olhada a mais em <a href="model_doc/distilbert">DistilBERT</a> acessando <code>DistilBertConfig</code> para observar esses atributos:',ht,ne,gt,le,ks="<code>DistilBertConfig</code> mostra todos os atributos padrões usados para construir um <code>DistilBertModel</code> base. Todos atributos são customizáveis, o que cria espaço para experimentos. Por exemplo, você pode customizar um modelo padrão para:",$t,ie,Ts="<li>Tentar uma função de ativação diferente com o parâmetro <code>activation</code>.</li> <li>Usar uma taxa de desistência maior para as probabilidades de ‘attention’ com o parâmetro <code>attention_dropout</code>.</li>",vt,pe,yt,me,Zs="Atributos de um modelo pré-treinado podem ser modificados na função <code>from_pretrained()</code>:",bt,ue,jt,ce,xs="Uma vez que você está satisfeito com as configurações do seu modelo, você consegue salvar elas com <code>save_pretrained()</code>. Seu arquivo de configurações está salvo como um arquivo JSON no diretório especificado:",_t,de,Mt,fe,Cs="Para reusar o arquivo de configurações, carregue com <code>from_pretrained()</code>:",qt,he,wt,L,kt,H,Q,at,ge,vs,De,zs="Modelo",Tt,$e,Js='O próximo passo é criar um <a href="main_classes/models">model</a>. O modelo - também vagamente referido como arquitetura - define o que cada camada está fazendo e quais operações estão acontecendo. Atributos como <code>num_hidden_layers</code> das configurações são utilizados para definir a arquitetura. Todo modelo compartilha a classe base <code>PreTrainedModel</code> e alguns métodos em comum como redimensionar o tamanho dos embeddings de entrada e podar as ‘self-attention heads’. Além disso, todos os modelos também são subclasses de <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> ou <a href="https://flax.readthedocs.io/en/latest/flax.linen.html#module" rel="nofollow"><code>flax.linen.Module</code></a>. Isso significa que os modelos são compatíveis com cada respectivo uso de framework.',Zt,P,xt,X,I,ot,ve,ys,Ke,Vs="Heads do modelo",Ct,ye,Rs="Neste ponto, você tem um modelo básico do DistilBERT que gera os <em>estados ocultos</em>. Os estados ocultos são passados como entrada para a head do moelo para produzir a saída final. 🤗 Transformers fornece uma head de modelo diferente para cada tarefa desde que o modelo suporte essa tarefa (por exemplo, você não consegue utilizar o modelo DistilBERT para uma tarefa de ‘sequence-to-sequence’ como tradução).",zt,S,Jt,B,A,rt,be,bs,Oe,Ws="Tokenizer",Vt,je,Us='A útlima classe base que você precisa antes de usar um modelo para dados textuais é a <a href="main_classes/tokenizer">tokenizer</a> para converter textos originais para tensores. Existem dois tipos de tokenizers que você pode usar com 🤗 Transformers:',Rt,_e,Es='<li><code>PreTrainedTokenizer</code>: uma implementação em Python de um tokenizer.</li> <li><code>PreTrainedTokenizerFast</code>: um tokenizer da nossa biblioteca <a href="https://huggingface.co/docs/tokenizers/python/latest/" rel="nofollow">🤗 Tokenizer</a> baseada em Rust. Esse tipo de tokenizer é significantemente mais rapido - especialmente durante tokenization de codificação - devido a implementação em Rust. O tokenizer rápido tambem oferece métodos adicionais como <em>offset mapping</em> que mapeia tokens para suar palavras ou caracteres originais.</li>',Wt,Me,Gs="Os dois tokenizers suporta métodos comuns como os de codificar e decodificar, adicionar novos tokens, e gerenciar tokens especiais.",Ut,D,Et,qe,Fs="Se você treinou seu prórpio tokenizer, você pode criar um a partir do seu arquivo <em>vocabulary</em>:",Gt,we,Ft,ke,Hs="É importante lembrar que o vocabulário de um tokenizer customizado será diferente de um vocabulário gerado pelo tokenizer de um modelo pré treinado. Você precisa usar o vocabulário de um modelo pré treinado se você estiver usando um modelo pré treinado, caso contrário as entradas não farão sentido. Criando um tokenizer com um vocabulário de um modelo pré treinado com a classe <code>DistilBertTokenizer</code>:",Ht,Te,Xt,Ze,Xs="Criando um ‘fast tokenizer’ com a classe <code>DistilBertTokenizerFast</code>:",Bt,xe,Yt,K,Nt,Y,O,nt,Ce,js,et,Bs="Extrator de features",Lt,ze,Ys="Um extrator de features processa entradas de imagem ou áudio. Ele herda da classe base <code>FeatureExtractionMixin</code>, e pode também herdar da classe <code>ImageFeatureExtractionMixin</code> para processamento de features de imagem ou da classe <code>SequenceFeatureExtractor</code> para processamento de entradas de áudio.",Qt,Je,Ns='Dependendo do que você está trabalhando em um audio ou uma tarefa de visão, crie um estrator de features associado com o modelo que você está usando. Por exemplo, crie um <code>ViTFeatureExtractor</code> padrão se você estiver usando <a href="model_doc/vit">ViT</a> para classificação de imagens:',Pt,Ve,It,ee,St,Re,Ls="Modifique qualquer parâmetro dentre os <code>ViTFeatureExtractor</code> para criar seu extrator de features customizado.",At,We,Dt,Ue,Qs="Para entradas de áutio, você pode criar um <code>Wav2Vec2FeatureExtractor</code> e customizar os parâmetros de uma forma similar:",Kt,Ee,Ot,N,te,lt,Ge,_s,tt,Ps="Processor",es,Fe,Is="Para modelos que suportam tarefas multimodais, 🤗 Transformers oferece uma classe processadora que convenientemente cobre um extrator de features e tokenizer dentro de um único objeto. Por exemplo, vamos usar o <code>Wav2Vec2Processor</code> para uma tarefa de reconhecimento de fala automática (ASR). ASR transcreve áudio para texto, então você irá precisar de um extrator de um features e um tokenizer.",ts,He,Ss="Crie um extrator de features para lidar com as entradas de áudio.",ss,Xe,as,Be,As="Crie um tokenizer para lidar com a entrada de textos:",os,Ye,rs,Ne,Ds="Combine o extrator de features e o tokenizer no <code>Wav2Vec2Processor</code>:",ns,Le,ls,Qe,Ks="Com duas classes básicas - configuração e modelo - e um preprocessamento de classe adicional (tokenizer, extrator de features, ou processador), você pode criar qualquer modelo que suportado por 🤗 Transformers. Qualquer uma dessas classes base são configuráveis, te permitindo usar os atributos específicos que você queira. Você pode facilmente preparar um modelo para treinamento ou modificar um modelo pré-treinado com poucas mudanças.",is,it,ps;return Z=new Se({}),ae=new Se({}),ne=new C({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}}),pe=new C({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}}),ue=new C({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIlMkMlMjBhY3RpdmF0aW9uJTNEJTIycmVsdSUyMiUyQyUyMGF0dGVudGlvbl9kcm9wb3V0JTNEMC40KQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>my_config = DistilBertConfig.from_pretrained(<span class="hljs-string">&quot;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}}),de=new C({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}}),he=new C({props:{code:"bXlfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIyLiUyRnlvdXJfbW9kZWxfc2F2ZV9wYXRoJTJGbXlfY29uZmlnLmpzb24lMjIp",highlighted:'<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>)',wrap:!1}}),L=new hs({props:{$$slots:{default:[ha]},$$scope:{ctx:x}}}),ge=new Se({}),P=new pa({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ya],pytorch:[$a]},$$scope:{ctx:x}}}),ve=new Se({}),S=new pa({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ma],pytorch:[ja]},$$scope:{ctx:x}}}),be=new Se({}),D=new hs({props:{warning:!0,$$slots:{default:[qa]},$$scope:{ctx:x}}}),we=new C({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}}),Te=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXIlMEElMEFzbG93X3Rva2VuaXplciUyMCUzRCUyMERpc3RpbEJlcnRUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKQ==",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-base-uncased&quot;</span>)`,wrap:!1}}),xe=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpc3RpbEJlcnRUb2tlbml6ZXJGYXN0JTBBJTBBZmFzdF90b2tlbml6ZXIlMjAlM0QlMjBEaXN0aWxCZXJ0VG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIp",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-base-uncased&quot;</span>)`,wrap:!1}}),K=new hs({props:{$$slots:{default:[wa]},$$scope:{ctx:x}}}),Ce=new Se({}),Ve=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEZlYXR1cmVFeHRyYWN0b3IlMEElMEF2aXRfZXh0cmFjdG9yJTIwJTNEJTIwVmlURmVhdHVyZUV4dHJhY3RvcigpJTBBcHJpbnQodml0X2V4dHJhY3Rvcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>vit_extractor = ViTFeatureExtractor()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(vit_extractor)
ViTFeatureExtractor {
  <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;feature_extractor_type&quot;</span>: <span class="hljs-string">&quot;ViTFeatureExtractor&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}}),ee=new hs({props:{$$slots:{default:[ka]},$$scope:{ctx:x}}}),We=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpVEZlYXR1cmVFeHRyYWN0b3IlMEElMEFteV92aXRfZXh0cmFjdG9yJTIwJTNEJTIwVmlURmVhdHVyZUV4dHJhY3RvcihyZXNhbXBsZSUzRCUyMlBJTC5JbWFnZS5CT1glMjIlMkMlMjBkb19ub3JtYWxpemUlM0RGYWxzZSUyQyUyMGltYWdlX21lYW4lM0QlNUIwLjMlMkMlMjAwLjMlMkMlMjAwLjMlNUQpJTBBcHJpbnQobXlfdml0X2V4dHJhY3Rvcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViTFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>my_vit_extractor = ViTFeatureExtractor(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)
ViTFeatureExtractor {
  <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;feature_extractor_type&quot;</span>: <span class="hljs-string">&quot;ViTFeatureExtractor&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}}),Ee=new C({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}}),Ge=new Se({}),Xe=new C({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}}),Ye=new C({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}}),Le=new C({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}}),{c(){o=p("meta"),f=l(),r=p("p"),u=l(),h=p("h1"),_=p("a"),W=p("span"),g(Z.$$.fragment),w=l(),J=p("span"),J.textContent=c,M=l(),U=p("p"),U.innerHTML=V,F=l(),E=p("ul"),E.innerHTML=R,G=l(),n=p("h2"),q=p("a"),st=p("span"),g(ae.$$.fragment),$s=l(),Ae=p("span"),Ae.textContent=Ms,dt=l(),oe=p("p"),oe.innerHTML=qs,ft=l(),re=p("p"),re.innerHTML=ws,ht=l(),g(ne.$$.fragment),gt=l(),le=p("p"),le.innerHTML=ks,$t=l(),ie=p("ul"),ie.innerHTML=Ts,vt=l(),g(pe.$$.fragment),yt=l(),me=p("p"),me.innerHTML=Zs,bt=l(),g(ue.$$.fragment),jt=l(),ce=p("p"),ce.innerHTML=xs,_t=l(),g(de.$$.fragment),Mt=l(),fe=p("p"),fe.innerHTML=Cs,qt=l(),g(he.$$.fragment),wt=l(),g(L.$$.fragment),kt=l(),H=p("h2"),Q=p("a"),at=p("span"),g(ge.$$.fragment),vs=l(),De=p("span"),De.textContent=zs,Tt=l(),$e=p("p"),$e.innerHTML=Js,Zt=l(),g(P.$$.fragment),xt=l(),X=p("h3"),I=p("a"),ot=p("span"),g(ve.$$.fragment),ys=l(),Ke=p("span"),Ke.textContent=Vs,Ct=l(),ye=p("p"),ye.innerHTML=Rs,zt=l(),g(S.$$.fragment),Jt=l(),B=p("h2"),A=p("a"),rt=p("span"),g(be.$$.fragment),bs=l(),Oe=p("span"),Oe.textContent=Ws,Vt=l(),je=p("p"),je.innerHTML=Us,Rt=l(),_e=p("ul"),_e.innerHTML=Es,Wt=l(),Me=p("p"),Me.textContent=Gs,Ut=l(),g(D.$$.fragment),Et=l(),qe=p("p"),qe.innerHTML=Fs,Gt=l(),g(we.$$.fragment),Ft=l(),ke=p("p"),ke.innerHTML=Hs,Ht=l(),g(Te.$$.fragment),Xt=l(),Ze=p("p"),Ze.innerHTML=Xs,Bt=l(),g(xe.$$.fragment),Yt=l(),g(K.$$.fragment),Nt=l(),Y=p("h2"),O=p("a"),nt=p("span"),g(Ce.$$.fragment),js=l(),et=p("span"),et.textContent=Bs,Lt=l(),ze=p("p"),ze.innerHTML=Ys,Qt=l(),Je=p("p"),Je.innerHTML=Ns,Pt=l(),g(Ve.$$.fragment),It=l(),g(ee.$$.fragment),St=l(),Re=p("p"),Re.innerHTML=Ls,At=l(),g(We.$$.fragment),Dt=l(),Ue=p("p"),Ue.innerHTML=Qs,Kt=l(),g(Ee.$$.fragment),Ot=l(),N=p("h2"),te=p("a"),lt=p("span"),g(Ge.$$.fragment),_s=l(),tt=p("span"),tt.textContent=Ps,es=l(),Fe=p("p"),Fe.innerHTML=Is,ts=l(),He=p("p"),He.textContent=Ss,ss=l(),g(Xe.$$.fragment),as=l(),Be=p("p"),Be.textContent=As,os=l(),g(Ye.$$.fragment),rs=l(),Ne=p("p"),Ne.innerHTML=Ds,ns=l(),g(Le.$$.fragment),ls=l(),Qe=p("p"),Qe.textContent=Ks,is=l(),it=p("p"),this.h()},l(e){const s=fa("svelte-1phssyn",document.head);o=m(s,"META",{name:!0,content:!0}),s.forEach(t),f=i(e),r=m(e,"P",{}),z(r).forEach(t),u=i(e),h=m(e,"H1",{class:!0});var Pe=z(h);_=m(Pe,"A",{id:!0,class:!0,href:!0});var pt=z(_);W=m(pt,"SPAN",{});var mt=z(W);$(Z.$$.fragment,mt),mt.forEach(t),pt.forEach(t),w=i(Pe),J=m(Pe,"SPAN",{"data-svelte-h":!0}),d(J)!=="svelte-1a1me10"&&(J.textContent=c),Pe.forEach(t),M=i(e),U=m(e,"P",{"data-svelte-h":!0}),d(U)!=="svelte-m9o5vy"&&(U.innerHTML=V),F=i(e),E=m(e,"UL",{"data-svelte-h":!0}),d(E)!=="svelte-kgsom1"&&(E.innerHTML=R),G=i(e),n=m(e,"H2",{class:!0});var Ie=z(n);q=m(Ie,"A",{id:!0,class:!0,href:!0});var ut=z(q);st=m(ut,"SPAN",{});var ct=z(st);$(ae.$$.fragment,ct),ct.forEach(t),ut.forEach(t),$s=i(Ie),Ae=m(Ie,"SPAN",{"data-svelte-h":!0}),d(Ae)!=="svelte-108c6l9"&&(Ae.textContent=Ms),Ie.forEach(t),dt=i(e),oe=m(e,"P",{"data-svelte-h":!0}),d(oe)!=="svelte-n6qi8b"&&(oe.innerHTML=qs),ft=i(e),re=m(e,"P",{"data-svelte-h":!0}),d(re)!=="svelte-1d3fcvh"&&(re.innerHTML=ws),ht=i(e),$(ne.$$.fragment,e),gt=i(e),le=m(e,"P",{"data-svelte-h":!0}),d(le)!=="svelte-ig73dh"&&(le.innerHTML=ks),$t=i(e),ie=m(e,"UL",{"data-svelte-h":!0}),d(ie)!=="svelte-18hur0b"&&(ie.innerHTML=Ts),vt=i(e),$(pe.$$.fragment,e),yt=i(e),me=m(e,"P",{"data-svelte-h":!0}),d(me)!=="svelte-1hyxcvd"&&(me.innerHTML=Zs),bt=i(e),$(ue.$$.fragment,e),jt=i(e),ce=m(e,"P",{"data-svelte-h":!0}),d(ce)!=="svelte-xw156x"&&(ce.innerHTML=xs),_t=i(e),$(de.$$.fragment,e),Mt=i(e),fe=m(e,"P",{"data-svelte-h":!0}),d(fe)!=="svelte-gyvtpp"&&(fe.innerHTML=Cs),qt=i(e),$(he.$$.fragment,e),wt=i(e),$(L.$$.fragment,e),kt=i(e),H=m(e,"H2",{class:!0});var ms=z(H);Q=m(ms,"A",{id:!0,class:!0,href:!0});var Os=z(Q);at=m(Os,"SPAN",{});var ea=z(at);$(ge.$$.fragment,ea),ea.forEach(t),Os.forEach(t),vs=i(ms),De=m(ms,"SPAN",{"data-svelte-h":!0}),d(De)!=="svelte-jqsalz"&&(De.textContent=zs),ms.forEach(t),Tt=i(e),$e=m(e,"P",{"data-svelte-h":!0}),d($e)!=="svelte-3mhrf6"&&($e.innerHTML=Js),Zt=i(e),$(P.$$.fragment,e),xt=i(e),X=m(e,"H3",{class:!0});var us=z(X);I=m(us,"A",{id:!0,class:!0,href:!0});var ta=z(I);ot=m(ta,"SPAN",{});var sa=z(ot);$(ve.$$.fragment,sa),sa.forEach(t),ta.forEach(t),ys=i(us),Ke=m(us,"SPAN",{"data-svelte-h":!0}),d(Ke)!=="svelte-19k7bkp"&&(Ke.textContent=Vs),us.forEach(t),Ct=i(e),ye=m(e,"P",{"data-svelte-h":!0}),d(ye)!=="svelte-1lm563h"&&(ye.innerHTML=Rs),zt=i(e),$(S.$$.fragment,e),Jt=i(e),B=m(e,"H2",{class:!0});var cs=z(B);A=m(cs,"A",{id:!0,class:!0,href:!0});var aa=z(A);rt=m(aa,"SPAN",{});var oa=z(rt);$(be.$$.fragment,oa),oa.forEach(t),aa.forEach(t),bs=i(cs),Oe=m(cs,"SPAN",{"data-svelte-h":!0}),d(Oe)!=="svelte-1txg6py"&&(Oe.textContent=Ws),cs.forEach(t),Vt=i(e),je=m(e,"P",{"data-svelte-h":!0}),d(je)!=="svelte-1umelbs"&&(je.innerHTML=Us),Rt=i(e),_e=m(e,"UL",{"data-svelte-h":!0}),d(_e)!=="svelte-1ety8m7"&&(_e.innerHTML=Es),Wt=i(e),Me=m(e,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-aut08s"&&(Me.textContent=Gs),Ut=i(e),$(D.$$.fragment,e),Et=i(e),qe=m(e,"P",{"data-svelte-h":!0}),d(qe)!=="svelte-1h3oxa5"&&(qe.innerHTML=Fs),Gt=i(e),$(we.$$.fragment,e),Ft=i(e),ke=m(e,"P",{"data-svelte-h":!0}),d(ke)!=="svelte-2eztm5"&&(ke.innerHTML=Hs),Ht=i(e),$(Te.$$.fragment,e),Xt=i(e),Ze=m(e,"P",{"data-svelte-h":!0}),d(Ze)!=="svelte-1v580rz"&&(Ze.innerHTML=Xs),Bt=i(e),$(xe.$$.fragment,e),Yt=i(e),$(K.$$.fragment,e),Nt=i(e),Y=m(e,"H2",{class:!0});var ds=z(Y);O=m(ds,"A",{id:!0,class:!0,href:!0});var ra=z(O);nt=m(ra,"SPAN",{});var na=z(nt);$(Ce.$$.fragment,na),na.forEach(t),ra.forEach(t),js=i(ds),et=m(ds,"SPAN",{"data-svelte-h":!0}),d(et)!=="svelte-1c3zdi2"&&(et.textContent=Bs),ds.forEach(t),Lt=i(e),ze=m(e,"P",{"data-svelte-h":!0}),d(ze)!=="svelte-1t9u1z8"&&(ze.innerHTML=Ys),Qt=i(e),Je=m(e,"P",{"data-svelte-h":!0}),d(Je)!=="svelte-hk2gfs"&&(Je.innerHTML=Ns),Pt=i(e),$(Ve.$$.fragment,e),It=i(e),$(ee.$$.fragment,e),St=i(e),Re=m(e,"P",{"data-svelte-h":!0}),d(Re)!=="svelte-1g3d390"&&(Re.innerHTML=Ls),At=i(e),$(We.$$.fragment,e),Dt=i(e),Ue=m(e,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-93n9v0"&&(Ue.innerHTML=Qs),Kt=i(e),$(Ee.$$.fragment,e),Ot=i(e),N=m(e,"H2",{class:!0});var fs=z(N);te=m(fs,"A",{id:!0,class:!0,href:!0});var la=z(te);lt=m(la,"SPAN",{});var ia=z(lt);$(Ge.$$.fragment,ia),ia.forEach(t),la.forEach(t),_s=i(fs),tt=m(fs,"SPAN",{"data-svelte-h":!0}),d(tt)!=="svelte-12o5vu3"&&(tt.textContent=Ps),fs.forEach(t),es=i(e),Fe=m(e,"P",{"data-svelte-h":!0}),d(Fe)!=="svelte-1o1ieuf"&&(Fe.innerHTML=Is),ts=i(e),He=m(e,"P",{"data-svelte-h":!0}),d(He)!=="svelte-q3t4d0"&&(He.textContent=Ss),ss=i(e),$(Xe.$$.fragment,e),as=i(e),Be=m(e,"P",{"data-svelte-h":!0}),d(Be)!=="svelte-xtgcfb"&&(Be.textContent=As),os=i(e),$(Ye.$$.fragment,e),rs=i(e),Ne=m(e,"P",{"data-svelte-h":!0}),d(Ne)!=="svelte-nbytpq"&&(Ne.innerHTML=Ds),ns=i(e),$(Le.$$.fragment,e),ls=i(e),Qe=m(e,"P",{"data-svelte-h":!0}),d(Qe)!=="svelte-bza99h"&&(Qe.textContent=Ks),is=i(e),it=m(e,"P",{}),z(it).forEach(t),this.h()},h(){k(o,"name","hf:doc:metadata"),k(o,"content",JSON.stringify(Za)),k(_,"id","criar-uma-arquitetura-customizada"),k(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),k(_,"href","#criar-uma-arquitetura-customizada"),k(h,"class","relative group"),k(q,"id","configuration"),k(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),k(q,"href","#configuration"),k(n,"class","relative group"),k(Q,"id","modelo"),k(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),k(Q,"href","#modelo"),k(H,"class","relative group"),k(I,"id","heads-do-modelo"),k(I,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),k(I,"href","#heads-do-modelo"),k(X,"class","relative group"),k(A,"id","tokenizer"),k(A,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),k(A,"href","#tokenizer"),k(B,"class","relative group"),k(O,"id","extrator-de-features"),k(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),k(O,"href","#extrator-de-features"),k(Y,"class","relative group"),k(te,"id","processor"),k(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),k(te,"href","#processor"),k(N,"class","relative group")},m(e,s){T(document.head,o),a(e,f,s),a(e,r,s),a(e,u,s),a(e,h,s),T(h,_),T(_,W),v(Z,W,null),T(h,w),T(h,J),a(e,M,s),a(e,U,s),a(e,F,s),a(e,E,s),a(e,G,s),a(e,n,s),T(n,q),T(q,st),v(ae,st,null),T(n,$s),T(n,Ae),a(e,dt,s),a(e,oe,s),a(e,ft,s),a(e,re,s),a(e,ht,s),v(ne,e,s),a(e,gt,s),a(e,le,s),a(e,$t,s),a(e,ie,s),a(e,vt,s),v(pe,e,s),a(e,yt,s),a(e,me,s),a(e,bt,s),v(ue,e,s),a(e,jt,s),a(e,ce,s),a(e,_t,s),v(de,e,s),a(e,Mt,s),a(e,fe,s),a(e,qt,s),v(he,e,s),a(e,wt,s),v(L,e,s),a(e,kt,s),a(e,H,s),T(H,Q),T(Q,at),v(ge,at,null),T(H,vs),T(H,De),a(e,Tt,s),a(e,$e,s),a(e,Zt,s),v(P,e,s),a(e,xt,s),a(e,X,s),T(X,I),T(I,ot),v(ve,ot,null),T(X,ys),T(X,Ke),a(e,Ct,s),a(e,ye,s),a(e,zt,s),v(S,e,s),a(e,Jt,s),a(e,B,s),T(B,A),T(A,rt),v(be,rt,null),T(B,bs),T(B,Oe),a(e,Vt,s),a(e,je,s),a(e,Rt,s),a(e,_e,s),a(e,Wt,s),a(e,Me,s),a(e,Ut,s),v(D,e,s),a(e,Et,s),a(e,qe,s),a(e,Gt,s),v(we,e,s),a(e,Ft,s),a(e,ke,s),a(e,Ht,s),v(Te,e,s),a(e,Xt,s),a(e,Ze,s),a(e,Bt,s),v(xe,e,s),a(e,Yt,s),v(K,e,s),a(e,Nt,s),a(e,Y,s),T(Y,O),T(O,nt),v(Ce,nt,null),T(Y,js),T(Y,et),a(e,Lt,s),a(e,ze,s),a(e,Qt,s),a(e,Je,s),a(e,Pt,s),v(Ve,e,s),a(e,It,s),v(ee,e,s),a(e,St,s),a(e,Re,s),a(e,At,s),v(We,e,s),a(e,Dt,s),a(e,Ue,s),a(e,Kt,s),v(Ee,e,s),a(e,Ot,s),a(e,N,s),T(N,te),T(te,lt),v(Ge,lt,null),T(N,_s),T(N,tt),a(e,es,s),a(e,Fe,s),a(e,ts,s),a(e,He,s),a(e,ss,s),v(Xe,e,s),a(e,as,s),a(e,Be,s),a(e,os,s),v(Ye,e,s),a(e,rs,s),a(e,Ne,s),a(e,ns,s),v(Le,e,s),a(e,ls,s),a(e,Qe,s),a(e,is,s),a(e,it,s),ps=!0},p(e,[s]){const Pe={};s&2&&(Pe.$$scope={dirty:s,ctx:e}),L.$set(Pe);const pt={};s&2&&(pt.$$scope={dirty:s,ctx:e}),P.$set(pt);const mt={};s&2&&(mt.$$scope={dirty:s,ctx:e}),S.$set(mt);const Ie={};s&2&&(Ie.$$scope={dirty:s,ctx:e}),D.$set(Ie);const ut={};s&2&&(ut.$$scope={dirty:s,ctx:e}),K.$set(ut);const ct={};s&2&&(ct.$$scope={dirty:s,ctx:e}),ee.$set(ct)},i(e){ps||(y(Z.$$.fragment,e),y(ae.$$.fragment,e),y(ne.$$.fragment,e),y(pe.$$.fragment,e),y(ue.$$.fragment,e),y(de.$$.fragment,e),y(he.$$.fragment,e),y(L.$$.fragment,e),y(ge.$$.fragment,e),y(P.$$.fragment,e),y(ve.$$.fragment,e),y(S.$$.fragment,e),y(be.$$.fragment,e),y(D.$$.fragment,e),y(we.$$.fragment,e),y(Te.$$.fragment,e),y(xe.$$.fragment,e),y(K.$$.fragment,e),y(Ce.$$.fragment,e),y(Ve.$$.fragment,e),y(ee.$$.fragment,e),y(We.$$.fragment,e),y(Ee.$$.fragment,e),y(Ge.$$.fragment,e),y(Xe.$$.fragment,e),y(Ye.$$.fragment,e),y(Le.$$.fragment,e),ps=!0)},o(e){b(Z.$$.fragment,e),b(ae.$$.fragment,e),b(ne.$$.fragment,e),b(pe.$$.fragment,e),b(ue.$$.fragment,e),b(de.$$.fragment,e),b(he.$$.fragment,e),b(L.$$.fragment,e),b(ge.$$.fragment,e),b(P.$$.fragment,e),b(ve.$$.fragment,e),b(S.$$.fragment,e),b(be.$$.fragment,e),b(D.$$.fragment,e),b(we.$$.fragment,e),b(Te.$$.fragment,e),b(xe.$$.fragment,e),b(K.$$.fragment,e),b(Ce.$$.fragment,e),b(Ve.$$.fragment,e),b(ee.$$.fragment,e),b(We.$$.fragment,e),b(Ee.$$.fragment,e),b(Ge.$$.fragment,e),b(Xe.$$.fragment,e),b(Ye.$$.fragment,e),b(Le.$$.fragment,e),ps=!1},d(e){e&&(t(f),t(r),t(u),t(h),t(M),t(U),t(F),t(E),t(G),t(n),t(dt),t(oe),t(ft),t(re),t(ht),t(gt),t(le),t($t),t(ie),t(vt),t(yt),t(me),t(bt),t(jt),t(ce),t(_t),t(Mt),t(fe),t(qt),t(wt),t(kt),t(H),t(Tt),t($e),t(Zt),t(xt),t(X),t(Ct),t(ye),t(zt),t(Jt),t(B),t(Vt),t(je),t(Rt),t(_e),t(Wt),t(Me),t(Ut),t(Et),t(qe),t(Gt),t(Ft),t(ke),t(Ht),t(Xt),t(Ze),t(Bt),t(Yt),t(Nt),t(Y),t(Lt),t(ze),t(Qt),t(Je),t(Pt),t(It),t(St),t(Re),t(At),t(Dt),t(Ue),t(Kt),t(Ot),t(N),t(es),t(Fe),t(ts),t(He),t(ss),t(as),t(Be),t(os),t(rs),t(Ne),t(ns),t(ls),t(Qe),t(is),t(it)),t(o),j(Z),j(ae),j(ne,e),j(pe,e),j(ue,e),j(de,e),j(he,e),j(L,e),j(ge),j(P,e),j(ve),j(S,e),j(be),j(D,e),j(we,e),j(Te,e),j(xe,e),j(K,e),j(Ce),j(Ve,e),j(ee,e),j(We,e),j(Ee,e),j(Ge),j(Xe,e),j(Ye,e),j(Le,e)}}}const Za={local:"criar-uma-arquitetura-customizada",sections:[{local:"configuration",title:"configuration"},{local:"modelo",sections:[{local:"heads-do-modelo",title:"Heads do modelo"}],title:"Modelo"},{local:"tokenizer",title:"Tokenizer"},{local:"extrator-de-features",title:"Extrator de features"},{local:"processor",title:"Processor"}],title:"Criar uma arquitetura customizada"};function xa(x){return ua(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ua extends ca{constructor(o){super(),da(this,o,xa,Ta,ma,{})}}export{Ua as component};
