import{s as Zn,o as En,n as Sn}from"../chunks/scheduler.9bc65507.js";import{S as jn,i as Gn,g as n,s as r,u as c,A as qn,h as i,f as t,c as s,j as u,v as f,y as a,k as d,o as h,a as l,w as p,d as w,t as v,x as y}from"../chunks/index.78c82d43.js";import{T as Rn}from"../chunks/Tip.87d55b76.js";import{I as z}from"../chunks/IconCopyLink.bedaa44d.js";import{C as Q}from"../chunks/CodeBlock.73e038be.js";function Wn(ut){let m,k="Are you unsure whether the model you wish to use already has a corresponding TensorFlow architecture?",b,T,C=" ",_,x,M=`Check the <code>model_type</code> field of the <code>config.json</code> of your model of choice
(<a href="https://huggingface.co/bert-base-uncased/blob/main/config.json#L14" rel="nofollow">example</a>). If the corresponding model folder in
🤗 Transformers has a file whose name starts with “modeling_tf”, it means that it has a corresponding TensorFlow
architecture (<a href="https://github.com/huggingface/transformers/tree/main/src/transformers/models/bert" rel="nofollow">example</a>).`;return{c(){m=n("p"),m.textContent=k,b=r(),T=n("p"),T.textContent=C,_=r(),x=n("p"),x.innerHTML=M},l(g){m=i(g,"P",{"data-svelte-h":!0}),a(m)!=="svelte-bjpicv"&&(m.textContent=k),b=s(g),T=i(g,"P",{"data-svelte-h":!0}),a(T)!=="svelte-1cdgjs8"&&(T.textContent=C),_=s(g),x=i(g,"P",{"data-svelte-h":!0}),a(x)!=="svelte-d10726"&&(x.innerHTML=M)},m(g,$){l(g,m,$),l(g,b,$),l(g,T,$),l(g,_,$),l(g,x,$)},p:Sn,d(g){g&&(t(m),t(b),t(T),t(_),t(x))}}}function Yn(ut){let m,k=`Before starting the work on a TensorFlow model architecture, double-check that there is no ongoing effort to do so.
You can search for <code>BrandNewBert</code> on the
<a href="https://github.com/huggingface/transformers/pulls?q=is%3Apr" rel="nofollow">pull request GitHub page</a> to confirm that there is no
TensorFlow-related pull request.`;return{c(){m=n("p"),m.innerHTML=k},l(b){m=i(b,"P",{"data-svelte-h":!0}),a(m)!=="svelte-1238l2j"&&(m.innerHTML=k)},m(b,T){l(b,m,T)},p:Sn,d(b){b&&t(m)}}}function Xn(ut){let m,k,b,T,C,_,x,M,g,$,ul="How to convert a 🤗 Transformers model to TensorFlow?",Lt,V,ml=`Having multiple frameworks available to use with 🤗 Transformers gives you flexibility to play their strengths when
designing your application, but it implies that compatibility must be added on a per-model basis. The good news is that
adding TensorFlow compatibility to an existing model is simpler than <a href="add_new_model">adding a new model from scratch</a>!
Whether you wish to have a deeper understanding of large TensorFlow models, make a major open-source contribution, or
enable TensorFlow for your model of choice, this guide is for you.`,Ht,D,cl=`This guide empowers you, a member of our community, to contribute TensorFlow model weights and/or
architectures to be used in 🤗 Transformers, with minimal supervision from the Hugging Face team. Writing a new model
is no small feat, but hopefully this guide will make it less of a rollercoaster 🎢 and more of a walk in the park 🚶.
Harnessing our collective experiences is absolutely critical to make this process increasingly easier, and thus we
highly encourage that you suggest improvements to this guide!`,Ft,K,fl="Before you dive deeper, it is recommended that you check the following resources if you’re new to 🤗 Transformers:",Pt,ee,pl='<li><a href="add_new_model#general-overview-of-transformers">General overview of 🤗 Transformers</a></li> <li><a href="https://huggingface.co/blog/tensorflow-philosophy" rel="nofollow">Hugging Face’s TensorFlow Philosophy</a></li>',Nt,te,wl=`In the remainder of this guide, you will learn what’s needed to add a new TensorFlow model architecture, the
procedure to convert PyTorch into TensorFlow model weights, and how to efficiently debug mismatches across ML
frameworks. Let’s get started!`,Bt,A,Ut,L,I,gt,oe,nl,mt,vl="Step-by-step guide to add TensorFlow model architecture code",At,le,yl=`There are many ways to design a large model architecture, and multiple ways of implementing said design. However,
you might recall from our <a href="add_new_model#general-overview-of-transformers">general overview of 🤗 Transformers</a>
that we are an opinionated bunch - the ease of use of 🤗 Transformers relies on consistent design choices. From
experience, we can tell you a few important things about adding TensorFlow models:`,It,ne,gl=`<li>Don’t reinvent the wheel! More often than not, there are at least two reference implementations you should check: the
PyTorch equivalent of the model you are implementing and other TensorFlow models for the same class of problems.</li> <li>Great model implementations survive the test of time. This doesn’t happen because the code is pretty, but rather
because the code is clear, easy to debug and build upon. If you make the life of the maintainers easy with your
TensorFlow implementation, by replicating the same patterns as in other TensorFlow models and minimizing the mismatch
to the PyTorch implementation, you ensure your contribution will be long lived.</li> <li>Ask for help when you’re stuck! The 🤗 Transformers team is here to help, and we’ve probably found solutions to the same
problems you’re facing.</li>`,Jt,ie,bl="Here’s an overview of the steps needed to add a TensorFlow model architecture:",Rt,re,Tl="<li>Select the model you wish to convert</li> <li>Prepare transformers dev environment</li> <li>(Optional) Understand theoretical aspects and the existing implementation</li> <li>Implement the model architecture</li> <li>Implement model tests</li> <li>Submit the pull request</li> <li>(Optional) Build demos and share with the world</li>",St,H,J,bt,se,il,ct,_l="1.-3. Prepare your model contribution",Zt,ae,xl="<strong>1. Select the model you wish to convert</strong>",Et,de,Cl=`Let’s start off with the basics: the first thing you need to know is the architecture you want to convert. If you
don’t have your eyes set on a specific architecture, asking the 🤗 Transformers team for suggestions is a great way to
maximize your impact - we will guide you towards the most prominent architectures that are missing on the TensorFlow
side. If the specific model you want to use with TensorFlow already has a TensorFlow architecture implementation in
🤗 Transformers but is lacking weights, feel free to jump straight into the
<a href="#adding-tensorflow-weights-to-hub">weight conversion section</a>
of this page.`,jt,he,$l=`For simplicity, the remainder of this guide assumes you’ve decided to contribute with the TensorFlow version of
<em>BrandNewBert</em> (the same example as in the <a href="add_new_model">guide</a> to add a new model from scratch).`,Gt,R,qt,ue,kl="<strong>2. Prepare transformers dev environment</strong>",Wt,me,Ml=`Having selected the model architecture, open a draft PR to signal your intention to work on it. Follow the
instructions below to set up your environment and open a draft PR.`,Yt,ce,Ll=`<li><p>Fork the <a href="https://github.com/huggingface/transformers" rel="nofollow">repository</a> by clicking on the ‘Fork’ button on the
repository’s page. This creates a copy of the code under your GitHub user account.</p></li> <li><p>Clone your <code>transformers</code> fork to your local disk, and add the base repository as a remote:</p></li>`,Xt,fe,Ot,S,Hl="<li>Set up a development environment, for instance by running the following command:</li>",zt,pe,Qt,we,Fl=`Depending on your OS, and since the number of optional dependencies of Transformers is growing, you might get a
failure with this command. If that’s the case make sure to install TensorFlow then do:`,Vt,ve,Dt,ye,Pl="<strong>Note:</strong> You don’t need to have CUDA installed. Making the new model work on CPU is sufficient.",Kt,Z,Nl="<li>Create a branch with a descriptive name from your main branch</li>",eo,ge,to,E,Bl="<li>Fetch and rebase to current main</li>",oo,be,lo,j,Ul=`<li><p>Add an empty <code>.py</code> file in <code>transformers/src/models/brandnewbert/</code> named <code>modeling_tf_brandnewbert.py</code>. This will
be your TensorFlow model file.</p></li> <li><p>Push the changes to your account using:</p></li>`,no,Te,io,G,Al=`<li><p>Once you are satisfied, go to the webpage of your fork on GitHub. Click on “Pull request”. Make sure to add the
GitHub handle of some members of the Hugging Face team as reviewers, so that the Hugging Face team gets notified for
future changes.</p></li> <li><p>Change the PR into a draft by clicking on “Convert to draft” on the right of the GitHub pull request web page.</p></li>`,ro,_e,Il="Now you have set up a development environment to port <em>BrandNewBert</em> to TensorFlow in 🤗 Transformers.",so,xe,Jl="<strong>3. (Optional) Understand theoretical aspects and the existing implementation</strong>",ao,Ce,Rl=`You should take some time to read <em>BrandNewBert’s</em> paper, if such descriptive work exists. There might be large
sections of the paper that are difficult to understand. If this is the case, this is fine - don’t worry! The goal is
not to get a deep theoretical understanding of the paper, but to extract the necessary information required to
effectively re-implement the model in 🤗 Transformers using TensorFlow. That being said, you don’t have to spend too
much time on the theoretical aspects, but rather focus on the practical ones, namely the existing model documentation
page (e.g. <a href="model_doc/bert">model docs for BERT</a>).`,ho,$e,Sl=`After you’ve grasped the basics of the models you are about to implement, it’s important to understand the existing
implementation. This is a great chance to confirm that a working implementation matches your expectations for the
model, as well as to foresee technical challenges on the TensorFlow side.`,uo,ke,Zl=`It’s perfectly natural that you feel overwhelmed with the amount of information that you’ve just absorbed. It is
definitely not a requirement that you understand all facets of the model at this stage. Nevertheless, we highly
encourage you to clear any pressing questions in our <a href="https://discuss.huggingface.co/" rel="nofollow">forum</a>.`,mo,F,q,Tt,Me,rl,ft,El="4. Model implementation",co,Le,jl=`Now it’s time to finally start coding. Our suggested starting point is the PyTorch file itself: copy the contents of
<code>modeling_brand_new_bert.py</code> inside <code>src/transformers/models/brand_new_bert/</code> into
<code>modeling_tf_brand_new_bert.py</code>. The goal of this section is to modify the file and update the import structure of
🤗 Transformers such that you can import <code>TFBrandNewBert</code> and
<code>TFBrandNewBert.from_pretrained(model_repo, from_pt=True)</code> successfully loads a working TensorFlow <em>BrandNewBert</em> model.`,fo,He,Gl=`Sadly, there is no prescription to convert a PyTorch model into TensorFlow. You can, however, follow our selection of
tips to make the process as smooth as possible:`,po,Fe,ql=`<li>Prepend <code>TF</code> to the name of all classes (e.g. <code>BrandNewBert</code> becomes <code>TFBrandNewBert</code>).</li> <li>Most PyTorch operations have a direct TensorFlow replacement. For example, <code>torch.nn.Linear</code> corresponds to
<code>tf.keras.layers.Dense</code>, <code>torch.nn.Dropout</code> corresponds to <code>tf.keras.layers.Dropout</code>, etc. If you’re not sure
about a specific operation, you can use the <a href="https://www.tensorflow.org/api_docs/python/tf" rel="nofollow">TensorFlow documentation</a>
or the <a href="https://pytorch.org/docs/stable/" rel="nofollow">PyTorch documentation</a>.</li> <li>Look for patterns in the 🤗 Transformers codebase. If you come across a certain operation that doesn’t have a direct
replacement, the odds are that someone else already had the same problem.</li> <li>By default, keep the same variable names and structure as in PyTorch. This will make it easier to debug, track
issues, and add fixes down the line.</li> <li>Some layers have different default values in each framework. A notable example is the batch normalization layer’s
epsilon (<code>1e-5</code> in <a href="https://pytorch.org/docs/stable/generated/torch.nn.BatchNorm2d.html#torch.nn.BatchNorm2d" rel="nofollow">PyTorch</a>
and <code>1e-3</code> in <a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/BatchNormalization" rel="nofollow">TensorFlow</a>).
Double-check the documentation!</li> <li>PyTorch’s <code>nn.Parameter</code> variables typically need to be initialized within TF Layer’s <code>build()</code>. See the following
example: <a href="https://github.com/huggingface/transformers/blob/655f72a6896c0533b1bdee519ed65a059c2425ac/src/transformers/models/vit_mae/modeling_vit_mae.py#L212" rel="nofollow">PyTorch</a> /
<a href="https://github.com/huggingface/transformers/blob/655f72a6896c0533b1bdee519ed65a059c2425ac/src/transformers/models/vit_mae/modeling_tf_vit_mae.py#L220" rel="nofollow">TensorFlow</a></li> <li>If the PyTorch model has a <code>#copied from ...</code> on top of a function, the odds are that your TensorFlow model can also
borrow that function from the architecture it was copied from, assuming it has a TensorFlow architecture.</li> <li>Assigning the <code>name</code> attribute correctly in TensorFlow functions is critical to do the <code>from_pt=True</code> weight
cross-loading. <code>name</code> is almost always the name of the corresponding variable in the PyTorch code. If <code>name</code> is not
properly set, you will see it in the error message when loading the model weights.</li> <li>The logic of the base model class, <code>BrandNewBertModel</code>, will actually reside in <code>TFBrandNewBertMainLayer</code>, a Keras
layer subclass (<a href="https://github.com/huggingface/transformers/blob/4fd32a1f499e45f009c2c0dea4d81c321cba7e02/src/transformers/models/bert/modeling_tf_bert.py#L719" rel="nofollow">example</a>).
<code>TFBrandNewBertModel</code> will simply be a wrapper around this layer.</li> <li>Keras models need to be built in order to load pretrained weights. For that reason, <code>TFBrandNewBertPreTrainedModel</code>
will need to hold an example of inputs to the model, the <code>dummy_inputs</code>
(<a href="https://github.com/huggingface/transformers/blob/4fd32a1f499e45f009c2c0dea4d81c321cba7e02/src/transformers/models/bert/modeling_tf_bert.py#L916" rel="nofollow">example</a>).</li> <li>If you get stuck, ask for help - we’re here to help you! 🤗</li>`,wo,Pe,Wl=`In addition to the model file itself, you will also need to add the pointers to the model classes and related
documentation pages. You can complete this part entirely following the patterns in other PRs
(<a href="https://github.com/huggingface/transformers/pull/18020/files" rel="nofollow">example</a>). Here’s a list of the needed manual
changes:`,vo,Ne,Yl="<li>Include all public classes of <em>BrandNewBert</em> in <code>src/transformers/__init__.py</code></li> <li>Add <em>BrandNewBert</em> classes to the corresponding Auto classes in <code>src/transformers/models/auto/modeling_tf_auto.py</code></li> <li>Add the lazy loading classes related to <em>BrandNewBert</em> in <code>src/transformers/utils/dummy_tf_objects.py</code></li> <li>Update the import structures for the public classes in <code>src/transformers/models/brand_new_bert/__init__.py</code></li> <li>Add the documentation pointers to the public methods of <em>BrandNewBert</em> in <code>docs/source/en/model_doc/brand_new_bert.md</code></li> <li>Add yourself to the list of contributors to <em>BrandNewBert</em> in <code>docs/source/en/model_doc/brand_new_bert.md</code></li> <li>Finally, add a green tick ✅ to the TensorFlow column of <em>BrandNewBert</em> in <code>docs/source/en/index.md</code></li>",yo,Be,Xl=`When you’re happy with your implementation, run the following checklist to confirm that your model architecture is
ready:`,go,Ue,Ol=`<li>All layers that behave differently at train time (e.g. Dropout) are called with a <code>training</code> argument, which is
propagated all the way from the top-level classes</li> <li>You have used <code>#copied from ...</code> whenever possible</li> <li><code>TFBrandNewBertMainLayer</code> and all classes that use it have their <code>call</code> function decorated with <code>@unpack_inputs</code></li> <li><code>TFBrandNewBertMainLayer</code> is decorated with <code>@keras_serializable</code></li> <li>A TensorFlow model can be loaded from PyTorch weights using <code>TFBrandNewBert.from_pretrained(model_repo, from_pt=True)</code></li> <li>You can call the TensorFlow model using the expected input format</li>`,bo,P,W,_t,Ae,sl,pt,zl="5. Add model tests",To,Ie,Ql=`Hurray, you’ve implemented a TensorFlow model! Now it’s time to add tests to make sure that your model behaves as
expected. As in the previous section, we suggest you start by copying the <code>test_modeling_brand_new_bert.py</code> file in
<code>tests/models/brand_new_bert/</code> into <code>test_modeling_tf_brand_new_bert.py</code>, and continue by making the necessary
TensorFlow replacements. For now, in all <code>.from_pretrained()</code> calls, you should use the <code>from_pt=True</code> flag to load
the existing PyTorch weights.`,_o,Je,Vl="After you’re done, it’s time for the moment of truth: run the tests! 😬",xo,Re,Co,Se,Dl=`The most likely outcome is that you’ll see a bunch of errors. Don’t worry, this is expected! Debugging ML models is
notoriously hard, and the key ingredient to success is patience (and <code>breakpoint()</code>). In our experience, the hardest
problems arise from subtle mismatches between ML frameworks, for which we have a few pointers at the end of this guide.
In other cases, a general test might not be directly applicable to your model, in which case we suggest an override
at the model test class level. Regardless of the issue, don’t hesitate to ask for help in your draft pull request if
you’re stuck.`,$o,Ze,Kl="When all tests pass, congratulations, your model is nearly ready to be added to the 🤗 Transformers library! 🎉",ko,N,Y,xt,Ee,al,wt,en="6.-7. Ensure everyone can use your model",Mo,je,tn="<strong>6. Submit the pull request</strong>",Lo,Ge,on=`Once you’re done with the implementation and the tests, it’s time to submit a pull request. Before pushing your code,
run our code formatting utility, <code>make fixup</code> 🪄. This will automatically fix any formatting issues, which would cause
our automatic checks to fail.`,Ho,qe,ln=`It’s now time to convert your draft pull request into a real pull request. To do so, click on the “Ready for
review” button and add Joao (<code>@gante</code>) and Matt (<code>@Rocketknight1</code>) as reviewers. A model pull request will need
at least 3 reviewers, but they will take care of finding appropriate additional reviewers for your model.`,Fo,We,nn=`After all reviewers are happy with the state of your PR, the final action point is to remove the <code>from_pt=True</code> flag in
<code>.from_pretrained()</code> calls. Since there are no TensorFlow weights, you will have to add them! Check the section
below for instructions on how to do it.`,Po,Ye,rn=`Finally, when the TensorFlow weights get merged, you have at least 3 reviewer approvals, and all CI checks are
green, double-check the tests locally one last time`,No,Xe,Bo,Oe,sn="and we will merge your PR! Congratulations on the milestone 🎉",Uo,ze,an="<strong>7. (Optional) Build demos and share with the world</strong>",Ao,Qe,dn=`One of the hardest parts about open-source is discovery. How can the other users learn about the existence of your
fabulous TensorFlow contribution? With proper communication, of course! 📣`,Io,Ve,hn="There are two main ways to share your model with the community:",Jo,De,un=`<li>Build demos. These include Gradio demos, notebooks, and other fun ways to show off your model. We highly
encourage you to add a notebook to our <a href="https://huggingface.co/docs/transformers/community" rel="nofollow">community-driven demos</a>.</li> <li>Share stories on social media like Twitter and LinkedIn. You should be proud of your work and share
your achievement with the community - your model can now be used by thousands of engineers and researchers around
the world 🌍! We will be happy to retweet your posts and help you share your work with the community.</li>`,Ro,B,X,Ct,Ke,dl,vt,mn="Adding TensorFlow weights to 🤗 Hub",So,et,cn=`Assuming that the TensorFlow model architecture is available in 🤗 Transformers, converting PyTorch weights into
TensorFlow weights is a breeze!`,Zo,tt,fn="Here’s how to do it:",Eo,ot,pn=`<li>Make sure you are logged into your Hugging Face account in your terminal. You can log in using the command
<code>huggingface-cli login</code> (you can find your access tokens <a href="https://huggingface.co/settings/tokens" rel="nofollow">here</a>)</li> <li>Run <code>transformers-cli pt-to-tf --model-name foo/bar</code>, where <code>foo/bar</code> is the name of the model repository
containing the PyTorch weights you want to convert</li> <li>Tag <code>@joaogante</code> and <code>@Rocketknight1</code> in the 🤗 Hub PR the command above has just created</li>`,jo,lt,wn="That’s it! 🎉",Go,U,O,$t,nt,hl,yt,vn="Debugging mismatches across ML frameworks 🐛",qo,it,yn=`At some point, when adding a new architecture or when creating TensorFlow weights for an existing architecture, you
might come across errors complaining about mismatches between PyTorch and TensorFlow. You might even decide to open the
model architecture code for the two frameworks, and find that they look identical. What’s going on? 🤔`,Wo,rt,gn=`First of all, let’s talk about why understanding these mismatches matters. Many community members will use 🤗
Transformers models out of the box, and trust that our models behave as expected. When there is a large mismatch
between the two frameworks, it implies that the model is not following the reference implementation for at least one
of the frameworks. This might lead to silent failures, in which the model runs but has poor performance. This is
arguably worse than a model that fails to run at all! To that end, we aim at having a framework mismatch smaller than
<code>1e-5</code> at all stages of the model.`,Yo,st,bn=`As in other numerical problems, the devil is in the details. And as in any detail-oriented craft, the secret
ingredient here is patience. Here is our suggested workflow for when you come across this type of issues:`,Xo,at,Tn=`<li>Locate the source of mismatches. The model you’re converting probably has near identical inner variables up to a
certain point. Place <code>breakpoint()</code> statements in the two frameworks’ architectures, and compare the values of the
numerical variables in a top-down fashion until you find the source of the problems.</li> <li>Now that you’ve pinpointed the source of the issue, get in touch with the 🤗 Transformers team. It is possible
that we’ve seen a similar problem before and can promptly provide a solution. As a fallback, scan popular pages
like StackOverflow and GitHub issues.</li> <li>If there is no solution in sight, it means you’ll have to go deeper. The good news is that you’ve located the
issue, so you can focus on the problematic instruction, abstracting away the rest of the model! The bad news is
that you’ll have to venture into the source implementation of said instruction. In some cases, you might find an
issue with a reference implementation - don’t abstain from opening an issue in the upstream repository.</li>`,Oo,dt,_n=`In some cases, in discussion with the 🤗 Transformers team, we might find that fixing the mismatch is infeasible.
When the mismatch is very small in the output layers of the model (but potentially large in the hidden states), we
might decide to ignore it in favor of distributing the model. The <code>pt-to-tf</code> CLI mentioned above has a <code>--max-error</code>
flag to override the error message at weight conversion time.`,zo,kt,Qo;return M=new z({}),A=new Rn({props:{$$slots:{default:[Wn]},$$scope:{ctx:ut}}}),oe=new z({}),se=new z({}),R=new Rn({props:{$$slots:{default:[Yn]},$$scope:{ctx:ut}}}),fe=new Q({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkYlNUJ5b3VyJTIwR2l0aHViJTIwaGFuZGxlJTVEJTJGdHJhbnNmb3JtZXJzLmdpdCUwQWNkJTIwdHJhbnNmb3JtZXJzJTBBZ2l0JTIwcmVtb3RlJTIwYWRkJTIwdXBzdHJlYW0lMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRnRyYW5zZm9ybWVycy5naXQ=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/[your Github handle]/transformers.git
<span class="hljs-built_in">cd</span> transformers
git remote add upstream https://github.com/huggingface/transformers.git`,wrap:!1}}),pe=new Q({props:{code:"cHl0aG9uJTIwLW0lMjB2ZW52JTIwLmVudiUwQXNvdXJjZSUyMC5lbnYlMkZiaW4lMkZhY3RpdmF0ZSUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMCUyMi4lNUJkZXYlNUQlMjI=",highlighted:`python -m venv .<span class="hljs-built_in">env</span>
<span class="hljs-built_in">source</span> .<span class="hljs-built_in">env</span>/bin/activate
pip install -e <span class="hljs-string">&quot;.[dev]&quot;</span>`,wrap:!1}}),ve=new Q({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1lJTIwJTIyLiU1QnF1YWxpdHklNUQlMjI=",highlighted:'pip install -e <span class="hljs-string">&quot;.[quality]&quot;</span>',wrap:!1}}),ge=new Q({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjAtYiUyMGFkZF90Zl9icmFuZF9uZXdfYmVydA==",highlighted:"git checkout -b add_tf_brand_new_bert",wrap:!1}}),be=new Q({props:{code:"Z2l0JTIwZmV0Y2glMjB1cHN0cmVhbSUwQWdpdCUyMHJlYmFzZSUyMHVwc3RyZWFtJTJGbWFpbg==",highlighted:`git fetch upstream
git rebase upstream/main`,wrap:!1}}),Te=new Q({props:{code:"Z2l0JTIwYWRkJTIwLiUwQWdpdCUyMGNvbW1pdCUyMC1tJTIwJTIyaW5pdGlhbCUyMGNvbW1pdCUyMiUwQWdpdCUyMHB1c2glMjAtdSUyMG9yaWdpbiUyMGFkZF90Zl9icmFuZF9uZXdfYmVydA==",highlighted:`git add .
git commit -m <span class="hljs-string">&quot;initial commit&quot;</span>
git push -u origin add_tf_brand_new_bert`,wrap:!1}}),Me=new z({}),Ae=new z({}),Re=new Q({props:{code:"TlZJRElBX1RGMzJfT1ZFUlJJREUlM0QwJTIwUlVOX1NMT1clM0QxJTIwUlVOX1BUX1RGX0NST1NTX1RFU1RTJTNEMSUyMCU1QyUwQXB5LnRlc3QlMjAtdnYlMjB0ZXN0cyUyRm1vZGVscyUyRmJyYW5kX25ld19iZXJ0JTJGdGVzdF9tb2RlbGluZ190Zl9icmFuZF9uZXdfYmVydC5weQ==",highlighted:`NVIDIA_TF32_OVERRIDE=0 RUN_SLOW=1 RUN_PT_TF_CROSS_TESTS=1 \\
py.test -vv tests/models/brand_new_bert/test_modeling_tf_brand_new_bert.py`,wrap:!1}}),Ee=new z({}),Xe=new Q({props:{code:"TlZJRElBX1RGMzJfT1ZFUlJJREUlM0QwJTIwUlVOX1NMT1clM0QxJTIwUlVOX1BUX1RGX0NST1NTX1RFU1RTJTNEMSUyMCU1QyUwQXB5LnRlc3QlMjAtdnYlMjB0ZXN0cyUyRm1vZGVscyUyRmJyYW5kX25ld19iZXJ0JTJGdGVzdF9tb2RlbGluZ190Zl9icmFuZF9uZXdfYmVydC5weQ==",highlighted:`NVIDIA_TF32_OVERRIDE=0 RUN_SLOW=1 RUN_PT_TF_CROSS_TESTS=1 \\
py.test -vv tests/models/brand_new_bert/test_modeling_tf_brand_new_bert.py`,wrap:!1}}),Ke=new z({}),nt=new z({}),{c(){m=n("meta"),k=r(),b=n("p"),T=r(),C=n("h1"),_=n("a"),x=n("span"),c(M.$$.fragment),g=r(),$=n("span"),$.textContent=ul,Lt=r(),V=n("p"),V.innerHTML=ml,Ht=r(),D=n("p"),D.textContent=cl,Ft=r(),K=n("p"),K.textContent=fl,Pt=r(),ee=n("ul"),ee.innerHTML=pl,Nt=r(),te=n("p"),te.textContent=wl,Bt=r(),c(A.$$.fragment),Ut=r(),L=n("h2"),I=n("a"),gt=n("span"),c(oe.$$.fragment),nl=r(),mt=n("span"),mt.textContent=vl,At=r(),le=n("p"),le.innerHTML=yl,It=r(),ne=n("ul"),ne.innerHTML=gl,Jt=r(),ie=n("p"),ie.textContent=bl,Rt=r(),re=n("ol"),re.innerHTML=Tl,St=r(),H=n("h3"),J=n("a"),bt=n("span"),c(se.$$.fragment),il=r(),ct=n("span"),ct.textContent=_l,Zt=r(),ae=n("p"),ae.innerHTML=xl,Et=r(),de=n("p"),de.innerHTML=Cl,jt=r(),he=n("p"),he.innerHTML=$l,Gt=r(),c(R.$$.fragment),qt=r(),ue=n("p"),ue.innerHTML=kl,Wt=r(),me=n("p"),me.textContent=Ml,Yt=r(),ce=n("ol"),ce.innerHTML=Ll,Xt=r(),c(fe.$$.fragment),Ot=r(),S=n("ol"),S.innerHTML=Hl,zt=r(),c(pe.$$.fragment),Qt=r(),we=n("p"),we.textContent=Fl,Vt=r(),c(ve.$$.fragment),Dt=r(),ye=n("p"),ye.innerHTML=Pl,Kt=r(),Z=n("ol"),Z.innerHTML=Nl,eo=r(),c(ge.$$.fragment),to=r(),E=n("ol"),E.innerHTML=Bl,oo=r(),c(be.$$.fragment),lo=r(),j=n("ol"),j.innerHTML=Ul,no=r(),c(Te.$$.fragment),io=r(),G=n("ol"),G.innerHTML=Al,ro=r(),_e=n("p"),_e.innerHTML=Il,so=r(),xe=n("p"),xe.innerHTML=Jl,ao=r(),Ce=n("p"),Ce.innerHTML=Rl,ho=r(),$e=n("p"),$e.textContent=Sl,uo=r(),ke=n("p"),ke.innerHTML=Zl,mo=r(),F=n("h3"),q=n("a"),Tt=n("span"),c(Me.$$.fragment),rl=r(),ft=n("span"),ft.textContent=El,co=r(),Le=n("p"),Le.innerHTML=jl,fo=r(),He=n("p"),He.textContent=Gl,po=r(),Fe=n("ul"),Fe.innerHTML=ql,wo=r(),Pe=n("p"),Pe.innerHTML=Wl,vo=r(),Ne=n("ul"),Ne.innerHTML=Yl,yo=r(),Be=n("p"),Be.textContent=Xl,go=r(),Ue=n("ol"),Ue.innerHTML=Ol,bo=r(),P=n("h3"),W=n("a"),_t=n("span"),c(Ae.$$.fragment),sl=r(),pt=n("span"),pt.textContent=zl,To=r(),Ie=n("p"),Ie.innerHTML=Ql,_o=r(),Je=n("p"),Je.textContent=Vl,xo=r(),c(Re.$$.fragment),Co=r(),Se=n("p"),Se.innerHTML=Dl,$o=r(),Ze=n("p"),Ze.textContent=Kl,ko=r(),N=n("h3"),Y=n("a"),xt=n("span"),c(Ee.$$.fragment),al=r(),wt=n("span"),wt.textContent=en,Mo=r(),je=n("p"),je.innerHTML=tn,Lo=r(),Ge=n("p"),Ge.innerHTML=on,Ho=r(),qe=n("p"),qe.innerHTML=ln,Fo=r(),We=n("p"),We.innerHTML=nn,Po=r(),Ye=n("p"),Ye.textContent=rn,No=r(),c(Xe.$$.fragment),Bo=r(),Oe=n("p"),Oe.textContent=sn,Uo=r(),ze=n("p"),ze.innerHTML=an,Ao=r(),Qe=n("p"),Qe.textContent=dn,Io=r(),Ve=n("p"),Ve.textContent=hn,Jo=r(),De=n("ul"),De.innerHTML=un,Ro=r(),B=n("h2"),X=n("a"),Ct=n("span"),c(Ke.$$.fragment),dl=r(),vt=n("span"),vt.textContent=mn,So=r(),et=n("p"),et.textContent=cn,Zo=r(),tt=n("p"),tt.textContent=fn,Eo=r(),ot=n("ol"),ot.innerHTML=pn,jo=r(),lt=n("p"),lt.textContent=wn,Go=r(),U=n("h2"),O=n("a"),$t=n("span"),c(nt.$$.fragment),hl=r(),yt=n("span"),yt.textContent=vn,qo=r(),it=n("p"),it.textContent=yn,Wo=r(),rt=n("p"),rt.innerHTML=gn,Yo=r(),st=n("p"),st.textContent=bn,Xo=r(),at=n("ol"),at.innerHTML=Tn,Oo=r(),dt=n("p"),dt.innerHTML=_n,zo=r(),kt=n("p"),this.h()},l(e){const o=qn("svelte-1phssyn",document.head);m=i(o,"META",{name:!0,content:!0}),o.forEach(t),k=s(e),b=i(e,"P",{}),u(b).forEach(t),T=s(e),C=i(e,"H1",{class:!0});var ht=u(C);_=i(ht,"A",{id:!0,class:!0,href:!0});var Mt=u(_);x=i(Mt,"SPAN",{});var xn=u(x);f(M.$$.fragment,xn),xn.forEach(t),Mt.forEach(t),g=s(ht),$=i(ht,"SPAN",{"data-svelte-h":!0}),a($)!=="svelte-lanu9p"&&($.textContent=ul),ht.forEach(t),Lt=s(e),V=i(e,"P",{"data-svelte-h":!0}),a(V)!=="svelte-un598u"&&(V.innerHTML=ml),Ht=s(e),D=i(e,"P",{"data-svelte-h":!0}),a(D)!=="svelte-1m7mnyo"&&(D.textContent=cl),Ft=s(e),K=i(e,"P",{"data-svelte-h":!0}),a(K)!=="svelte-1a30pti"&&(K.textContent=fl),Pt=s(e),ee=i(e,"UL",{"data-svelte-h":!0}),a(ee)!=="svelte-1syo9f3"&&(ee.innerHTML=pl),Nt=s(e),te=i(e,"P",{"data-svelte-h":!0}),a(te)!=="svelte-flc7p5"&&(te.textContent=wl),Bt=s(e),f(A.$$.fragment,e),Ut=s(e),L=i(e,"H2",{class:!0});var Vo=u(L);I=i(Vo,"A",{id:!0,class:!0,href:!0});var Cn=u(I);gt=i(Cn,"SPAN",{});var $n=u(gt);f(oe.$$.fragment,$n),$n.forEach(t),Cn.forEach(t),nl=s(Vo),mt=i(Vo,"SPAN",{"data-svelte-h":!0}),a(mt)!=="svelte-1isea90"&&(mt.textContent=vl),Vo.forEach(t),At=s(e),le=i(e,"P",{"data-svelte-h":!0}),a(le)!=="svelte-1nfvtxf"&&(le.innerHTML=yl),It=s(e),ne=i(e,"UL",{"data-svelte-h":!0}),a(ne)!=="svelte-r4pwei"&&(ne.innerHTML=gl),Jt=s(e),ie=i(e,"P",{"data-svelte-h":!0}),a(ie)!=="svelte-12ug9wa"&&(ie.textContent=bl),Rt=s(e),re=i(e,"OL",{"data-svelte-h":!0}),a(re)!=="svelte-b2inhb"&&(re.innerHTML=Tl),St=s(e),H=i(e,"H3",{class:!0});var Do=u(H);J=i(Do,"A",{id:!0,class:!0,href:!0});var kn=u(J);bt=i(kn,"SPAN",{});var Mn=u(bt);f(se.$$.fragment,Mn),Mn.forEach(t),kn.forEach(t),il=s(Do),ct=i(Do,"SPAN",{"data-svelte-h":!0}),a(ct)!=="svelte-6nhupf"&&(ct.textContent=_l),Do.forEach(t),Zt=s(e),ae=i(e,"P",{"data-svelte-h":!0}),a(ae)!=="svelte-rqidwu"&&(ae.innerHTML=xl),Et=s(e),de=i(e,"P",{"data-svelte-h":!0}),a(de)!=="svelte-15g871i"&&(de.innerHTML=Cl),jt=s(e),he=i(e,"P",{"data-svelte-h":!0}),a(he)!=="svelte-mkqbuc"&&(he.innerHTML=$l),Gt=s(e),f(R.$$.fragment,e),qt=s(e),ue=i(e,"P",{"data-svelte-h":!0}),a(ue)!=="svelte-w68cw6"&&(ue.innerHTML=kl),Wt=s(e),me=i(e,"P",{"data-svelte-h":!0}),a(me)!=="svelte-4rco38"&&(me.textContent=Ml),Yt=s(e),ce=i(e,"OL",{"data-svelte-h":!0}),a(ce)!=="svelte-klt7ii"&&(ce.innerHTML=Ll),Xt=s(e),f(fe.$$.fragment,e),Ot=s(e),S=i(e,"OL",{start:!0,"data-svelte-h":!0}),a(S)!=="svelte-9h285g"&&(S.innerHTML=Hl),zt=s(e),f(pe.$$.fragment,e),Qt=s(e),we=i(e,"P",{"data-svelte-h":!0}),a(we)!=="svelte-23rgus"&&(we.textContent=Fl),Vt=s(e),f(ve.$$.fragment,e),Dt=s(e),ye=i(e,"P",{"data-svelte-h":!0}),a(ye)!=="svelte-6bybv3"&&(ye.innerHTML=Pl),Kt=s(e),Z=i(e,"OL",{start:!0,"data-svelte-h":!0}),a(Z)!=="svelte-1v0vz83"&&(Z.innerHTML=Nl),eo=s(e),f(ge.$$.fragment,e),to=s(e),E=i(e,"OL",{start:!0,"data-svelte-h":!0}),a(E)!=="svelte-kgyer5"&&(E.innerHTML=Bl),oo=s(e),f(be.$$.fragment,e),lo=s(e),j=i(e,"OL",{start:!0,"data-svelte-h":!0}),a(j)!=="svelte-1pq71wn"&&(j.innerHTML=Ul),no=s(e),f(Te.$$.fragment,e),io=s(e),G=i(e,"OL",{start:!0,"data-svelte-h":!0}),a(G)!=="svelte-1ekq61w"&&(G.innerHTML=Al),ro=s(e),_e=i(e,"P",{"data-svelte-h":!0}),a(_e)!=="svelte-beu7sg"&&(_e.innerHTML=Il),so=s(e),xe=i(e,"P",{"data-svelte-h":!0}),a(xe)!=="svelte-1l0tpib"&&(xe.innerHTML=Jl),ao=s(e),Ce=i(e,"P",{"data-svelte-h":!0}),a(Ce)!=="svelte-1get462"&&(Ce.innerHTML=Rl),ho=s(e),$e=i(e,"P",{"data-svelte-h":!0}),a($e)!=="svelte-16kl1f2"&&($e.textContent=Sl),uo=s(e),ke=i(e,"P",{"data-svelte-h":!0}),a(ke)!=="svelte-1skghto"&&(ke.innerHTML=Zl),mo=s(e),F=i(e,"H3",{class:!0});var Ko=u(F);q=i(Ko,"A",{id:!0,class:!0,href:!0});var Ln=u(q);Tt=i(Ln,"SPAN",{});var Hn=u(Tt);f(Me.$$.fragment,Hn),Hn.forEach(t),Ln.forEach(t),rl=s(Ko),ft=i(Ko,"SPAN",{"data-svelte-h":!0}),a(ft)!=="svelte-1ir078"&&(ft.textContent=El),Ko.forEach(t),co=s(e),Le=i(e,"P",{"data-svelte-h":!0}),a(Le)!=="svelte-94ipqa"&&(Le.innerHTML=jl),fo=s(e),He=i(e,"P",{"data-svelte-h":!0}),a(He)!=="svelte-55id0v"&&(He.textContent=Gl),po=s(e),Fe=i(e,"UL",{"data-svelte-h":!0}),a(Fe)!=="svelte-p4ei59"&&(Fe.innerHTML=ql),wo=s(e),Pe=i(e,"P",{"data-svelte-h":!0}),a(Pe)!=="svelte-q00s49"&&(Pe.innerHTML=Wl),vo=s(e),Ne=i(e,"UL",{"data-svelte-h":!0}),a(Ne)!=="svelte-16283o5"&&(Ne.innerHTML=Yl),yo=s(e),Be=i(e,"P",{"data-svelte-h":!0}),a(Be)!=="svelte-16z62s3"&&(Be.textContent=Xl),go=s(e),Ue=i(e,"OL",{"data-svelte-h":!0}),a(Ue)!=="svelte-fev0iu"&&(Ue.innerHTML=Ol),bo=s(e),P=i(e,"H3",{class:!0});var el=u(P);W=i(el,"A",{id:!0,class:!0,href:!0});var Fn=u(W);_t=i(Fn,"SPAN",{});var Pn=u(_t);f(Ae.$$.fragment,Pn),Pn.forEach(t),Fn.forEach(t),sl=s(el),pt=i(el,"SPAN",{"data-svelte-h":!0}),a(pt)!=="svelte-4zgi31"&&(pt.textContent=zl),el.forEach(t),To=s(e),Ie=i(e,"P",{"data-svelte-h":!0}),a(Ie)!=="svelte-1y1b8z6"&&(Ie.innerHTML=Ql),_o=s(e),Je=i(e,"P",{"data-svelte-h":!0}),a(Je)!=="svelte-1iuoan0"&&(Je.textContent=Vl),xo=s(e),f(Re.$$.fragment,e),Co=s(e),Se=i(e,"P",{"data-svelte-h":!0}),a(Se)!=="svelte-1dqjbww"&&(Se.innerHTML=Dl),$o=s(e),Ze=i(e,"P",{"data-svelte-h":!0}),a(Ze)!=="svelte-uwxrp8"&&(Ze.textContent=Kl),ko=s(e),N=i(e,"H3",{class:!0});var tl=u(N);Y=i(tl,"A",{id:!0,class:!0,href:!0});var Nn=u(Y);xt=i(Nn,"SPAN",{});var Bn=u(xt);f(Ee.$$.fragment,Bn),Bn.forEach(t),Nn.forEach(t),al=s(tl),wt=i(tl,"SPAN",{"data-svelte-h":!0}),a(wt)!=="svelte-ieit2v"&&(wt.textContent=en),tl.forEach(t),Mo=s(e),je=i(e,"P",{"data-svelte-h":!0}),a(je)!=="svelte-1xzf20w"&&(je.innerHTML=tn),Lo=s(e),Ge=i(e,"P",{"data-svelte-h":!0}),a(Ge)!=="svelte-11dmfnu"&&(Ge.innerHTML=on),Ho=s(e),qe=i(e,"P",{"data-svelte-h":!0}),a(qe)!=="svelte-1ul6csg"&&(qe.innerHTML=ln),Fo=s(e),We=i(e,"P",{"data-svelte-h":!0}),a(We)!=="svelte-cvn3sg"&&(We.innerHTML=nn),Po=s(e),Ye=i(e,"P",{"data-svelte-h":!0}),a(Ye)!=="svelte-19emp5y"&&(Ye.textContent=rn),No=s(e),f(Xe.$$.fragment,e),Bo=s(e),Oe=i(e,"P",{"data-svelte-h":!0}),a(Oe)!=="svelte-fqsbir"&&(Oe.textContent=sn),Uo=s(e),ze=i(e,"P",{"data-svelte-h":!0}),a(ze)!=="svelte-jtwtfe"&&(ze.innerHTML=an),Ao=s(e),Qe=i(e,"P",{"data-svelte-h":!0}),a(Qe)!=="svelte-jr9wmb"&&(Qe.textContent=dn),Io=s(e),Ve=i(e,"P",{"data-svelte-h":!0}),a(Ve)!=="svelte-k5t6bl"&&(Ve.textContent=hn),Jo=s(e),De=i(e,"UL",{"data-svelte-h":!0}),a(De)!=="svelte-uzeeja"&&(De.innerHTML=un),Ro=s(e),B=i(e,"H2",{class:!0});var ol=u(B);X=i(ol,"A",{id:!0,class:!0,href:!0});var Un=u(X);Ct=i(Un,"SPAN",{});var An=u(Ct);f(Ke.$$.fragment,An),An.forEach(t),Un.forEach(t),dl=s(ol),vt=i(ol,"SPAN",{"data-svelte-h":!0}),a(vt)!=="svelte-10q1feb"&&(vt.textContent=mn),ol.forEach(t),So=s(e),et=i(e,"P",{"data-svelte-h":!0}),a(et)!=="svelte-1gp1v2d"&&(et.textContent=cn),Zo=s(e),tt=i(e,"P",{"data-svelte-h":!0}),a(tt)!=="svelte-1g6cxz5"&&(tt.textContent=fn),Eo=s(e),ot=i(e,"OL",{"data-svelte-h":!0}),a(ot)!=="svelte-o72q35"&&(ot.innerHTML=pn),jo=s(e),lt=i(e,"P",{"data-svelte-h":!0}),a(lt)!=="svelte-c3r53s"&&(lt.textContent=wn),Go=s(e),U=i(e,"H2",{class:!0});var ll=u(U);O=i(ll,"A",{id:!0,class:!0,href:!0});var In=u(O);$t=i(In,"SPAN",{});var Jn=u($t);f(nt.$$.fragment,Jn),Jn.forEach(t),In.forEach(t),hl=s(ll),yt=i(ll,"SPAN",{"data-svelte-h":!0}),a(yt)!=="svelte-c0dibq"&&(yt.textContent=vn),ll.forEach(t),qo=s(e),it=i(e,"P",{"data-svelte-h":!0}),a(it)!=="svelte-1u5xu5o"&&(it.textContent=yn),Wo=s(e),rt=i(e,"P",{"data-svelte-h":!0}),a(rt)!=="svelte-15riypa"&&(rt.innerHTML=gn),Yo=s(e),st=i(e,"P",{"data-svelte-h":!0}),a(st)!=="svelte-gy3qi9"&&(st.textContent=bn),Xo=s(e),at=i(e,"OL",{"data-svelte-h":!0}),a(at)!=="svelte-1l2xrm5"&&(at.innerHTML=Tn),Oo=s(e),dt=i(e,"P",{"data-svelte-h":!0}),a(dt)!=="svelte-1qzb4ip"&&(dt.innerHTML=_n),zo=s(e),kt=i(e,"P",{}),u(kt).forEach(t),this.h()},h(){d(m,"name","hf:doc:metadata"),d(m,"content",JSON.stringify(On)),d(_,"id","how-to-convert-a-transformers-model-to-tensorflow"),d(_,"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"),d(_,"href","#how-to-convert-a-transformers-model-to-tensorflow"),d(C,"class","relative group"),d(I,"id","stepbystep-guide-to-add-tensorflow-model-architecture-code"),d(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"),d(I,"href","#stepbystep-guide-to-add-tensorflow-model-architecture-code"),d(L,"class","relative group"),d(J,"id","13-prepare-your-model-contribution"),d(J,"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"),d(J,"href","#13-prepare-your-model-contribution"),d(H,"class","relative group"),d(S,"start","3"),d(Z,"start","4"),d(E,"start","5"),d(j,"start","6"),d(G,"start","8"),d(q,"id","4-model-implementation"),d(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"),d(q,"href","#4-model-implementation"),d(F,"class","relative group"),d(W,"id","5-add-model-tests"),d(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"),d(W,"href","#5-add-model-tests"),d(P,"class","relative group"),d(Y,"id","67-ensure-everyone-can-use-your-model"),d(Y,"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"),d(Y,"href","#67-ensure-everyone-can-use-your-model"),d(N,"class","relative group"),d(X,"id","adding-tensorflow-weights-to-hub"),d(X,"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"),d(X,"href","#adding-tensorflow-weights-to-hub"),d(B,"class","relative group"),d(O,"id","debugging-mismatches-across-ml-frameworks"),d(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"),d(O,"href","#debugging-mismatches-across-ml-frameworks"),d(U,"class","relative group")},m(e,o){h(document.head,m),l(e,k,o),l(e,b,o),l(e,T,o),l(e,C,o),h(C,_),h(_,x),p(M,x,null),h(C,g),h(C,$),l(e,Lt,o),l(e,V,o),l(e,Ht,o),l(e,D,o),l(e,Ft,o),l(e,K,o),l(e,Pt,o),l(e,ee,o),l(e,Nt,o),l(e,te,o),l(e,Bt,o),p(A,e,o),l(e,Ut,o),l(e,L,o),h(L,I),h(I,gt),p(oe,gt,null),h(L,nl),h(L,mt),l(e,At,o),l(e,le,o),l(e,It,o),l(e,ne,o),l(e,Jt,o),l(e,ie,o),l(e,Rt,o),l(e,re,o),l(e,St,o),l(e,H,o),h(H,J),h(J,bt),p(se,bt,null),h(H,il),h(H,ct),l(e,Zt,o),l(e,ae,o),l(e,Et,o),l(e,de,o),l(e,jt,o),l(e,he,o),l(e,Gt,o),p(R,e,o),l(e,qt,o),l(e,ue,o),l(e,Wt,o),l(e,me,o),l(e,Yt,o),l(e,ce,o),l(e,Xt,o),p(fe,e,o),l(e,Ot,o),l(e,S,o),l(e,zt,o),p(pe,e,o),l(e,Qt,o),l(e,we,o),l(e,Vt,o),p(ve,e,o),l(e,Dt,o),l(e,ye,o),l(e,Kt,o),l(e,Z,o),l(e,eo,o),p(ge,e,o),l(e,to,o),l(e,E,o),l(e,oo,o),p(be,e,o),l(e,lo,o),l(e,j,o),l(e,no,o),p(Te,e,o),l(e,io,o),l(e,G,o),l(e,ro,o),l(e,_e,o),l(e,so,o),l(e,xe,o),l(e,ao,o),l(e,Ce,o),l(e,ho,o),l(e,$e,o),l(e,uo,o),l(e,ke,o),l(e,mo,o),l(e,F,o),h(F,q),h(q,Tt),p(Me,Tt,null),h(F,rl),h(F,ft),l(e,co,o),l(e,Le,o),l(e,fo,o),l(e,He,o),l(e,po,o),l(e,Fe,o),l(e,wo,o),l(e,Pe,o),l(e,vo,o),l(e,Ne,o),l(e,yo,o),l(e,Be,o),l(e,go,o),l(e,Ue,o),l(e,bo,o),l(e,P,o),h(P,W),h(W,_t),p(Ae,_t,null),h(P,sl),h(P,pt),l(e,To,o),l(e,Ie,o),l(e,_o,o),l(e,Je,o),l(e,xo,o),p(Re,e,o),l(e,Co,o),l(e,Se,o),l(e,$o,o),l(e,Ze,o),l(e,ko,o),l(e,N,o),h(N,Y),h(Y,xt),p(Ee,xt,null),h(N,al),h(N,wt),l(e,Mo,o),l(e,je,o),l(e,Lo,o),l(e,Ge,o),l(e,Ho,o),l(e,qe,o),l(e,Fo,o),l(e,We,o),l(e,Po,o),l(e,Ye,o),l(e,No,o),p(Xe,e,o),l(e,Bo,o),l(e,Oe,o),l(e,Uo,o),l(e,ze,o),l(e,Ao,o),l(e,Qe,o),l(e,Io,o),l(e,Ve,o),l(e,Jo,o),l(e,De,o),l(e,Ro,o),l(e,B,o),h(B,X),h(X,Ct),p(Ke,Ct,null),h(B,dl),h(B,vt),l(e,So,o),l(e,et,o),l(e,Zo,o),l(e,tt,o),l(e,Eo,o),l(e,ot,o),l(e,jo,o),l(e,lt,o),l(e,Go,o),l(e,U,o),h(U,O),h(O,$t),p(nt,$t,null),h(U,hl),h(U,yt),l(e,qo,o),l(e,it,o),l(e,Wo,o),l(e,rt,o),l(e,Yo,o),l(e,st,o),l(e,Xo,o),l(e,at,o),l(e,Oo,o),l(e,dt,o),l(e,zo,o),l(e,kt,o),Qo=!0},p(e,[o]){const ht={};o&2&&(ht.$$scope={dirty:o,ctx:e}),A.$set(ht);const Mt={};o&2&&(Mt.$$scope={dirty:o,ctx:e}),R.$set(Mt)},i(e){Qo||(w(M.$$.fragment,e),w(A.$$.fragment,e),w(oe.$$.fragment,e),w(se.$$.fragment,e),w(R.$$.fragment,e),w(fe.$$.fragment,e),w(pe.$$.fragment,e),w(ve.$$.fragment,e),w(ge.$$.fragment,e),w(be.$$.fragment,e),w(Te.$$.fragment,e),w(Me.$$.fragment,e),w(Ae.$$.fragment,e),w(Re.$$.fragment,e),w(Ee.$$.fragment,e),w(Xe.$$.fragment,e),w(Ke.$$.fragment,e),w(nt.$$.fragment,e),Qo=!0)},o(e){v(M.$$.fragment,e),v(A.$$.fragment,e),v(oe.$$.fragment,e),v(se.$$.fragment,e),v(R.$$.fragment,e),v(fe.$$.fragment,e),v(pe.$$.fragment,e),v(ve.$$.fragment,e),v(ge.$$.fragment,e),v(be.$$.fragment,e),v(Te.$$.fragment,e),v(Me.$$.fragment,e),v(Ae.$$.fragment,e),v(Re.$$.fragment,e),v(Ee.$$.fragment,e),v(Xe.$$.fragment,e),v(Ke.$$.fragment,e),v(nt.$$.fragment,e),Qo=!1},d(e){e&&(t(k),t(b),t(T),t(C),t(Lt),t(V),t(Ht),t(D),t(Ft),t(K),t(Pt),t(ee),t(Nt),t(te),t(Bt),t(Ut),t(L),t(At),t(le),t(It),t(ne),t(Jt),t(ie),t(Rt),t(re),t(St),t(H),t(Zt),t(ae),t(Et),t(de),t(jt),t(he),t(Gt),t(qt),t(ue),t(Wt),t(me),t(Yt),t(ce),t(Xt),t(Ot),t(S),t(zt),t(Qt),t(we),t(Vt),t(Dt),t(ye),t(Kt),t(Z),t(eo),t(to),t(E),t(oo),t(lo),t(j),t(no),t(io),t(G),t(ro),t(_e),t(so),t(xe),t(ao),t(Ce),t(ho),t($e),t(uo),t(ke),t(mo),t(F),t(co),t(Le),t(fo),t(He),t(po),t(Fe),t(wo),t(Pe),t(vo),t(Ne),t(yo),t(Be),t(go),t(Ue),t(bo),t(P),t(To),t(Ie),t(_o),t(Je),t(xo),t(Co),t(Se),t($o),t(Ze),t(ko),t(N),t(Mo),t(je),t(Lo),t(Ge),t(Ho),t(qe),t(Fo),t(We),t(Po),t(Ye),t(No),t(Bo),t(Oe),t(Uo),t(ze),t(Ao),t(Qe),t(Io),t(Ve),t(Jo),t(De),t(Ro),t(B),t(So),t(et),t(Zo),t(tt),t(Eo),t(ot),t(jo),t(lt),t(Go),t(U),t(qo),t(it),t(Wo),t(rt),t(Yo),t(st),t(Xo),t(at),t(Oo),t(dt),t(zo),t(kt)),t(m),y(M),y(A,e),y(oe),y(se),y(R,e),y(fe,e),y(pe,e),y(ve,e),y(ge,e),y(be,e),y(Te,e),y(Me),y(Ae),y(Re,e),y(Ee),y(Xe,e),y(Ke),y(nt)}}}const On={local:"how-to-convert-a-transformers-model-to-tensorflow",sections:[{local:"stepbystep-guide-to-add-tensorflow-model-architecture-code",sections:[{local:"13-prepare-your-model-contribution",title:"1.-3. Prepare your model contribution"},{local:"4-model-implementation",title:"4. Model implementation"},{local:"5-add-model-tests",title:"5. Add model tests"},{local:"67-ensure-everyone-can-use-your-model",title:"6.-7. Ensure everyone can use your model"}],title:"Step-by-step guide to add TensorFlow model architecture code"},{local:"adding-tensorflow-weights-to-hub",title:"Adding TensorFlow weights to 🤗 Hub"},{local:"debugging-mismatches-across-ml-frameworks",title:"Debugging mismatches across ML frameworks 🐛"}],title:"How to convert a 🤗 Transformers model to TensorFlow?"};function zn(ut){return En(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ti extends jn{constructor(m){super(),Gn(this,m,zn,Xn,Zn,{})}}export{ti as component};
