import{s as Il,o as Wl,n as jt}from"../chunks/scheduler.d586627e.js";import{S as Bl,i as Xl,g as n,s as l,u as m,A as Rl,h as r,f as a,c as o,j as b,v as c,y as p,k as y,o as j,a as s,w as u,d as M,t as f,x as h}from"../chunks/index.b757c891.js";import{T as yt}from"../chunks/Tip.4380e997.js";import{I as P}from"../chunks/IconCopyLink.c074b82b.js";import{C as v}from"../chunks/CodeBlock.aa8a1a9b.js";function El(U){let i,g=`Uma vez exportado, um modelo pode ser otimizado para inferência por meio de técnicas como
quantização e poda. Se você estiver interessado em otimizar seus modelos para serem executados com
máxima eficiência, confira a biblioteca <a href="https://github.com/huggingface/optimum" rel="nofollow">🤗 Optimum
</a>.`;return{c(){i=n("p"),i.innerHTML=g},l(d){i=r(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-17ryloz"&&(i.innerHTML=g)},m(d,w){s(d,i,w)},p:jt,d(d){d&&a(i)}}}function Gl(U){let i,g=`Os recursos que têm um sufixo <code>with-pass</code> (como <code>causal-lm-with-pass</code>) correspondem a
classes de modelo com estados ocultos pré-computados (chave e valores nos blocos de atenção)
que pode ser usado para decodificação autorregressiva rápida.`;return{c(){i=n("p"),i.innerHTML=g},l(d){i=r(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-frt6wh"&&(i.innerHTML=g)},m(d,w){s(d,i,w)},p:jt,d(d){d&&a(i)}}}function ql(U){let i,g=`Para modelos do tipo <code>VisionEncoderDecoder</code>, as partes do codificador e do decodificador são
exportados separadamente como dois arquivos ONNX chamados <code>encoder_model.onnx</code> e <code>decoder_model.onnx</code> respectivamente.`;return{c(){i=n("p"),i.innerHTML=g},l(d){i=r(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-7aqol8"&&(i.innerHTML=g)},m(d,w){s(d,i,w)},p:jt,d(d){d&&a(i)}}}function Vl(U){let i,g=`Uma boa maneira de implementar uma configuração ONNX personalizada é observar as
implementação no arquivo <code>configuration_&lt;model_name&gt;.py</code> de uma arquitetura semelhante.`;return{c(){i=n("p"),i.innerHTML=g},l(d){i=r(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-10qekhj"&&(i.innerHTML=g)},m(d,w){s(d,i,w)},p:jt,d(d){d&&a(i)}}}function Hl(U){let i,g=`Notice that <code>inputs</code> property for <code>DistilBertOnnxConfig</code> returns an <code>OrderedDict</code>. This
ensures that the inputs are matched with their relative position within the
<code>PreTrainedModel.forward()</code> method when tracing the graph. We recommend using an
<code>OrderedDict</code> for the <code>inputs</code> and <code>outputs</code> properties when implementing custom ONNX
configurations.`,d,w,C=`Observe que a propriedade <code>inputs</code> para <code>DistilBertOnnxConfig</code> retorna um <code>OrderedDict</code>. Este
garante que as entradas sejam combinadas com sua posição relativa dentro do
método <code>PreTrainedModel.forward()</code> ao traçar o grafo. Recomendamos o uso de um
<code>OrderedDict</code> para as propriedades <code>inputs</code> e <code>outputs</code> ao implementar configurações personalizadas ONNX.`;return{c(){i=n("p"),i.innerHTML=g,d=l(),w=n("p"),w.innerHTML=C},l(T){i=r(T,"P",{"data-svelte-h":!0}),p(i)!=="svelte-14shdz8"&&(i.innerHTML=g),d=o(T),w=r(T,"P",{"data-svelte-h":!0}),p(w)!=="svelte-ts6haw"&&(w.innerHTML=C)},m(T,$){s(T,i,$),s(T,d,$),s(T,w,$)},p:jt,d(T){T&&(a(i),a(d),a(w))}}}function Ll(U){let i,g=`Todas as propriedades e métodos básicos associados a <code>OnnxConfig</code> e
as outras classes de configuração podem ser substituídas se necessário. Confira <code>BartOnnxConfig</code>
para um exemplo avançado.`;return{c(){i=n("p"),i.innerHTML=g},l(d){i=r(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-js6ttx"&&(i.innerHTML=g)},m(d,w){s(d,i,w)},p:jt,d(d){d&&a(i)}}}function zl(U){let i,g=`Se o seu modelo for maior que 2GB, você verá que muitos arquivos adicionais são criados
durante a exportação. Isso é <em>esperado</em> porque o ONNX usa <a href="https://developers.google.com/protocol-buffers/" rel="nofollow">Protocol
Buffers</a> para armazenar o modelo e estes
têm um limite de tamanho de 2GB. Veja a <a href="https://github.com/onnx/onnx/blob/master/docs/ExternalData.md" rel="nofollow">ONNX
documentação</a> para
instruções sobre como carregar modelos com dados externos.`;return{c(){i=n("p"),i.innerHTML=g},l(d){i=r(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-1iua1gz"&&(i.innerHTML=g)},m(d,w){s(d,i,w)},p:jt,d(d){d&&a(i)}}}function Fl(U){let i,g,d,w,C,T,$,S,ys,bt,Cs="Exportando modelos para ONNX",Et,O,$s=`Se você precisar implantar modelos 🤗 Transformers em ambientes de produção, recomendamos
exporta-los para um formato serializado que pode ser carregado e executado em
tempos de execução e hardware. Neste guia, mostraremos como exportar modelos 🤗 Transformers
para <a href="http://onnx.ai" rel="nofollow">ONNX (Open Neural Network eXchange)</a>.`,Gt,I,qt,Y,xs=`ONNX é um padrão aberto que define um conjunto comum de operadores e um formato de arquivo comum
para representar modelos de aprendizado profundo em uma ampla variedade de estruturas, incluindo PyTorch e
TensorFlow. Quando um modelo é exportado para o formato ONNX, esses operadores são usados para
construir um grafo computacional (muitas vezes chamado de <em>representação intermediária</em>) que
representa o fluxo de dados através da rede neural.`,Vt,D,Js=`Ao expor um grafo com operadores e tipos de dados padronizados, o ONNX facilita a
alternar entre os frameworks. Por exemplo, um modelo treinado em PyTorch pode ser exportado para
formato ONNX e depois importado no TensorFlow (e vice-versa).`,Ht,K,Zs=`🤗 Transformers fornece um pacote <a href="main_classes/onnx"><code>transformers.onnx</code></a> que permite
que você converta os checkpoints do modelo em um grafo ONNX aproveitando os objetos de configuração.
Esses objetos de configuração vêm prontos para várias arquiteturas de modelo e são
projetado para ser facilmente extensível a outras arquiteturas.`,Lt,ee,ks="As configurações prontas incluem as seguintes arquiteturas:",zt,te,As="<li>ALBERT</li> <li>BART</li> <li>BEiT</li> <li>BERT</li> <li>BigBird</li> <li>BigBird-Pegasus</li> <li>Blenderbot</li> <li>BlenderbotSmall</li> <li>BLOOM</li> <li>CamemBERT</li> <li>CLIP</li> <li>CodeGen</li> <li>Conditional DETR</li> <li>ConvBERT</li> <li>ConvNeXT</li> <li>ConvNeXTV2</li> <li>Data2VecText</li> <li>Data2VecVision</li> <li>DeBERTa</li> <li>DeBERTa-v2</li> <li>DeiT</li> <li>DETR</li> <li>DistilBERT</li> <li>ELECTRA</li> <li>ERNIE</li> <li>FlauBERT</li> <li>GPT Neo</li> <li>GPT-J</li> <li>GroupViT</li> <li>I-BERT</li> <li>LayoutLM</li> <li>LayoutLMv3</li> <li>LeViT</li> <li>Longformer</li> <li>LongT5</li> <li>M2M100</li> <li>Marian</li> <li>mBART</li> <li>MobileBERT</li> <li>MobileViT</li> <li>MT5</li> <li>OpenAI GPT-2</li> <li>OWL-ViT</li> <li>Perceiver</li> <li>PLBart</li> <li>ResNet</li> <li>RoBERTa</li> <li>RoFormer</li> <li>SegFormer</li> <li>SqueezeBERT</li> <li>Swin Transformer</li> <li>T5</li> <li>Table Transformer</li> <li>Vision Encoder decoder</li> <li>ViT</li> <li>XLM</li> <li>XLM-RoBERTa</li> <li>XLM-RoBERTa-XL</li> <li>YOLOS</li>",Ft,ae,Ns="Nas próximas duas seções, mostraremos como:",Qt,se,_s="<li>Exportar um modelo suportado usando o pacote <code>transformers.onnx</code>.</li> <li>Exportar um modelo personalizado para uma arquitetura sem suporte.</li>",Pt,x,W,xt,le,js,gt,Is="Exportando um modelo para ONNX",St,oe,Ws=`Para exportar um modelo 🤗 Transformers para o ONNX, primeiro você precisa instalar algumas
dependências extras:`,Ot,ne,Yt,re,Bs="O pacote <code>transformers.onnx</code> pode então ser usado como um módulo Python:",Dt,ie,Kt,pe,Xs="A exportação de um checkpoint usando uma configuração pronta pode ser feita da seguinte forma:",ea,de,ta,me,Rs="Você deve ver os seguintes logs:",aa,ce,sa,ue,Es=`Isso exporta um grafo ONNX do ponto de verificação definido pelo argumento <code>--model</code>. Nisso
Por exemplo, é <code>distilbert-base-uncased</code>, mas pode ser qualquer checkpoint no Hugging
Face Hub ou um armazenado localmente.`,la,Me,Gs=`O arquivo <code>model.onnx</code> resultante pode ser executado em um dos <a href="https://onnx.ai/supported-tools.html#deployModel" rel="nofollow">muitos
aceleradores</a> que suportam o ONNX
padrão. Por exemplo, podemos carregar e executar o modelo com <a href="https://onnxruntime.ai/" rel="nofollow">ONNX
Tempo de execução</a> da seguinte forma:`,oa,fe,na,he,qs=`Os nomes de saída necessários (como <code>[&quot;last_hidden_state&quot;]</code>) podem ser obtidos pegando uma
configuração ONNX de cada modelo. Por exemplo, para DistilBERT temos:`,ra,ye,ia,je,Vs=`O processo é idêntico para os checkpoints do TensorFlow no Hub. Por exemplo, podemos
exportar um checkpoint TensorFlow puro do <a href="https://huggingface.co/keras-io" rel="nofollow">Keras</a> da seguinte forma:`,pa,be,da,ge,Hs=`Para exportar um modelo armazenado localmente, você precisará ter os pesos e
arquivos tokenizer armazenados em um diretório. Por exemplo, podemos carregar e salvar um checkpoint como:`,ma,we,ca,ve,Ls=`Uma vez que o checkpoint é salvo, podemos exportá-lo para o ONNX apontando o <code>--model</code>
argumento do pacote <code>transformers.onnx</code> para o diretório desejado:`,ua,Te,Ma,Ue,fa,Ce,zs=`Uma vez que o checkpoint é salvo, podemos exportá-lo para o ONNX apontando o <code>--model</code>
argumento do pacote <code>transformers.onnx</code> para o diretório desejado:`,ha,$e,ya,J,B,Jt,xe,bs,wt,Fs="Selecionando features para diferentes tarefas do modelo",ja,Je,Qs=`Cada configuração pronta vem com um conjunto de <em>features</em> que permitem exportar
modelos para diferentes tipos de tarefas. Conforme mostrado na tabela abaixo, cada recurso é
associado a uma <code>AutoClass</code> diferente:`,ba,Ze,Ps="<thead><tr><th>Feature</th> <th>Auto Class</th></tr></thead> <tbody><tr><td><code>causal-lm</code>, <code>causal-lm-with-past</code></td> <td><code>AutoModelForCausalLM</code></td></tr> <tr><td><code>default</code>, <code>default-with-past</code></td> <td><code>AutoModel</code></td></tr> <tr><td><code>masked-lm</code></td> <td><code>AutoModelForMaskedLM</code></td></tr> <tr><td><code>question-answering</code></td> <td><code>AutoModelForQuestionAnswering</code></td></tr> <tr><td><code>seq2seq-lm</code>, <code>seq2seq-lm-with-past</code></td> <td><code>AutoModelForSeq2SeqLM</code></td></tr> <tr><td><code>sequence-classification</code></td> <td><code>AutoModelForSequenceClassification</code></td></tr> <tr><td><code>token-classification</code></td> <td><code>AutoModelForTokenClassification</code></td></tr></tbody>",ga,ke,Ss=`Para cada configuração, você pode encontrar a lista de recursos suportados por meio do
<code>FeaturesManager</code>. Por exemplo, para DistilBERT temos:`,wa,Ae,va,Ne,Os=`Você pode então passar um desses recursos para o argumento <code>--feature</code> no
pacote <code>transformers.onnx</code>. Por exemplo, para exportar um modelo de classificação de texto, podemos
escolher um modelo ajustado no Hub e executar:`,Ta,_e,Ua,Ie,Ys="Isso exibe os seguintes logs:",Ca,We,$a,Be,Ds=`Observe que, neste caso, os nomes de saída do modelo ajustado são <code>logits</code>
em vez do <code>last_hidden_state</code> que vimos com o checkpoint <code>distilbert-base-uncased</code>
mais cedo. Isso é esperado, pois o modelo ajustado (fine-tuned) possui uma cabeça de classificação de sequência.`,xa,X,Ja,R,Za,Z,E,Zt,Xe,gs,vt,Ks="Exportando um modelo para uma arquitetura sem suporte",ka,Re,el=`Se você deseja exportar um modelo cuja arquitetura não é suportada nativamente pela
biblioteca, há três etapas principais a seguir:`,Aa,Ee,tl="<li>Implemente uma configuração ONNX personalizada.</li> <li>Exporte o modelo para o ONNX.</li> <li>Valide as saídas do PyTorch e dos modelos exportados.</li>",Na,Ge,al=`Nesta seção, veremos como o DistilBERT foi implementado para mostrar o que está envolvido
em cada passo.`,_a,k,G,kt,qe,ws,Tt,sl="Implementando uma configuração ONNX personalizada",Ia,Ve,ll=`Vamos começar com o objeto de configuração ONNX. Fornecemos três classes abstratas que
você deve herdar, dependendo do tipo de arquitetura de modelo que deseja exportar:`,Wa,He,ol="<li>Modelos baseados em codificador herdam de <code>OnnxConfig</code></li> <li>Modelos baseados em decodificador herdam de <code>OnnxConfigWithPast</code></li> <li>Os modelos codificador-decodificador herdam de <code>OnnxSeq2SeqConfigWithPast</code></li>",Ba,q,Xa,Le,nl=`Como o DistilBERT é um modelo baseado em codificador, sua configuração é herdada de
<code>OnnxConfig</code>:`,Ra,ze,Ea,Fe,rl=`Todo objeto de configuração deve implementar a propriedade <code>inputs</code> e retornar um mapeamento,
onde cada chave corresponde a uma entrada esperada e cada valor indica o eixo
dessa entrada. Para o DistilBERT, podemos ver que duas entradas são necessárias: <code>input_ids</code> e
<code>attention_mask</code>. Essas entradas têm a mesma forma de <code>(batch_size, sequence_length)</code>
é por isso que vemos os mesmos eixos usados na configuração.`,Ga,V,qa,Qe,il=`Depois de implementar uma configuração ONNX, você pode instanciá-la fornecendo a
configuração do modelo base da seguinte forma:`,Va,Pe,Ha,Se,pl=`O objeto resultante tem várias propriedades úteis. Por exemplo, você pode visualizar o conjunto de operadores ONNX
que será usado durante a exportação:`,La,Oe,za,Ye,dl="Você também pode visualizar as saídas associadas ao modelo da seguinte forma:",Fa,De,Qa,Ke,ml=`Observe que a propriedade outputs segue a mesma estrutura das entradas; ele retorna um
<code>OrderedDict</code> de saídas nomeadas e suas formas. A estrutura de saída está ligada a
escolha do recurso com o qual a configuração é inicializada. Por padrão, a configuração do ONNX
é inicializada com o recurso <code>default</code> que corresponde à exportação de um
modelo carregado com a classe <code>AutoModel</code>. Se você deseja exportar um modelo para outra tarefa,
apenas forneça um recurso diferente para o argumento <code>task</code> quando você inicializar a configuração ONNX
. Por exemplo, se quisermos exportar o DistilBERT com uma sequência
de classificação, poderíamos usar:`,Pa,et,Sa,H,Oa,A,L,At,tt,vs,Ut,cl="Exportando um modelo",Ya,at,ul=`Depois de ter implementado a configuração do ONNX, o próximo passo é exportar o modelo.
Aqui podemos usar a função <code>export()</code> fornecida pelo pacote <code>transformers.onnx</code>.
Esta função espera a configuração do ONNX, juntamente com o modelo base e o tokenizer,
e o caminho para salvar o arquivo exportado:`,Da,st,Ka,lt,Ml=`Os <code>onnx_inputs</code> e <code>onnx_outputs</code> retornados pela função <code>export()</code> são listas de
chaves definidas nas propriedades <code>inputs</code> e <code>outputs</code> da configuração. Uma vez que o
modelo é exportado, você pode testar se o modelo está bem formado da seguinte forma:`,es,ot,ts,z,as,N,F,Nt,nt,Ts,Ct,fl="Validando a saída dos modelos",ss,rt,hl=`A etapa final é validar se as saídas do modelo base e exportado concordam
dentro de alguma tolerância absoluta. Aqui podemos usar a função <code>validate_model_outputs()</code>
fornecida pelo pacote <code>transformers.onnx</code> da seguinte forma:`,ls,it,os,pt,yl=`Esta função usa o método <code>generate_dummy_inputs()</code> para
gerar entradas para o modelo base e o exportado, e a tolerância absoluta pode ser
definida na configuração. Geralmente encontramos concordância numérica em 1e-6 a 1e-4
de alcance, embora qualquer coisa menor que 1e-3 provavelmente esteja OK.`,ns,_,Q,_t,dt,Us,$t,jl="Contribuindo com uma nova configuração para 🤗 Transformers",rs,mt,bl=`Estamos procurando expandir o conjunto de configurações prontas e receber contribuições
da comunidade! Se você gostaria de contribuir para a biblioteca, você
precisará:`,is,ct,gl=`<li>Implemente a configuração do ONNX no arquivo <code>configuration_&lt;model_name&gt;.py</code> correspondente
Arquivo</li> <li>Incluir a arquitetura do modelo e recursos correspondentes em
<code>~onnx.features.FeatureManager</code></li> <li>Adicione sua arquitetura de modelo aos testes em <code>test_onnx_v2.py</code></li>`,ps,ut,wl=`Confira como ficou a configuração do <a href="https://github.com/huggingface/transformers/pull/14868/files" rel="nofollow">IBERT</a> para obter uma
idéia do que está envolvido.`,ds,It,ms;return S=new P({}),I=new yt({props:{$$slots:{default:[El]},$$scope:{ctx:U}}}),le=new P({}),ne=new v({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyU1Qm9ubnglNUQ=",highlighted:"pip install transformers[onnx]",wrap:!1}}),ie=new v({props:{code:"cHl0aG9uJTIwLW0lMjB0cmFuc2Zvcm1lcnMub25ueCUyMC0taGVscCUwQSUwQXVzYWdlJTNBJTIwSHVnZ2luZyUyMEZhY2UlMjBUcmFuc2Zvcm1lcnMlMjBPTk5YJTIwZXhwb3J0ZXIlMjAlNUItaCU1RCUyMC1tJTIwTU9ERUwlMjAlNUItLWZlYXR1cmUlMjAlN0JjYXVzYWwtbG0lMkMlMjAuLi4lN0QlNUQlMjAlNUItLW9wc2V0JTIwT1BTRVQlNUQlMjAlNUItLWF0b2wlMjBBVE9MJTVEJTIwb3V0cHV0JTBBJTBBcG9zaXRpb25hbCUyMGFyZ3VtZW50cyUzQSUwQSUyMCUyMG91dHB1dCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFBhdGglMjBpbmRpY2F0aW5nJTIwd2hlcmUlMjB0byUyMHN0b3JlJTIwZ2VuZXJhdGVkJTIwT05OWCUyMG1vZGVsLiUwQSUwQW9wdGlvbmFsJTIwYXJndW1lbnRzJTNBJTBBJTIwJTIwLWglMkMlMjAtLWhlbHAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzaG93JTIwdGhpcyUyMGhlbHAlMjBtZXNzYWdlJTIwYW5kJTIwZXhpdCUwQSUyMCUyMC1tJTIwTU9ERUwlMkMlMjAtLW1vZGVsJTIwTU9ERUwlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBNb2RlbCUyMElEJTIwb24lMjBodWdnaW5nZmFjZS5jbyUyMG9yJTIwcGF0aCUyMG9uJTIwZGlzayUyMHRvJTIwbG9hZCUyMG1vZGVsJTIwZnJvbS4lMEElMjAlMjAtLWZlYXR1cmUlMjAlN0JjYXVzYWwtbG0lMkMlMjAuLi4lN0QlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBUaGUlMjB0eXBlJTIwb2YlMjBmZWF0dXJlcyUyMHRvJTIwZXhwb3J0JTIwdGhlJTIwbW9kZWwlMjB3aXRoLiUwQSUyMCUyMC0tb3BzZXQlMjBPUFNFVCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyME9OTlglMjBvcHNldCUyMHZlcnNpb24lMjB0byUyMGV4cG9ydCUyMHRoZSUyMG1vZGVsJTIwd2l0aC4lMEElMjAlMjAtLWF0b2wlMjBBVE9MJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwQWJzb2x1dGUlMjBkaWZmZXJlbmNlJTIwdG9sZXJhbmNlJTIwd2hlbiUyMHZhbGlkYXRpbmclMjB0aGUlMjBtb2RlbC4=",highlighted:`python -m transformers.onnx --<span class="hljs-built_in">help</span>

usage: Hugging Face Transformers ONNX exporter [-h] -m MODEL [--feature {causal-lm, ...}] [--opset OPSET] [--atol ATOL] output

positional arguments:
  output                Path indicating <span class="hljs-built_in">where</span> to store generated ONNX model.

optional arguments:
  -h, --<span class="hljs-built_in">help</span>            show this <span class="hljs-built_in">help</span> message and <span class="hljs-built_in">exit</span>
  -m MODEL, --model MODEL
                        Model ID on huggingface.co or path on disk to load model from.
  --feature {causal-lm, ...}
                        The <span class="hljs-built_in">type</span> of features to <span class="hljs-built_in">export</span> the model with.
  --opset OPSET         ONNX opset version to <span class="hljs-built_in">export</span> the model with.
  --atol ATOL           Absolute difference tolerance when validating the model.`,wrap:!1}}),de=new v({props:{code:"cHl0aG9uJTIwLW0lMjB0cmFuc2Zvcm1lcnMub25ueCUyMC0tbW9kZWwlM0RkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMG9ubnglMkY=",highlighted:"python -m transformers.onnx --model=distilbert-base-uncased onnx/",wrap:!1}}),ce=new v({props:{code:"VmFsaWRhdGluZyUyME9OTlglMjBtb2RlbC4uLiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC0lNUIlRTIlOUMlOTMlNUQlMjBPTk5YJTIwbW9kZWwlMjBvdXRwdXQlMjBuYW1lcyUyMG1hdGNoJTIwcmVmZXJlbmNlJTIwbW9kZWwlMjAoJTdCJ2xhc3RfaGlkZGVuX3N0YXRlJyU3RCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAtJTIwVmFsaWRhdGluZyUyME9OTlglMjBNb2RlbCUyMG91dHB1dCUyMCUyMmxhc3RfaGlkZGVuX3N0YXRlJTIyJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLSU1QiVFMiU5QyU5MyU1RCUyMCgyJTJDJTIwOCUyQyUyMDc2OCklMjBtYXRjaGVzJTIwKDIlMkMlMjA4JTJDJTIwNzY4KSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC0lNUIlRTIlOUMlOTMlNUQlMjBhbGwlMjB2YWx1ZXMlMjBjbG9zZSUyMChhdG9sJTNBJTIwMWUtMDUpJTBBQWxsJTIwZ29vZCUyQyUyMG1vZGVsJTIwc2F2ZWQlMjBhdCUzQSUyMG9ubnglMkZtb2RlbC5vbm54",highlighted:`Validating ONNX model...
        -[✓] ONNX model output names match reference model ({<span class="hljs-string">&#x27;last_hidden_state&#x27;</span>})
        - Validating ONNX Model output <span class="hljs-string">&quot;last_hidden_state&quot;</span>:
                -[✓] (2, 8, 768) matches (2, 8, 768)
                -[✓] all values close (atol: 1e-05)
All good, model saved at: onnx/model.onnx`,wrap:!1}}),fe=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEFmcm9tJTIwb25ueHJ1bnRpbWUlMjBpbXBvcnQlMjBJbmZlcmVuY2VTZXNzaW9uJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBc2Vzc2lvbiUyMCUzRCUyMEluZmVyZW5jZVNlc3Npb24oJTIyb25ueCUyRm1vZGVsLm9ubnglMjIpJTBBJTIzJTIwT05OWCUyMFJ1bnRpbWUlMjBleHBlY3RzJTIwTnVtUHklMjBhcnJheXMlMjBhcyUyMGlucHV0JTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlVzaW5nJTIwRGlzdGlsQkVSVCUyMHdpdGglMjBPTk5YJTIwUnVudGltZSElMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBzZXNzaW9uLnJ1bihvdXRwdXRfbmFtZXMlM0QlNUIlMjJsYXN0X2hpZGRlbl9zdGF0ZSUyMiU1RCUyQyUyMGlucHV0X2ZlZWQlM0RkaWN0KGlucHV0cykp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> onnxruntime <span class="hljs-keyword">import</span> InferenceSession

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>session = InferenceSession(<span class="hljs-string">&quot;onnx/model.onnx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># ONNX Runtime expects NumPy arrays as input</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Using DistilBERT with ONNX Runtime!&quot;</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = session.run(output_names=[<span class="hljs-string">&quot;last_hidden_state&quot;</span>], input_feed=<span class="hljs-built_in">dict</span>(inputs))`,wrap:!1}}),ye=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMuZGlzdGlsYmVydCUyMGltcG9ydCUyMERpc3RpbEJlcnRDb25maWclMkMlMjBEaXN0aWxCZXJ0T25ueENvbmZpZyUwQSUwQWNvbmZpZyUyMCUzRCUyMERpc3RpbEJlcnRDb25maWcoKSUwQW9ubnhfY29uZmlnJTIwJTNEJTIwRGlzdGlsQmVydE9ubnhDb25maWcoY29uZmlnKSUwQXByaW50KGxpc3Qob25ueF9jb25maWcub3V0cHV0cy5rZXlzKCkpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.distilbert <span class="hljs-keyword">import</span> DistilBertConfig, DistilBertOnnxConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>config = DistilBertConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_config = DistilBertOnnxConfig(config)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-built_in">list</span>(onnx_config.outputs.keys()))
[<span class="hljs-string">&quot;last_hidden_state&quot;</span>]`,wrap:!1}}),be=new v({props:{code:"cHl0aG9uJTIwLW0lMjB0cmFuc2Zvcm1lcnMub25ueCUyMC0tbW9kZWwlM0RrZXJhcy1pbyUyRnRyYW5zZm9ybWVycy1xYSUyMG9ubnglMkY=",highlighted:"python -m transformers.onnx --model=keras-io/transformers-qa onnx/",wrap:!1}}),we=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBJTBBJTIzJTIwTG9hZCUyMHRva2VuaXplciUyMGFuZCUyMFB5VG9yY2glMjB3ZWlnaHRzJTIwZm9ybSUyMHRoZSUyMEh1YiUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQXB0X21vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBJTIzJTIwU2F2ZSUyMHRvJTIwZGlzayUwQXRva2VuaXplci5zYXZlX3ByZXRyYWluZWQoJTIybG9jYWwtcHQtY2hlY2twb2ludCUyMiklMEFwdF9tb2RlbC5zYXZlX3ByZXRyYWluZWQoJTIybG9jYWwtcHQtY2hlY2twb2ludCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Load tokenizer and PyTorch weights form the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Save to disk</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.save_pretrained(<span class="hljs-string">&quot;local-pt-checkpoint&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pt_model.save_pretrained(<span class="hljs-string">&quot;local-pt-checkpoint&quot;</span>)`,wrap:!1}}),Te=new v({props:{code:"cHl0aG9uJTIwLW0lMjB0cmFuc2Zvcm1lcnMub25ueCUyMC0tbW9kZWwlM0Rsb2NhbC1wdC1jaGVja3BvaW50JTIwb25ueCUyRg==",highlighted:"python -m transformers.onnx --model=local-pt-checkpoint onnx/",wrap:!1}}),Ue=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEElMjMlMjBMb2FkJTIwdG9rZW5pemVyJTIwYW5kJTIwVGVuc29yRmxvdyUyMHdlaWdodHMlMjBmcm9tJTIwdGhlJTIwSHViJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQlMjIpJTBBdGZfbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyKSUwQSUyMyUyMFNhdmUlMjB0byUyMGRpc2slMEF0b2tlbml6ZXIuc2F2ZV9wcmV0cmFpbmVkKCUyMmxvY2FsLXRmLWNoZWNrcG9pbnQlMjIpJTBBdGZfbW9kZWwuc2F2ZV9wcmV0cmFpbmVkKCUyMmxvY2FsLXRmLWNoZWNrcG9pbnQlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Load tokenizer and TensorFlow weights from the Hub</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model = TFAutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Save to disk</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.save_pretrained(<span class="hljs-string">&quot;local-tf-checkpoint&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tf_model.save_pretrained(<span class="hljs-string">&quot;local-tf-checkpoint&quot;</span>)`,wrap:!1}}),$e=new v({props:{code:"cHl0aG9uJTIwLW0lMjB0cmFuc2Zvcm1lcnMub25ueCUyMC0tbW9kZWwlM0Rsb2NhbC10Zi1jaGVja3BvaW50JTIwb25ueCUyRg==",highlighted:"python -m transformers.onnx --model=local-tf-checkpoint onnx/",wrap:!1}}),xe=new P({}),Ae=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5vbm54LmZlYXR1cmVzJTIwaW1wb3J0JTIwRmVhdHVyZXNNYW5hZ2VyJTBBJTBBZGlzdGlsYmVydF9mZWF0dXJlcyUyMCUzRCUyMGxpc3QoRmVhdHVyZXNNYW5hZ2VyLmdldF9zdXBwb3J0ZWRfZmVhdHVyZXNfZm9yX21vZGVsX3R5cGUoJTIyZGlzdGlsYmVydCUyMikua2V5cygpKSUwQXByaW50KGRpc3RpbGJlcnRfZmVhdHVyZXMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.onnx.features <span class="hljs-keyword">import</span> FeaturesManager

<span class="hljs-meta">&gt;&gt;&gt; </span>distilbert_features = <span class="hljs-built_in">list</span>(FeaturesManager.get_supported_features_for_model_type(<span class="hljs-string">&quot;distilbert&quot;</span>).keys())
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(distilbert_features)
[<span class="hljs-string">&quot;default&quot;</span>, <span class="hljs-string">&quot;masked-lm&quot;</span>, <span class="hljs-string">&quot;causal-lm&quot;</span>, <span class="hljs-string">&quot;sequence-classification&quot;</span>, <span class="hljs-string">&quot;token-classification&quot;</span>, <span class="hljs-string">&quot;question-answering&quot;</span>]`,wrap:!1}}),_e=new v({props:{code:"cHl0aG9uJTIwLW0lMjB0cmFuc2Zvcm1lcnMub25ueCUyMC0tbW9kZWwlM0RkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZC1maW5ldHVuZWQtc3N0LTItZW5nbGlzaCUyMCU1QyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC0tZmVhdHVyZSUzRHNlcXVlbmNlLWNsYXNzaWZpY2F0aW9uJTIwb25ueCUyRg==",highlighted:`python -m transformers.onnx --model=distilbert-base-uncased-finetuned-sst-2-english \\
                            --feature=sequence-classification onnx/`,wrap:!1}}),We=new v({props:{code:"VmFsaWRhdGluZyUyME9OTlglMjBtb2RlbC4uLiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC0lNUIlRTIlOUMlOTMlNUQlMjBPTk5YJTIwbW9kZWwlMjBvdXRwdXQlMjBuYW1lcyUyMG1hdGNoJTIwcmVmZXJlbmNlJTIwbW9kZWwlMjAoJTdCJ2xvZ2l0cyclN0QpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLSUyMFZhbGlkYXRpbmclMjBPTk5YJTIwTW9kZWwlMjBvdXRwdXQlMjAlMjJsb2dpdHMlMjIlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAtJTVCJUUyJTlDJTkzJTVEJTIwKDIlMkMlMjAyKSUyMG1hdGNoZXMlMjAoMiUyQyUyMDIpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwLSU1QiVFMiU5QyU5MyU1RCUyMGFsbCUyMHZhbHVlcyUyMGNsb3NlJTIwKGF0b2wlM0ElMjAxZS0wNSklMEFBbGwlMjBnb29kJTJDJTIwbW9kZWwlMjBzYXZlZCUyMGF0JTNBJTIwb25ueCUyRm1vZGVsLm9ubng=",highlighted:`Validating ONNX model...
        -[✓] ONNX model output names match reference model ({<span class="hljs-string">&#x27;logits&#x27;</span>})
        - Validating ONNX Model output <span class="hljs-string">&quot;logits&quot;</span>:
                -[✓] (2, 2) matches (2, 2)
                -[✓] all values close (atol: 1e-05)
All good, model saved at: onnx/model.onnx`,wrap:!1}}),X=new yt({props:{$$slots:{default:[Gl]},$$scope:{ctx:U}}}),R=new yt({props:{$$slots:{default:[ql]},$$scope:{ctx:U}}}),Xe=new P({}),qe=new P({}),q=new yt({props:{$$slots:{default:[Vl]},$$scope:{ctx:U}}}),ze=new v({props:{code:"ZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyME1hcHBpbmclMkMlMjBPcmRlcmVkRGljdCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMub25ueCUyMGltcG9ydCUyME9ubnhDb25maWclMEElMEElMEFjbGFzcyUyMERpc3RpbEJlcnRPbm54Q29uZmlnKE9ubnhDb25maWcpJTNBJTBBJTIwJTIwJTIwJTIwJTQwcHJvcGVydHklMEElMjAlMjAlMjAlMjBkZWYlMjBpbnB1dHMoc2VsZiklMjAtJTNFJTIwTWFwcGluZyU1QnN0ciUyQyUyME1hcHBpbmclNUJpbnQlMkMlMjBzdHIlNUQlNUQlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBPcmRlcmVkRGljdCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAoJTIyaW5wdXRfaWRzJTIyJTJDJTIwJTdCMCUzQSUyMCUyMmJhdGNoJTIyJTJDJTIwMSUzQSUyMCUyMnNlcXVlbmNlJTIyJTdEKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCglMjJhdHRlbnRpb25fbWFzayUyMiUyQyUyMCU3QjAlM0ElMjAlMjJiYXRjaCUyMiUyQyUyMDElM0ElMjAlMjJzZXF1ZW5jZSUyMiU3RCklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> Mapping, OrderedDict
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.onnx <span class="hljs-keyword">import</span> OnnxConfig


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">DistilBertOnnxConfig</span>(<span class="hljs-title class_ inherited__">OnnxConfig</span>):
<span class="hljs-meta">... </span>    @<span class="hljs-built_in">property</span>
<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>) -&gt; Mapping[<span class="hljs-built_in">str</span>, Mapping[<span class="hljs-built_in">int</span>, <span class="hljs-built_in">str</span>]]:
<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> OrderedDict(
<span class="hljs-meta">... </span>            [
<span class="hljs-meta">... </span>                (<span class="hljs-string">&quot;input_ids&quot;</span>, {<span class="hljs-number">0</span>: <span class="hljs-string">&quot;batch&quot;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&quot;sequence&quot;</span>}),
<span class="hljs-meta">... </span>                (<span class="hljs-string">&quot;attention_mask&quot;</span>, {<span class="hljs-number">0</span>: <span class="hljs-string">&quot;batch&quot;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&quot;sequence&quot;</span>}),
<span class="hljs-meta">... </span>            ]
<span class="hljs-meta">... </span>        )`,wrap:!1}}),V=new yt({props:{$$slots:{default:[Hl]},$$scope:{ctx:U}}}),Pe=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Db25maWclMEElMEFjb25maWclMjAlM0QlMjBBdXRvQ29uZmlnLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEFvbm54X2NvbmZpZyUyMCUzRCUyMERpc3RpbEJlcnRPbm54Q29uZmlnKGNvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>config = AutoConfig.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_config = DistilBertOnnxConfig(config)`,wrap:!1}}),Oe=new v({props:{code:"cHJpbnQob25ueF9jb25maWcuZGVmYXVsdF9vbm54X29wc2V0KQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(onnx_config.default_onnx_opset)
<span class="hljs-number">11</span>`,wrap:!1}}),De=new v({props:{code:"cHJpbnQob25ueF9jb25maWcub3V0cHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(onnx_config.outputs)
OrderedDict([(<span class="hljs-string">&quot;last_hidden_state&quot;</span>, {<span class="hljs-number">0</span>: <span class="hljs-string">&quot;batch&quot;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&quot;sequence&quot;</span>})])`,wrap:!1}}),et=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Db25maWclMEElMEFjb25maWclMjAlM0QlMjBBdXRvQ29uZmlnLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMiklMEFvbm54X2NvbmZpZ19mb3Jfc2VxX2NsZiUyMCUzRCUyMERpc3RpbEJlcnRPbm54Q29uZmlnKGNvbmZpZyUyQyUyMHRhc2slM0QlMjJzZXF1ZW5jZS1jbGFzc2lmaWNhdGlvbiUyMiklMEFwcmludChvbm54X2NvbmZpZ19mb3Jfc2VxX2NsZi5vdXRwdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>config = AutoConfig.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_config_for_seq_clf = DistilBertOnnxConfig(config, task=<span class="hljs-string">&quot;sequence-classification&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(onnx_config_for_seq_clf.outputs)
OrderedDict([(<span class="hljs-string">&#x27;logits&#x27;</span>, {<span class="hljs-number">0</span>: <span class="hljs-string">&#x27;batch&#x27;</span>})])`,wrap:!1}}),H=new yt({props:{$$slots:{default:[Ll]},$$scope:{ctx:U}}}),tt=new P({}),st=new v({props:{code:"ZnJvbSUyMHBhdGhsaWIlMjBpbXBvcnQlMjBQYXRoJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5vbm54JTIwaW1wb3J0JTIwZXhwb3J0JTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWwlMEElMEFvbm54X3BhdGglMjAlM0QlMjBQYXRoKCUyMm1vZGVsLm9ubnglMjIpJTBBbW9kZWxfY2twdCUyMCUzRCUyMCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyJTBBYmFzZV9tb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbC5mcm9tX3ByZXRyYWluZWQobW9kZWxfY2twdCklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9ja3B0KSUwQSUwQW9ubnhfaW5wdXRzJTJDJTIwb25ueF9vdXRwdXRzJTIwJTNEJTIwZXhwb3J0KHRva2VuaXplciUyQyUyMGJhc2VfbW9kZWwlMkMlMjBvbm54X2NvbmZpZyUyQyUyMG9ubnhfY29uZmlnLmRlZmF1bHRfb25ueF9vcHNldCUyQyUyMG9ubnhfcGF0aCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.onnx <span class="hljs-keyword">import</span> export
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModel

<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_path = Path(<span class="hljs-string">&quot;model.onnx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model_ckpt = <span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>base_model = AutoModel.from_pretrained(model_ckpt)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(model_ckpt)

<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_inputs, onnx_outputs = export(tokenizer, base_model, onnx_config, onnx_config.default_onnx_opset, onnx_path)`,wrap:!1}}),ot=new v({props:{code:"aW1wb3J0JTIwb25ueCUwQSUwQW9ubnhfbW9kZWwlMjAlM0QlMjBvbm54LmxvYWQoJTIybW9kZWwub25ueCUyMiklMEFvbm54LmNoZWNrZXIuY2hlY2tfbW9kZWwob25ueF9tb2RlbCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> onnx

<span class="hljs-meta">&gt;&gt;&gt; </span>onnx_model = onnx.load(<span class="hljs-string">&quot;model.onnx&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>onnx.checker.check_model(onnx_model)`,wrap:!1}}),z=new yt({props:{$$slots:{default:[zl]},$$scope:{ctx:U}}}),nt=new P({}),it=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5vbm54JTIwaW1wb3J0JTIwdmFsaWRhdGVfbW9kZWxfb3V0cHV0cyUwQSUwQXZhbGlkYXRlX21vZGVsX291dHB1dHMoJTBBJTIwJTIwJTIwJTIwb25ueF9jb25maWclMkMlMjB0b2tlbml6ZXIlMkMlMjBiYXNlX21vZGVsJTJDJTIwb25ueF9wYXRoJTJDJTIwb25ueF9vdXRwdXRzJTJDJTIwb25ueF9jb25maWcuYXRvbF9mb3JfdmFsaWRhdGlvbiUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.onnx <span class="hljs-keyword">import</span> validate_model_outputs

<span class="hljs-meta">&gt;&gt;&gt; </span>validate_model_outputs(
<span class="hljs-meta">... </span>    onnx_config, tokenizer, base_model, onnx_path, onnx_outputs, onnx_config.atol_for_validation
<span class="hljs-meta">... </span>)`,wrap:!1}}),dt=new P({}),{c(){i=n("meta"),g=l(),d=n("p"),w=l(),C=n("h1"),T=n("a"),$=n("span"),m(S.$$.fragment),ys=l(),bt=n("span"),bt.textContent=Cs,Et=l(),O=n("p"),O.innerHTML=$s,Gt=l(),m(I.$$.fragment),qt=l(),Y=n("p"),Y.innerHTML=xs,Vt=l(),D=n("p"),D.textContent=Js,Ht=l(),K=n("p"),K.innerHTML=Zs,Lt=l(),ee=n("p"),ee.textContent=ks,zt=l(),te=n("ul"),te.innerHTML=As,Ft=l(),ae=n("p"),ae.textContent=Ns,Qt=l(),se=n("ul"),se.innerHTML=_s,Pt=l(),x=n("h2"),W=n("a"),xt=n("span"),m(le.$$.fragment),js=l(),gt=n("span"),gt.textContent=Is,St=l(),oe=n("p"),oe.textContent=Ws,Ot=l(),m(ne.$$.fragment),Yt=l(),re=n("p"),re.innerHTML=Bs,Dt=l(),m(ie.$$.fragment),Kt=l(),pe=n("p"),pe.textContent=Xs,ea=l(),m(de.$$.fragment),ta=l(),me=n("p"),me.textContent=Rs,aa=l(),m(ce.$$.fragment),sa=l(),ue=n("p"),ue.innerHTML=Es,la=l(),Me=n("p"),Me.innerHTML=Gs,oa=l(),m(fe.$$.fragment),na=l(),he=n("p"),he.innerHTML=qs,ra=l(),m(ye.$$.fragment),ia=l(),je=n("p"),je.innerHTML=Vs,pa=l(),m(be.$$.fragment),da=l(),ge=n("p"),ge.textContent=Hs,ma=l(),m(we.$$.fragment),ca=l(),ve=n("p"),ve.innerHTML=Ls,ua=l(),m(Te.$$.fragment),Ma=l(),m(Ue.$$.fragment),fa=l(),Ce=n("p"),Ce.innerHTML=zs,ha=l(),m($e.$$.fragment),ya=l(),J=n("h2"),B=n("a"),Jt=n("span"),m(xe.$$.fragment),bs=l(),wt=n("span"),wt.textContent=Fs,ja=l(),Je=n("p"),Je.innerHTML=Qs,ba=l(),Ze=n("table"),Ze.innerHTML=Ps,ga=l(),ke=n("p"),ke.innerHTML=Ss,wa=l(),m(Ae.$$.fragment),va=l(),Ne=n("p"),Ne.innerHTML=Os,Ta=l(),m(_e.$$.fragment),Ua=l(),Ie=n("p"),Ie.textContent=Ys,Ca=l(),m(We.$$.fragment),$a=l(),Be=n("p"),Be.innerHTML=Ds,xa=l(),m(X.$$.fragment),Ja=l(),m(R.$$.fragment),Za=l(),Z=n("h2"),E=n("a"),Zt=n("span"),m(Xe.$$.fragment),gs=l(),vt=n("span"),vt.textContent=Ks,ka=l(),Re=n("p"),Re.textContent=el,Aa=l(),Ee=n("ol"),Ee.innerHTML=tl,Na=l(),Ge=n("p"),Ge.textContent=al,_a=l(),k=n("h3"),G=n("a"),kt=n("span"),m(qe.$$.fragment),ws=l(),Tt=n("span"),Tt.textContent=sl,Ia=l(),Ve=n("p"),Ve.textContent=ll,Wa=l(),He=n("ul"),He.innerHTML=ol,Ba=l(),m(q.$$.fragment),Xa=l(),Le=n("p"),Le.innerHTML=nl,Ra=l(),m(ze.$$.fragment),Ea=l(),Fe=n("p"),Fe.innerHTML=rl,Ga=l(),m(V.$$.fragment),qa=l(),Qe=n("p"),Qe.textContent=il,Va=l(),m(Pe.$$.fragment),Ha=l(),Se=n("p"),Se.textContent=pl,La=l(),m(Oe.$$.fragment),za=l(),Ye=n("p"),Ye.textContent=dl,Fa=l(),m(De.$$.fragment),Qa=l(),Ke=n("p"),Ke.innerHTML=ml,Pa=l(),m(et.$$.fragment),Sa=l(),m(H.$$.fragment),Oa=l(),A=n("h3"),L=n("a"),At=n("span"),m(tt.$$.fragment),vs=l(),Ut=n("span"),Ut.textContent=cl,Ya=l(),at=n("p"),at.innerHTML=ul,Da=l(),m(st.$$.fragment),Ka=l(),lt=n("p"),lt.innerHTML=Ml,es=l(),m(ot.$$.fragment),ts=l(),m(z.$$.fragment),as=l(),N=n("h3"),F=n("a"),Nt=n("span"),m(nt.$$.fragment),Ts=l(),Ct=n("span"),Ct.textContent=fl,ss=l(),rt=n("p"),rt.innerHTML=hl,ls=l(),m(it.$$.fragment),os=l(),pt=n("p"),pt.innerHTML=yl,ns=l(),_=n("h2"),Q=n("a"),_t=n("span"),m(dt.$$.fragment),Us=l(),$t=n("span"),$t.textContent=jl,rs=l(),mt=n("p"),mt.textContent=bl,is=l(),ct=n("ul"),ct.innerHTML=gl,ps=l(),ut=n("p"),ut.innerHTML=wl,ds=l(),It=n("p"),this.h()},l(e){const t=Rl("svelte-1phssyn",document.head);i=r(t,"META",{name:!0,content:!0}),t.forEach(a),g=o(e),d=r(e,"P",{}),b(d).forEach(a),w=o(e),C=r(e,"H1",{class:!0});var Mt=b(C);T=r(Mt,"A",{id:!0,class:!0,href:!0});var Wt=b(T);$=r(Wt,"SPAN",{});var Bt=b($);c(S.$$.fragment,Bt),Bt.forEach(a),Wt.forEach(a),ys=o(Mt),bt=r(Mt,"SPAN",{"data-svelte-h":!0}),p(bt)!=="svelte-1tlfgh9"&&(bt.textContent=Cs),Mt.forEach(a),Et=o(e),O=r(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-780rag"&&(O.innerHTML=$s),Gt=o(e),c(I.$$.fragment,e),qt=o(e),Y=r(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-kzaz5b"&&(Y.innerHTML=xs),Vt=o(e),D=r(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-187fdkg"&&(D.textContent=Js),Ht=o(e),K=r(e,"P",{"data-svelte-h":!0}),p(K)!=="svelte-18aznvk"&&(K.innerHTML=Zs),Lt=o(e),ee=r(e,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-g9dkld"&&(ee.textContent=ks),zt=o(e),te=r(e,"UL",{"data-svelte-h":!0}),p(te)!=="svelte-hlbcru"&&(te.innerHTML=As),Ft=o(e),ae=r(e,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-1um2ugk"&&(ae.textContent=Ns),Qt=o(e),se=r(e,"UL",{"data-svelte-h":!0}),p(se)!=="svelte-8ygt46"&&(se.innerHTML=_s),Pt=o(e),x=r(e,"H2",{class:!0});var ft=b(x);W=r(ft,"A",{id:!0,class:!0,href:!0});var Xt=b(W);xt=r(Xt,"SPAN",{});var Rt=b(xt);c(le.$$.fragment,Rt),Rt.forEach(a),Xt.forEach(a),js=o(ft),gt=r(ft,"SPAN",{"data-svelte-h":!0}),p(gt)!=="svelte-6fbwia"&&(gt.textContent=Is),ft.forEach(a),St=o(e),oe=r(e,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-ldfupz"&&(oe.textContent=Ws),Ot=o(e),c(ne.$$.fragment,e),Yt=o(e),re=r(e,"P",{"data-svelte-h":!0}),p(re)!=="svelte-unqqru"&&(re.innerHTML=Bs),Dt=o(e),c(ie.$$.fragment,e),Kt=o(e),pe=r(e,"P",{"data-svelte-h":!0}),p(pe)!=="svelte-6uusn"&&(pe.textContent=Xs),ea=o(e),c(de.$$.fragment,e),ta=o(e),me=r(e,"P",{"data-svelte-h":!0}),p(me)!=="svelte-1urlk3h"&&(me.textContent=Rs),aa=o(e),c(ce.$$.fragment,e),sa=o(e),ue=r(e,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-tuenxb"&&(ue.innerHTML=Es),la=o(e),Me=r(e,"P",{"data-svelte-h":!0}),p(Me)!=="svelte-11ias89"&&(Me.innerHTML=Gs),oa=o(e),c(fe.$$.fragment,e),na=o(e),he=r(e,"P",{"data-svelte-h":!0}),p(he)!=="svelte-ehimya"&&(he.innerHTML=qs),ra=o(e),c(ye.$$.fragment,e),ia=o(e),je=r(e,"P",{"data-svelte-h":!0}),p(je)!=="svelte-1iginlu"&&(je.innerHTML=Vs),pa=o(e),c(be.$$.fragment,e),da=o(e),ge=r(e,"P",{"data-svelte-h":!0}),p(ge)!=="svelte-12w4y7b"&&(ge.textContent=Hs),ma=o(e),c(we.$$.fragment,e),ca=o(e),ve=r(e,"P",{"data-svelte-h":!0}),p(ve)!=="svelte-1hwlhij"&&(ve.innerHTML=Ls),ua=o(e),c(Te.$$.fragment,e),Ma=o(e),c(Ue.$$.fragment,e),fa=o(e),Ce=r(e,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-1hwlhij"&&(Ce.innerHTML=zs),ha=o(e),c($e.$$.fragment,e),ya=o(e),J=r(e,"H2",{class:!0});var ht=b(J);B=r(ht,"A",{id:!0,class:!0,href:!0});var vl=b(B);Jt=r(vl,"SPAN",{});var Tl=b(Jt);c(xe.$$.fragment,Tl),Tl.forEach(a),vl.forEach(a),bs=o(ht),wt=r(ht,"SPAN",{"data-svelte-h":!0}),p(wt)!=="svelte-bcn7ca"&&(wt.textContent=Fs),ht.forEach(a),ja=o(e),Je=r(e,"P",{"data-svelte-h":!0}),p(Je)!=="svelte-au9t2"&&(Je.innerHTML=Qs),ba=o(e),Ze=r(e,"TABLE",{"data-svelte-h":!0}),p(Ze)!=="svelte-19g4mid"&&(Ze.innerHTML=Ps),ga=o(e),ke=r(e,"P",{"data-svelte-h":!0}),p(ke)!=="svelte-67rlav"&&(ke.innerHTML=Ss),wa=o(e),c(Ae.$$.fragment,e),va=o(e),Ne=r(e,"P",{"data-svelte-h":!0}),p(Ne)!=="svelte-zfw7vl"&&(Ne.innerHTML=Os),Ta=o(e),c(_e.$$.fragment,e),Ua=o(e),Ie=r(e,"P",{"data-svelte-h":!0}),p(Ie)!=="svelte-1qh1xkx"&&(Ie.textContent=Ys),Ca=o(e),c(We.$$.fragment,e),$a=o(e),Be=r(e,"P",{"data-svelte-h":!0}),p(Be)!=="svelte-14du68y"&&(Be.innerHTML=Ds),xa=o(e),c(X.$$.fragment,e),Ja=o(e),c(R.$$.fragment,e),Za=o(e),Z=r(e,"H2",{class:!0});var cs=b(Z);E=r(cs,"A",{id:!0,class:!0,href:!0});var Ul=b(E);Zt=r(Ul,"SPAN",{});var Cl=b(Zt);c(Xe.$$.fragment,Cl),Cl.forEach(a),Ul.forEach(a),gs=o(cs),vt=r(cs,"SPAN",{"data-svelte-h":!0}),p(vt)!=="svelte-f1ku9c"&&(vt.textContent=Ks),cs.forEach(a),ka=o(e),Re=r(e,"P",{"data-svelte-h":!0}),p(Re)!=="svelte-srdmc5"&&(Re.textContent=el),Aa=o(e),Ee=r(e,"OL",{"data-svelte-h":!0}),p(Ee)!=="svelte-119emik"&&(Ee.innerHTML=tl),Na=o(e),Ge=r(e,"P",{"data-svelte-h":!0}),p(Ge)!=="svelte-1tntr09"&&(Ge.textContent=al),_a=o(e),k=r(e,"H3",{class:!0});var us=b(k);G=r(us,"A",{id:!0,class:!0,href:!0});var $l=b(G);kt=r($l,"SPAN",{});var xl=b(kt);c(qe.$$.fragment,xl),xl.forEach(a),$l.forEach(a),ws=o(us),Tt=r(us,"SPAN",{"data-svelte-h":!0}),p(Tt)!=="svelte-1nqei2"&&(Tt.textContent=sl),us.forEach(a),Ia=o(e),Ve=r(e,"P",{"data-svelte-h":!0}),p(Ve)!=="svelte-1yke088"&&(Ve.textContent=ll),Wa=o(e),He=r(e,"UL",{"data-svelte-h":!0}),p(He)!=="svelte-16srizl"&&(He.innerHTML=ol),Ba=o(e),c(q.$$.fragment,e),Xa=o(e),Le=r(e,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-1w3ieqz"&&(Le.innerHTML=nl),Ra=o(e),c(ze.$$.fragment,e),Ea=o(e),Fe=r(e,"P",{"data-svelte-h":!0}),p(Fe)!=="svelte-1dcv64l"&&(Fe.innerHTML=rl),Ga=o(e),c(V.$$.fragment,e),qa=o(e),Qe=r(e,"P",{"data-svelte-h":!0}),p(Qe)!=="svelte-1xs5c3l"&&(Qe.textContent=il),Va=o(e),c(Pe.$$.fragment,e),Ha=o(e),Se=r(e,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-conxji"&&(Se.textContent=pl),La=o(e),c(Oe.$$.fragment,e),za=o(e),Ye=r(e,"P",{"data-svelte-h":!0}),p(Ye)!=="svelte-1gla57i"&&(Ye.textContent=dl),Fa=o(e),c(De.$$.fragment,e),Qa=o(e),Ke=r(e,"P",{"data-svelte-h":!0}),p(Ke)!=="svelte-eqvgnl"&&(Ke.innerHTML=ml),Pa=o(e),c(et.$$.fragment,e),Sa=o(e),c(H.$$.fragment,e),Oa=o(e),A=r(e,"H3",{class:!0});var Ms=b(A);L=r(Ms,"A",{id:!0,class:!0,href:!0});var Jl=b(L);At=r(Jl,"SPAN",{});var Zl=b(At);c(tt.$$.fragment,Zl),Zl.forEach(a),Jl.forEach(a),vs=o(Ms),Ut=r(Ms,"SPAN",{"data-svelte-h":!0}),p(Ut)!=="svelte-r8sd65"&&(Ut.textContent=cl),Ms.forEach(a),Ya=o(e),at=r(e,"P",{"data-svelte-h":!0}),p(at)!=="svelte-scf0rn"&&(at.innerHTML=ul),Da=o(e),c(st.$$.fragment,e),Ka=o(e),lt=r(e,"P",{"data-svelte-h":!0}),p(lt)!=="svelte-1clqbx4"&&(lt.innerHTML=Ml),es=o(e),c(ot.$$.fragment,e),ts=o(e),c(z.$$.fragment,e),as=o(e),N=r(e,"H3",{class:!0});var fs=b(N);F=r(fs,"A",{id:!0,class:!0,href:!0});var kl=b(F);Nt=r(kl,"SPAN",{});var Al=b(Nt);c(nt.$$.fragment,Al),Al.forEach(a),kl.forEach(a),Ts=o(fs),Ct=r(fs,"SPAN",{"data-svelte-h":!0}),p(Ct)!=="svelte-hzpgkl"&&(Ct.textContent=fl),fs.forEach(a),ss=o(e),rt=r(e,"P",{"data-svelte-h":!0}),p(rt)!=="svelte-1fom1t1"&&(rt.innerHTML=hl),ls=o(e),c(it.$$.fragment,e),os=o(e),pt=r(e,"P",{"data-svelte-h":!0}),p(pt)!=="svelte-1w48q5s"&&(pt.innerHTML=yl),ns=o(e),_=r(e,"H2",{class:!0});var hs=b(_);Q=r(hs,"A",{id:!0,class:!0,href:!0});var Nl=b(Q);_t=r(Nl,"SPAN",{});var _l=b(_t);c(dt.$$.fragment,_l),_l.forEach(a),Nl.forEach(a),Us=o(hs),$t=r(hs,"SPAN",{"data-svelte-h":!0}),p($t)!=="svelte-fgd6lx"&&($t.textContent=jl),hs.forEach(a),rs=o(e),mt=r(e,"P",{"data-svelte-h":!0}),p(mt)!=="svelte-nik27b"&&(mt.textContent=bl),is=o(e),ct=r(e,"UL",{"data-svelte-h":!0}),p(ct)!=="svelte-aqybbn"&&(ct.innerHTML=gl),ps=o(e),ut=r(e,"P",{"data-svelte-h":!0}),p(ut)!=="svelte-1uvyz3f"&&(ut.innerHTML=wl),ds=o(e),It=r(e,"P",{}),b(It).forEach(a),this.h()},h(){y(i,"name","hf:doc:metadata"),y(i,"content",JSON.stringify(Ql)),y(T,"id","exportando-modelos-para-onnx"),y(T,"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"),y(T,"href","#exportando-modelos-para-onnx"),y(C,"class","relative group"),y(W,"id","exportando-um-modelo-para-onnx"),y(W,"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"),y(W,"href","#exportando-um-modelo-para-onnx"),y(x,"class","relative group"),y(B,"id","selecionando-features-para-diferentes-tarefas-do-modelo"),y(B,"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"),y(B,"href","#selecionando-features-para-diferentes-tarefas-do-modelo"),y(J,"class","relative group"),y(E,"id","exportando-um-modelo-para-uma-arquitetura-sem-suporte"),y(E,"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"),y(E,"href","#exportando-um-modelo-para-uma-arquitetura-sem-suporte"),y(Z,"class","relative group"),y(G,"id","implementando-uma-configurao-onnx-personalizada"),y(G,"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"),y(G,"href","#implementando-uma-configurao-onnx-personalizada"),y(k,"class","relative group"),y(L,"id","exportando-um-modelo"),y(L,"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"),y(L,"href","#exportando-um-modelo"),y(A,"class","relative group"),y(F,"id","validando-a-sada-dos-modelos"),y(F,"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"),y(F,"href","#validando-a-sada-dos-modelos"),y(N,"class","relative group"),y(Q,"id","contribuindo-com-uma-nova-configurao-para-transformers"),y(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"),y(Q,"href","#contribuindo-com-uma-nova-configurao-para-transformers"),y(_,"class","relative group")},m(e,t){j(document.head,i),s(e,g,t),s(e,d,t),s(e,w,t),s(e,C,t),j(C,T),j(T,$),u(S,$,null),j(C,ys),j(C,bt),s(e,Et,t),s(e,O,t),s(e,Gt,t),u(I,e,t),s(e,qt,t),s(e,Y,t),s(e,Vt,t),s(e,D,t),s(e,Ht,t),s(e,K,t),s(e,Lt,t),s(e,ee,t),s(e,zt,t),s(e,te,t),s(e,Ft,t),s(e,ae,t),s(e,Qt,t),s(e,se,t),s(e,Pt,t),s(e,x,t),j(x,W),j(W,xt),u(le,xt,null),j(x,js),j(x,gt),s(e,St,t),s(e,oe,t),s(e,Ot,t),u(ne,e,t),s(e,Yt,t),s(e,re,t),s(e,Dt,t),u(ie,e,t),s(e,Kt,t),s(e,pe,t),s(e,ea,t),u(de,e,t),s(e,ta,t),s(e,me,t),s(e,aa,t),u(ce,e,t),s(e,sa,t),s(e,ue,t),s(e,la,t),s(e,Me,t),s(e,oa,t),u(fe,e,t),s(e,na,t),s(e,he,t),s(e,ra,t),u(ye,e,t),s(e,ia,t),s(e,je,t),s(e,pa,t),u(be,e,t),s(e,da,t),s(e,ge,t),s(e,ma,t),u(we,e,t),s(e,ca,t),s(e,ve,t),s(e,ua,t),u(Te,e,t),s(e,Ma,t),u(Ue,e,t),s(e,fa,t),s(e,Ce,t),s(e,ha,t),u($e,e,t),s(e,ya,t),s(e,J,t),j(J,B),j(B,Jt),u(xe,Jt,null),j(J,bs),j(J,wt),s(e,ja,t),s(e,Je,t),s(e,ba,t),s(e,Ze,t),s(e,ga,t),s(e,ke,t),s(e,wa,t),u(Ae,e,t),s(e,va,t),s(e,Ne,t),s(e,Ta,t),u(_e,e,t),s(e,Ua,t),s(e,Ie,t),s(e,Ca,t),u(We,e,t),s(e,$a,t),s(e,Be,t),s(e,xa,t),u(X,e,t),s(e,Ja,t),u(R,e,t),s(e,Za,t),s(e,Z,t),j(Z,E),j(E,Zt),u(Xe,Zt,null),j(Z,gs),j(Z,vt),s(e,ka,t),s(e,Re,t),s(e,Aa,t),s(e,Ee,t),s(e,Na,t),s(e,Ge,t),s(e,_a,t),s(e,k,t),j(k,G),j(G,kt),u(qe,kt,null),j(k,ws),j(k,Tt),s(e,Ia,t),s(e,Ve,t),s(e,Wa,t),s(e,He,t),s(e,Ba,t),u(q,e,t),s(e,Xa,t),s(e,Le,t),s(e,Ra,t),u(ze,e,t),s(e,Ea,t),s(e,Fe,t),s(e,Ga,t),u(V,e,t),s(e,qa,t),s(e,Qe,t),s(e,Va,t),u(Pe,e,t),s(e,Ha,t),s(e,Se,t),s(e,La,t),u(Oe,e,t),s(e,za,t),s(e,Ye,t),s(e,Fa,t),u(De,e,t),s(e,Qa,t),s(e,Ke,t),s(e,Pa,t),u(et,e,t),s(e,Sa,t),u(H,e,t),s(e,Oa,t),s(e,A,t),j(A,L),j(L,At),u(tt,At,null),j(A,vs),j(A,Ut),s(e,Ya,t),s(e,at,t),s(e,Da,t),u(st,e,t),s(e,Ka,t),s(e,lt,t),s(e,es,t),u(ot,e,t),s(e,ts,t),u(z,e,t),s(e,as,t),s(e,N,t),j(N,F),j(F,Nt),u(nt,Nt,null),j(N,Ts),j(N,Ct),s(e,ss,t),s(e,rt,t),s(e,ls,t),u(it,e,t),s(e,os,t),s(e,pt,t),s(e,ns,t),s(e,_,t),j(_,Q),j(Q,_t),u(dt,_t,null),j(_,Us),j(_,$t),s(e,rs,t),s(e,mt,t),s(e,is,t),s(e,ct,t),s(e,ps,t),s(e,ut,t),s(e,ds,t),s(e,It,t),ms=!0},p(e,[t]){const Mt={};t&2&&(Mt.$$scope={dirty:t,ctx:e}),I.$set(Mt);const Wt={};t&2&&(Wt.$$scope={dirty:t,ctx:e}),X.$set(Wt);const Bt={};t&2&&(Bt.$$scope={dirty:t,ctx:e}),R.$set(Bt);const ft={};t&2&&(ft.$$scope={dirty:t,ctx:e}),q.$set(ft);const Xt={};t&2&&(Xt.$$scope={dirty:t,ctx:e}),V.$set(Xt);const Rt={};t&2&&(Rt.$$scope={dirty:t,ctx:e}),H.$set(Rt);const ht={};t&2&&(ht.$$scope={dirty:t,ctx:e}),z.$set(ht)},i(e){ms||(M(S.$$.fragment,e),M(I.$$.fragment,e),M(le.$$.fragment,e),M(ne.$$.fragment,e),M(ie.$$.fragment,e),M(de.$$.fragment,e),M(ce.$$.fragment,e),M(fe.$$.fragment,e),M(ye.$$.fragment,e),M(be.$$.fragment,e),M(we.$$.fragment,e),M(Te.$$.fragment,e),M(Ue.$$.fragment,e),M($e.$$.fragment,e),M(xe.$$.fragment,e),M(Ae.$$.fragment,e),M(_e.$$.fragment,e),M(We.$$.fragment,e),M(X.$$.fragment,e),M(R.$$.fragment,e),M(Xe.$$.fragment,e),M(qe.$$.fragment,e),M(q.$$.fragment,e),M(ze.$$.fragment,e),M(V.$$.fragment,e),M(Pe.$$.fragment,e),M(Oe.$$.fragment,e),M(De.$$.fragment,e),M(et.$$.fragment,e),M(H.$$.fragment,e),M(tt.$$.fragment,e),M(st.$$.fragment,e),M(ot.$$.fragment,e),M(z.$$.fragment,e),M(nt.$$.fragment,e),M(it.$$.fragment,e),M(dt.$$.fragment,e),ms=!0)},o(e){f(S.$$.fragment,e),f(I.$$.fragment,e),f(le.$$.fragment,e),f(ne.$$.fragment,e),f(ie.$$.fragment,e),f(de.$$.fragment,e),f(ce.$$.fragment,e),f(fe.$$.fragment,e),f(ye.$$.fragment,e),f(be.$$.fragment,e),f(we.$$.fragment,e),f(Te.$$.fragment,e),f(Ue.$$.fragment,e),f($e.$$.fragment,e),f(xe.$$.fragment,e),f(Ae.$$.fragment,e),f(_e.$$.fragment,e),f(We.$$.fragment,e),f(X.$$.fragment,e),f(R.$$.fragment,e),f(Xe.$$.fragment,e),f(qe.$$.fragment,e),f(q.$$.fragment,e),f(ze.$$.fragment,e),f(V.$$.fragment,e),f(Pe.$$.fragment,e),f(Oe.$$.fragment,e),f(De.$$.fragment,e),f(et.$$.fragment,e),f(H.$$.fragment,e),f(tt.$$.fragment,e),f(st.$$.fragment,e),f(ot.$$.fragment,e),f(z.$$.fragment,e),f(nt.$$.fragment,e),f(it.$$.fragment,e),f(dt.$$.fragment,e),ms=!1},d(e){e&&(a(g),a(d),a(w),a(C),a(Et),a(O),a(Gt),a(qt),a(Y),a(Vt),a(D),a(Ht),a(K),a(Lt),a(ee),a(zt),a(te),a(Ft),a(ae),a(Qt),a(se),a(Pt),a(x),a(St),a(oe),a(Ot),a(Yt),a(re),a(Dt),a(Kt),a(pe),a(ea),a(ta),a(me),a(aa),a(sa),a(ue),a(la),a(Me),a(oa),a(na),a(he),a(ra),a(ia),a(je),a(pa),a(da),a(ge),a(ma),a(ca),a(ve),a(ua),a(Ma),a(fa),a(Ce),a(ha),a(ya),a(J),a(ja),a(Je),a(ba),a(Ze),a(ga),a(ke),a(wa),a(va),a(Ne),a(Ta),a(Ua),a(Ie),a(Ca),a($a),a(Be),a(xa),a(Ja),a(Za),a(Z),a(ka),a(Re),a(Aa),a(Ee),a(Na),a(Ge),a(_a),a(k),a(Ia),a(Ve),a(Wa),a(He),a(Ba),a(Xa),a(Le),a(Ra),a(Ea),a(Fe),a(Ga),a(qa),a(Qe),a(Va),a(Ha),a(Se),a(La),a(za),a(Ye),a(Fa),a(Qa),a(Ke),a(Pa),a(Sa),a(Oa),a(A),a(Ya),a(at),a(Da),a(Ka),a(lt),a(es),a(ts),a(as),a(N),a(ss),a(rt),a(ls),a(os),a(pt),a(ns),a(_),a(rs),a(mt),a(is),a(ct),a(ps),a(ut),a(ds),a(It)),a(i),h(S),h(I,e),h(le),h(ne,e),h(ie,e),h(de,e),h(ce,e),h(fe,e),h(ye,e),h(be,e),h(we,e),h(Te,e),h(Ue,e),h($e,e),h(xe),h(Ae,e),h(_e,e),h(We,e),h(X,e),h(R,e),h(Xe),h(qe),h(q,e),h(ze,e),h(V,e),h(Pe,e),h(Oe,e),h(De,e),h(et,e),h(H,e),h(tt),h(st,e),h(ot,e),h(z,e),h(nt),h(it,e),h(dt)}}}const Ql={local:"exportando-modelos-para-onnx",sections:[{local:"exportando-um-modelo-para-onnx",title:"Exportando um modelo para ONNX"},{local:"selecionando-features-para-diferentes-tarefas-do-modelo",title:"Selecionando features para diferentes tarefas do modelo"},{local:"exportando-um-modelo-para-uma-arquitetura-sem-suporte",sections:[{local:"implementando-uma-configurao-onnx-personalizada",title:"Implementando uma configuração ONNX personalizada"},{local:"exportando-um-modelo",title:"Exportando um modelo"},{local:"validando-a-sada-dos-modelos",title:"Validando a saída dos modelos"}],title:"Exportando um modelo para uma arquitetura sem suporte"},{local:"contribuindo-com-uma-nova-configurao-para-transformers",title:"Contribuindo com uma nova configuração para 🤗 Transformers"}],title:"Exportando modelos para ONNX "};function Pl(U){return Wl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class eo extends Bl{constructor(i){super(),Xl(this,i,Pl,Fl,Il,{})}}export{eo as component};
