import{s as qn,o as Xn,n as Yn}from"../chunks/scheduler.9bc65507.js";import{S as zn,i as En,g as r,s as l,r as c,A as On,h as s,f as o,c as i,j as P,u as f,x as a,k as An,y as d,a as n,v as p,d as w,t as g,w as y}from"../chunks/index.707bf1b6.js";import{T as Wn}from"../chunks/Tip.c2ecdbf4.js";import{C as B}from"../chunks/CodeBlock.54a9f38d.js";import{H as U,E as Qn}from"../chunks/EditOnGithub.922df6ba.js";function Vn(Ee){let m,C="Are you unsure whether the model you wish to use already has a corresponding TensorFlow architecture?",v,_,M=" ",k,T,rt=`Check the <code>model_type</code> field of the <code>config.json</code> of your model of choice
(<a href="https://huggingface.co/google-bert/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=r("p"),m.textContent=C,v=l(),_=r("p"),_.textContent=M,k=l(),T=r("p"),T.innerHTML=rt},l(b){m=s(b,"P",{"data-svelte-h":!0}),a(m)!=="svelte-bjpicv"&&(m.textContent=C),v=i(b),_=s(b,"P",{"data-svelte-h":!0}),a(_)!=="svelte-1cdgjs8"&&(_.textContent=M),k=i(b),T=s(b,"P",{"data-svelte-h":!0}),a(T)!=="svelte-3e85js"&&(T.innerHTML=rt)},m(b,$){n(b,m,$),n(b,v,$),n(b,_,$),n(b,k,$),n(b,T,$)},p:Yn,d(b){b&&(o(m),o(v),o(_),o(k),o(T))}}}function Dn(Ee){let m,C=`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=r("p"),m.innerHTML=C},l(v){m=s(v,"P",{"data-svelte-h":!0}),a(m)!=="svelte-1238l2j"&&(m.innerHTML=C)},m(v,_){n(v,m,_)},p:Yn,d(v){v&&o(m)}}}function Kn(Ee){let m,C,v,_,M,k,T,rt=`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.`,b,$,Jo=`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!`,at,I,No="Before you dive deeper, it is recommended that you check the following resources if you’re new to 🤗 Transformers:",dt,R,Zo='<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>',mt,J,jo=`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!`,ht,H,ut,N,ct,Z,Go=`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:`,ft,j,So=`<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>`,pt,G,Ao="Here’s an overview of the steps needed to add a TensorFlow model architecture:",wt,S,Wo="<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>",gt,A,yt,W,Yo="<strong>1. Select the model you wish to convert</strong>",bt,Y,qo=`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.`,vt,q,Xo=`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).`,Tt,F,_t,X,zo="<strong>2. Prepare transformers dev environment</strong>",$t,z,Eo=`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.`,xt,h,Oe,Oo=`<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>`,vo,E,Qe,Qo="Clone your <code>transformers</code> fork to your local disk, and add the base repository as a remote:",To,O,_o,x,Ve,Vo="Set up a development environment, for instance by running the following commands:",$o,Q,xo,De,Do=`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:`,Co,V,Mo,Ke,Ko="<strong>Note:</strong> You don’t need to have CUDA installed. Making the new model work on CPU is sufficient.",Lo,D,et,en="Create a branch with a descriptive name from your main branch:",ko,K,Ho,ee,tt,tn="Fetch and rebase to current main:",Fo,te,Po,ot,on=`<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>`,Bo,oe,nt,nn="Push the changes to your account using:",Uo,ne,Io,lt,ln=`<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>`,Ro,it,rn="<p>Change the PR into a draft by clicking on “Convert to draft” on the right of the GitHub pull request web page.</p>",Ct,le,sn="Now you have set up a development environment to port <em>BrandNewBert</em> to TensorFlow in 🤗 Transformers.",Mt,ie,an="<strong>3. (Optional) Understand theoretical aspects and the existing implementation</strong>",Lt,re,dn=`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>).`,kt,se,mn=`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.`,Ht,ae,hn=`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>.`,Ft,de,Pt,me,un=`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.`,Bt,he,cn=`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:`,Ut,ue,fn=`<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>`,It,ce,pn=`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:`,Rt,fe,wn="<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>",Jt,pe,gn=`When you’re happy with your implementation, run the following checklist to confirm that your model architecture is
ready:`,Nt,we,yn=`<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>`,Zt,ge,jt,ye,bn=`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.`,Gt,be,vn="After you’re done, it’s time for the moment of truth: run the tests! 😬",St,ve,At,Te,Tn=`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.`,Wt,_e,_n="When all tests pass, congratulations, your model is nearly ready to be added to the 🤗 Transformers library! 🎉",Yt,$e,qt,xe,$n="<strong>6. Submit the pull request</strong>",Xt,Ce,xn=`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.`,zt,Me,Cn=`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.`,Et,Le,Mn=`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.`,Ot,ke,Ln=`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`,Qt,He,Vt,Fe,kn="and we will merge your PR! Congratulations on the milestone 🎉",Dt,Pe,Hn="<strong>7. (Optional) Build demos and share with the world</strong>",Kt,Be,Fn=`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! 📣`,eo,Ue,Pn="There are two main ways to share your model with the community:",to,Ie,Bn=`<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>`,oo,Re,no,Je,Un=`Assuming that the TensorFlow model architecture is available in 🤗 Transformers, converting PyTorch weights into
TensorFlow weights is a breeze!`,lo,Ne,In="Here’s how to do it:",io,Ze,Rn=`<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>`,ro,je,Jn="That’s it! 🎉",so,Ge,ao,Se,Nn=`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? 🤔`,mo,Ae,Zn=`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.`,ho,We,jn=`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:`,uo,Ye,Gn=`<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>`,co,qe,Sn=`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.`,fo,Xe,po,st,wo;return M=new U({props:{title:"How to convert a 🤗 Transformers model to TensorFlow?",local:"how-to-convert-a--transformers-model-to-tensorflow",headingTag:"h1"}}),H=new Wn({props:{$$slots:{default:[Vn]},$$scope:{ctx:Ee}}}),N=new U({props:{title:"Step-by-step guide to add TensorFlow model architecture code",local:"step-by-step-guide-to-add-tensorflow-model-architecture-code",headingTag:"h2"}}),A=new U({props:{title:"1.-3. Prepare your model contribution",local:"1-3-prepare-your-model-contribution",headingTag:"h3"}}),F=new Wn({props:{$$slots:{default:[Dn]},$$scope:{ctx:Ee}}}),O=new B({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}}),Q=new B({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}}),V=new B({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1lJTIwJTIyLiU1QnF1YWxpdHklNUQlMjI=",highlighted:'pip install -e <span class="hljs-string">&quot;.[quality]&quot;</span>',wrap:!1}}),K=new B({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjAtYiUyMGFkZF90Zl9icmFuZF9uZXdfYmVydA==",highlighted:"git checkout -b add_tf_brand_new_bert",wrap:!1}}),te=new B({props:{code:"Z2l0JTIwZmV0Y2glMjB1cHN0cmVhbSUwQWdpdCUyMHJlYmFzZSUyMHVwc3RyZWFtJTJGbWFpbg==",highlighted:`git fetch upstream
git rebase upstream/main`,wrap:!1}}),ne=new B({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}}),de=new U({props:{title:"4. Model implementation",local:"4-model-implementation",headingTag:"h3"}}),ge=new U({props:{title:"5. Add model tests",local:"5-add-model-tests",headingTag:"h3"}}),ve=new B({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}}),$e=new U({props:{title:"6.-7. Ensure everyone can use your model",local:"6-7-ensure-everyone-can-use-your-model",headingTag:"h3"}}),He=new B({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}}),Re=new U({props:{title:"Adding TensorFlow weights to 🤗 Hub",local:"adding-tensorflow-weights-to--hub",headingTag:"h2"}}),Ge=new U({props:{title:"Debugging mismatches across ML frameworks 🐛",local:"debugging-mismatches-across-ml-frameworks-",headingTag:"h2"}}),Xe=new Qn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/add_tensorflow_model.md"}}),{c(){m=r("meta"),C=l(),v=r("p"),_=l(),c(M.$$.fragment),k=l(),T=r("p"),T.innerHTML=rt,b=l(),$=r("p"),$.textContent=Jo,at=l(),I=r("p"),I.textContent=No,dt=l(),R=r("ul"),R.innerHTML=Zo,mt=l(),J=r("p"),J.textContent=jo,ht=l(),c(H.$$.fragment),ut=l(),c(N.$$.fragment),ct=l(),Z=r("p"),Z.innerHTML=Go,ft=l(),j=r("ul"),j.innerHTML=So,pt=l(),G=r("p"),G.textContent=Ao,wt=l(),S=r("ol"),S.innerHTML=Wo,gt=l(),c(A.$$.fragment),yt=l(),W=r("p"),W.innerHTML=Yo,bt=l(),Y=r("p"),Y.innerHTML=qo,vt=l(),q=r("p"),q.innerHTML=Xo,Tt=l(),c(F.$$.fragment),_t=l(),X=r("p"),X.innerHTML=zo,$t=l(),z=r("p"),z.textContent=Eo,xt=l(),h=r("ol"),Oe=r("li"),Oe.innerHTML=Oo,vo=l(),E=r("li"),Qe=r("p"),Qe.innerHTML=Qo,To=l(),c(O.$$.fragment),_o=l(),x=r("li"),Ve=r("p"),Ve.textContent=Vo,$o=l(),c(Q.$$.fragment),xo=l(),De=r("p"),De.textContent=Do,Co=l(),c(V.$$.fragment),Mo=l(),Ke=r("p"),Ke.innerHTML=Ko,Lo=l(),D=r("li"),et=r("p"),et.textContent=en,ko=l(),c(K.$$.fragment),Ho=l(),ee=r("li"),tt=r("p"),tt.textContent=tn,Fo=l(),c(te.$$.fragment),Po=l(),ot=r("li"),ot.innerHTML=on,Bo=l(),oe=r("li"),nt=r("p"),nt.textContent=nn,Uo=l(),c(ne.$$.fragment),Io=l(),lt=r("li"),lt.innerHTML=ln,Ro=l(),it=r("li"),it.innerHTML=rn,Ct=l(),le=r("p"),le.innerHTML=sn,Mt=l(),ie=r("p"),ie.innerHTML=an,Lt=l(),re=r("p"),re.innerHTML=dn,kt=l(),se=r("p"),se.textContent=mn,Ht=l(),ae=r("p"),ae.innerHTML=hn,Ft=l(),c(de.$$.fragment),Pt=l(),me=r("p"),me.innerHTML=un,Bt=l(),he=r("p"),he.textContent=cn,Ut=l(),ue=r("ul"),ue.innerHTML=fn,It=l(),ce=r("p"),ce.innerHTML=pn,Rt=l(),fe=r("ul"),fe.innerHTML=wn,Jt=l(),pe=r("p"),pe.textContent=gn,Nt=l(),we=r("ol"),we.innerHTML=yn,Zt=l(),c(ge.$$.fragment),jt=l(),ye=r("p"),ye.innerHTML=bn,Gt=l(),be=r("p"),be.textContent=vn,St=l(),c(ve.$$.fragment),At=l(),Te=r("p"),Te.innerHTML=Tn,Wt=l(),_e=r("p"),_e.textContent=_n,Yt=l(),c($e.$$.fragment),qt=l(),xe=r("p"),xe.innerHTML=$n,Xt=l(),Ce=r("p"),Ce.innerHTML=xn,zt=l(),Me=r("p"),Me.innerHTML=Cn,Et=l(),Le=r("p"),Le.innerHTML=Mn,Ot=l(),ke=r("p"),ke.textContent=Ln,Qt=l(),c(He.$$.fragment),Vt=l(),Fe=r("p"),Fe.textContent=kn,Dt=l(),Pe=r("p"),Pe.innerHTML=Hn,Kt=l(),Be=r("p"),Be.textContent=Fn,eo=l(),Ue=r("p"),Ue.textContent=Pn,to=l(),Ie=r("ul"),Ie.innerHTML=Bn,oo=l(),c(Re.$$.fragment),no=l(),Je=r("p"),Je.textContent=Un,lo=l(),Ne=r("p"),Ne.textContent=In,io=l(),Ze=r("ol"),Ze.innerHTML=Rn,ro=l(),je=r("p"),je.textContent=Jn,so=l(),c(Ge.$$.fragment),ao=l(),Se=r("p"),Se.textContent=Nn,mo=l(),Ae=r("p"),Ae.innerHTML=Zn,ho=l(),We=r("p"),We.textContent=jn,uo=l(),Ye=r("ol"),Ye.innerHTML=Gn,co=l(),qe=r("p"),qe.innerHTML=Sn,fo=l(),c(Xe.$$.fragment),po=l(),st=r("p"),this.h()},l(e){const t=On("svelte-u9bgzb",document.head);m=s(t,"META",{name:!0,content:!0}),t.forEach(o),C=i(e),v=s(e,"P",{}),P(v).forEach(o),_=i(e),f(M.$$.fragment,e),k=i(e),T=s(e,"P",{"data-svelte-h":!0}),a(T)!=="svelte-un598u"&&(T.innerHTML=rt),b=i(e),$=s(e,"P",{"data-svelte-h":!0}),a($)!=="svelte-1m7mnyo"&&($.textContent=Jo),at=i(e),I=s(e,"P",{"data-svelte-h":!0}),a(I)!=="svelte-1a30pti"&&(I.textContent=No),dt=i(e),R=s(e,"UL",{"data-svelte-h":!0}),a(R)!=="svelte-1syo9f3"&&(R.innerHTML=Zo),mt=i(e),J=s(e,"P",{"data-svelte-h":!0}),a(J)!=="svelte-flc7p5"&&(J.textContent=jo),ht=i(e),f(H.$$.fragment,e),ut=i(e),f(N.$$.fragment,e),ct=i(e),Z=s(e,"P",{"data-svelte-h":!0}),a(Z)!=="svelte-1nfvtxf"&&(Z.innerHTML=Go),ft=i(e),j=s(e,"UL",{"data-svelte-h":!0}),a(j)!=="svelte-r4pwei"&&(j.innerHTML=So),pt=i(e),G=s(e,"P",{"data-svelte-h":!0}),a(G)!=="svelte-12ug9wa"&&(G.textContent=Ao),wt=i(e),S=s(e,"OL",{"data-svelte-h":!0}),a(S)!=="svelte-b2inhb"&&(S.innerHTML=Wo),gt=i(e),f(A.$$.fragment,e),yt=i(e),W=s(e,"P",{"data-svelte-h":!0}),a(W)!=="svelte-rqidwu"&&(W.innerHTML=Yo),bt=i(e),Y=s(e,"P",{"data-svelte-h":!0}),a(Y)!=="svelte-1rt3dcz"&&(Y.innerHTML=qo),vt=i(e),q=s(e,"P",{"data-svelte-h":!0}),a(q)!=="svelte-mkqbuc"&&(q.innerHTML=Xo),Tt=i(e),f(F.$$.fragment,e),_t=i(e),X=s(e,"P",{"data-svelte-h":!0}),a(X)!=="svelte-w68cw6"&&(X.innerHTML=zo),$t=i(e),z=s(e,"P",{"data-svelte-h":!0}),a(z)!=="svelte-4rco38"&&(z.textContent=Eo),xt=i(e),h=s(e,"OL",{});var u=P(h);Oe=s(u,"LI",{"data-svelte-h":!0}),a(Oe)!=="svelte-4g2dtl"&&(Oe.innerHTML=Oo),vo=i(u),E=s(u,"LI",{});var ze=P(E);Qe=s(ze,"P",{"data-svelte-h":!0}),a(Qe)!=="svelte-lgncv4"&&(Qe.innerHTML=Qo),To=i(ze),f(O.$$.fragment,ze),ze.forEach(o),_o=i(u),x=s(u,"LI",{});var L=P(x);Ve=s(L,"P",{"data-svelte-h":!0}),a(Ve)!=="svelte-5wdf6a"&&(Ve.textContent=Vo),$o=i(L),f(Q.$$.fragment,L),xo=i(L),De=s(L,"P",{"data-svelte-h":!0}),a(De)!=="svelte-23rgus"&&(De.textContent=Do),Co=i(L),f(V.$$.fragment,L),Mo=i(L),Ke=s(L,"P",{"data-svelte-h":!0}),a(Ke)!=="svelte-6bybv3"&&(Ke.innerHTML=Ko),L.forEach(o),Lo=i(u),D=s(u,"LI",{});var go=P(D);et=s(go,"P",{"data-svelte-h":!0}),a(et)!=="svelte-1wd3vdn"&&(et.textContent=en),ko=i(go),f(K.$$.fragment,go),go.forEach(o),Ho=i(u),ee=s(u,"LI",{});var yo=P(ee);tt=s(yo,"P",{"data-svelte-h":!0}),a(tt)!=="svelte-1awho2g"&&(tt.textContent=tn),Fo=i(yo),f(te.$$.fragment,yo),yo.forEach(o),Po=i(u),ot=s(u,"LI",{"data-svelte-h":!0}),a(ot)!=="svelte-luy37q"&&(ot.innerHTML=on),Bo=i(u),oe=s(u,"LI",{});var bo=P(oe);nt=s(bo,"P",{"data-svelte-h":!0}),a(nt)!=="svelte-1adm7yl"&&(nt.textContent=nn),Uo=i(bo),f(ne.$$.fragment,bo),bo.forEach(o),Io=i(u),lt=s(u,"LI",{"data-svelte-h":!0}),a(lt)!=="svelte-v52akd"&&(lt.innerHTML=ln),Ro=i(u),it=s(u,"LI",{"data-svelte-h":!0}),a(it)!=="svelte-1jfczy2"&&(it.innerHTML=rn),u.forEach(o),Ct=i(e),le=s(e,"P",{"data-svelte-h":!0}),a(le)!=="svelte-beu7sg"&&(le.innerHTML=sn),Mt=i(e),ie=s(e,"P",{"data-svelte-h":!0}),a(ie)!=="svelte-1l0tpib"&&(ie.innerHTML=an),Lt=i(e),re=s(e,"P",{"data-svelte-h":!0}),a(re)!=="svelte-1get462"&&(re.innerHTML=dn),kt=i(e),se=s(e,"P",{"data-svelte-h":!0}),a(se)!=="svelte-16kl1f2"&&(se.textContent=mn),Ht=i(e),ae=s(e,"P",{"data-svelte-h":!0}),a(ae)!=="svelte-1skghto"&&(ae.innerHTML=hn),Ft=i(e),f(de.$$.fragment,e),Pt=i(e),me=s(e,"P",{"data-svelte-h":!0}),a(me)!=="svelte-94ipqa"&&(me.innerHTML=un),Bt=i(e),he=s(e,"P",{"data-svelte-h":!0}),a(he)!=="svelte-55id0v"&&(he.textContent=cn),Ut=i(e),ue=s(e,"UL",{"data-svelte-h":!0}),a(ue)!=="svelte-p4ei59"&&(ue.innerHTML=fn),It=i(e),ce=s(e,"P",{"data-svelte-h":!0}),a(ce)!=="svelte-q00s49"&&(ce.innerHTML=pn),Rt=i(e),fe=s(e,"UL",{"data-svelte-h":!0}),a(fe)!=="svelte-16283o5"&&(fe.innerHTML=wn),Jt=i(e),pe=s(e,"P",{"data-svelte-h":!0}),a(pe)!=="svelte-16z62s3"&&(pe.textContent=gn),Nt=i(e),we=s(e,"OL",{"data-svelte-h":!0}),a(we)!=="svelte-fev0iu"&&(we.innerHTML=yn),Zt=i(e),f(ge.$$.fragment,e),jt=i(e),ye=s(e,"P",{"data-svelte-h":!0}),a(ye)!=="svelte-1y1b8z6"&&(ye.innerHTML=bn),Gt=i(e),be=s(e,"P",{"data-svelte-h":!0}),a(be)!=="svelte-1iuoan0"&&(be.textContent=vn),St=i(e),f(ve.$$.fragment,e),At=i(e),Te=s(e,"P",{"data-svelte-h":!0}),a(Te)!=="svelte-1dqjbww"&&(Te.innerHTML=Tn),Wt=i(e),_e=s(e,"P",{"data-svelte-h":!0}),a(_e)!=="svelte-uwxrp8"&&(_e.textContent=_n),Yt=i(e),f($e.$$.fragment,e),qt=i(e),xe=s(e,"P",{"data-svelte-h":!0}),a(xe)!=="svelte-1xzf20w"&&(xe.innerHTML=$n),Xt=i(e),Ce=s(e,"P",{"data-svelte-h":!0}),a(Ce)!=="svelte-11dmfnu"&&(Ce.innerHTML=xn),zt=i(e),Me=s(e,"P",{"data-svelte-h":!0}),a(Me)!=="svelte-1ul6csg"&&(Me.innerHTML=Cn),Et=i(e),Le=s(e,"P",{"data-svelte-h":!0}),a(Le)!=="svelte-cvn3sg"&&(Le.innerHTML=Mn),Ot=i(e),ke=s(e,"P",{"data-svelte-h":!0}),a(ke)!=="svelte-19emp5y"&&(ke.textContent=Ln),Qt=i(e),f(He.$$.fragment,e),Vt=i(e),Fe=s(e,"P",{"data-svelte-h":!0}),a(Fe)!=="svelte-fqsbir"&&(Fe.textContent=kn),Dt=i(e),Pe=s(e,"P",{"data-svelte-h":!0}),a(Pe)!=="svelte-jtwtfe"&&(Pe.innerHTML=Hn),Kt=i(e),Be=s(e,"P",{"data-svelte-h":!0}),a(Be)!=="svelte-jr9wmb"&&(Be.textContent=Fn),eo=i(e),Ue=s(e,"P",{"data-svelte-h":!0}),a(Ue)!=="svelte-k5t6bl"&&(Ue.textContent=Pn),to=i(e),Ie=s(e,"UL",{"data-svelte-h":!0}),a(Ie)!=="svelte-uzeeja"&&(Ie.innerHTML=Bn),oo=i(e),f(Re.$$.fragment,e),no=i(e),Je=s(e,"P",{"data-svelte-h":!0}),a(Je)!=="svelte-1gp1v2d"&&(Je.textContent=Un),lo=i(e),Ne=s(e,"P",{"data-svelte-h":!0}),a(Ne)!=="svelte-1g6cxz5"&&(Ne.textContent=In),io=i(e),Ze=s(e,"OL",{"data-svelte-h":!0}),a(Ze)!=="svelte-o72q35"&&(Ze.innerHTML=Rn),ro=i(e),je=s(e,"P",{"data-svelte-h":!0}),a(je)!=="svelte-c3r53s"&&(je.textContent=Jn),so=i(e),f(Ge.$$.fragment,e),ao=i(e),Se=s(e,"P",{"data-svelte-h":!0}),a(Se)!=="svelte-1u5xu5o"&&(Se.textContent=Nn),mo=i(e),Ae=s(e,"P",{"data-svelte-h":!0}),a(Ae)!=="svelte-15riypa"&&(Ae.innerHTML=Zn),ho=i(e),We=s(e,"P",{"data-svelte-h":!0}),a(We)!=="svelte-gy3qi9"&&(We.textContent=jn),uo=i(e),Ye=s(e,"OL",{"data-svelte-h":!0}),a(Ye)!=="svelte-1l2xrm5"&&(Ye.innerHTML=Gn),co=i(e),qe=s(e,"P",{"data-svelte-h":!0}),a(qe)!=="svelte-1qzb4ip"&&(qe.innerHTML=Sn),fo=i(e),f(Xe.$$.fragment,e),po=i(e),st=s(e,"P",{}),P(st).forEach(o),this.h()},h(){An(m,"name","hf:doc:metadata"),An(m,"content",el)},m(e,t){d(document.head,m),n(e,C,t),n(e,v,t),n(e,_,t),p(M,e,t),n(e,k,t),n(e,T,t),n(e,b,t),n(e,$,t),n(e,at,t),n(e,I,t),n(e,dt,t),n(e,R,t),n(e,mt,t),n(e,J,t),n(e,ht,t),p(H,e,t),n(e,ut,t),p(N,e,t),n(e,ct,t),n(e,Z,t),n(e,ft,t),n(e,j,t),n(e,pt,t),n(e,G,t),n(e,wt,t),n(e,S,t),n(e,gt,t),p(A,e,t),n(e,yt,t),n(e,W,t),n(e,bt,t),n(e,Y,t),n(e,vt,t),n(e,q,t),n(e,Tt,t),p(F,e,t),n(e,_t,t),n(e,X,t),n(e,$t,t),n(e,z,t),n(e,xt,t),n(e,h,t),d(h,Oe),d(h,vo),d(h,E),d(E,Qe),d(E,To),p(O,E,null),d(h,_o),d(h,x),d(x,Ve),d(x,$o),p(Q,x,null),d(x,xo),d(x,De),d(x,Co),p(V,x,null),d(x,Mo),d(x,Ke),d(h,Lo),d(h,D),d(D,et),d(D,ko),p(K,D,null),d(h,Ho),d(h,ee),d(ee,tt),d(ee,Fo),p(te,ee,null),d(h,Po),d(h,ot),d(h,Bo),d(h,oe),d(oe,nt),d(oe,Uo),p(ne,oe,null),d(h,Io),d(h,lt),d(h,Ro),d(h,it),n(e,Ct,t),n(e,le,t),n(e,Mt,t),n(e,ie,t),n(e,Lt,t),n(e,re,t),n(e,kt,t),n(e,se,t),n(e,Ht,t),n(e,ae,t),n(e,Ft,t),p(de,e,t),n(e,Pt,t),n(e,me,t),n(e,Bt,t),n(e,he,t),n(e,Ut,t),n(e,ue,t),n(e,It,t),n(e,ce,t),n(e,Rt,t),n(e,fe,t),n(e,Jt,t),n(e,pe,t),n(e,Nt,t),n(e,we,t),n(e,Zt,t),p(ge,e,t),n(e,jt,t),n(e,ye,t),n(e,Gt,t),n(e,be,t),n(e,St,t),p(ve,e,t),n(e,At,t),n(e,Te,t),n(e,Wt,t),n(e,_e,t),n(e,Yt,t),p($e,e,t),n(e,qt,t),n(e,xe,t),n(e,Xt,t),n(e,Ce,t),n(e,zt,t),n(e,Me,t),n(e,Et,t),n(e,Le,t),n(e,Ot,t),n(e,ke,t),n(e,Qt,t),p(He,e,t),n(e,Vt,t),n(e,Fe,t),n(e,Dt,t),n(e,Pe,t),n(e,Kt,t),n(e,Be,t),n(e,eo,t),n(e,Ue,t),n(e,to,t),n(e,Ie,t),n(e,oo,t),p(Re,e,t),n(e,no,t),n(e,Je,t),n(e,lo,t),n(e,Ne,t),n(e,io,t),n(e,Ze,t),n(e,ro,t),n(e,je,t),n(e,so,t),p(Ge,e,t),n(e,ao,t),n(e,Se,t),n(e,mo,t),n(e,Ae,t),n(e,ho,t),n(e,We,t),n(e,uo,t),n(e,Ye,t),n(e,co,t),n(e,qe,t),n(e,fo,t),p(Xe,e,t),n(e,po,t),n(e,st,t),wo=!0},p(e,[t]){const u={};t&2&&(u.$$scope={dirty:t,ctx:e}),H.$set(u);const ze={};t&2&&(ze.$$scope={dirty:t,ctx:e}),F.$set(ze)},i(e){wo||(w(M.$$.fragment,e),w(H.$$.fragment,e),w(N.$$.fragment,e),w(A.$$.fragment,e),w(F.$$.fragment,e),w(O.$$.fragment,e),w(Q.$$.fragment,e),w(V.$$.fragment,e),w(K.$$.fragment,e),w(te.$$.fragment,e),w(ne.$$.fragment,e),w(de.$$.fragment,e),w(ge.$$.fragment,e),w(ve.$$.fragment,e),w($e.$$.fragment,e),w(He.$$.fragment,e),w(Re.$$.fragment,e),w(Ge.$$.fragment,e),w(Xe.$$.fragment,e),wo=!0)},o(e){g(M.$$.fragment,e),g(H.$$.fragment,e),g(N.$$.fragment,e),g(A.$$.fragment,e),g(F.$$.fragment,e),g(O.$$.fragment,e),g(Q.$$.fragment,e),g(V.$$.fragment,e),g(K.$$.fragment,e),g(te.$$.fragment,e),g(ne.$$.fragment,e),g(de.$$.fragment,e),g(ge.$$.fragment,e),g(ve.$$.fragment,e),g($e.$$.fragment,e),g(He.$$.fragment,e),g(Re.$$.fragment,e),g(Ge.$$.fragment,e),g(Xe.$$.fragment,e),wo=!1},d(e){e&&(o(C),o(v),o(_),o(k),o(T),o(b),o($),o(at),o(I),o(dt),o(R),o(mt),o(J),o(ht),o(ut),o(ct),o(Z),o(ft),o(j),o(pt),o(G),o(wt),o(S),o(gt),o(yt),o(W),o(bt),o(Y),o(vt),o(q),o(Tt),o(_t),o(X),o($t),o(z),o(xt),o(h),o(Ct),o(le),o(Mt),o(ie),o(Lt),o(re),o(kt),o(se),o(Ht),o(ae),o(Ft),o(Pt),o(me),o(Bt),o(he),o(Ut),o(ue),o(It),o(ce),o(Rt),o(fe),o(Jt),o(pe),o(Nt),o(we),o(Zt),o(jt),o(ye),o(Gt),o(be),o(St),o(At),o(Te),o(Wt),o(_e),o(Yt),o(qt),o(xe),o(Xt),o(Ce),o(zt),o(Me),o(Et),o(Le),o(Ot),o(ke),o(Qt),o(Vt),o(Fe),o(Dt),o(Pe),o(Kt),o(Be),o(eo),o(Ue),o(to),o(Ie),o(oo),o(no),o(Je),o(lo),o(Ne),o(io),o(Ze),o(ro),o(je),o(so),o(ao),o(Se),o(mo),o(Ae),o(ho),o(We),o(uo),o(Ye),o(co),o(qe),o(fo),o(po),o(st)),o(m),y(M,e),y(H,e),y(N,e),y(A,e),y(F,e),y(O),y(Q),y(V),y(K),y(te),y(ne),y(de,e),y(ge,e),y(ve,e),y($e,e),y(He,e),y(Re,e),y(Ge,e),y(Xe,e)}}}const el='{"title":"How to convert a 🤗 Transformers model to TensorFlow?","local":"how-to-convert-a--transformers-model-to-tensorflow","sections":[{"title":"Step-by-step guide to add TensorFlow model architecture code","local":"step-by-step-guide-to-add-tensorflow-model-architecture-code","sections":[{"title":"1.-3. Prepare your model contribution","local":"1-3-prepare-your-model-contribution","sections":[],"depth":3},{"title":"4. Model implementation","local":"4-model-implementation","sections":[],"depth":3},{"title":"5. Add model tests","local":"5-add-model-tests","sections":[],"depth":3},{"title":"6.-7. Ensure everyone can use your model","local":"6-7-ensure-everyone-can-use-your-model","sections":[],"depth":3}],"depth":2},{"title":"Adding TensorFlow weights to 🤗 Hub","local":"adding-tensorflow-weights-to--hub","sections":[],"depth":2},{"title":"Debugging mismatches across ML frameworks 🐛","local":"debugging-mismatches-across-ml-frameworks-","sections":[],"depth":2}],"depth":1}';function tl(Ee){return Xn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sl extends zn{constructor(m){super(),En(this,m,tl,Kn,qn,{})}}export{sl as component};
