import{S as Tv,i as Iv,s as Pv,e as a,k as u,w as m,t as r,M as Mv,c as s,d as o,m as h,a as n,x as y,h as l,b as d,G as e,g as f,y as w,q as v,o as g,B as b,v as Sv}from"../chunks/vendor-hf-doc-builder.js";import{T as Cv}from"../chunks/Tip-hf-doc-builder.js";import{I as R}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as E}from"../chunks/CodeBlock-hf-doc-builder.js";function Rv(Ka){let _,xe,$,x,se,W,gt,ne,ie,Oe,Y;return{c(){_=a("p"),xe=r("Remember to specify a "),$=a("em"),x=r("path to a subfolder or a test file"),se=r(" to run the test. Otherwise, you\u2019ll run all the tests in the "),W=a("code"),gt=r("tests"),ne=r(" or "),ie=a("code"),Oe=r("examples"),Y=r(" folder, which will take a very long time!")},l(ue){_=s(ue,"P",{});var T=n(_);xe=l(T,"Remember to specify a "),$=s(T,"EM",{});var he=n($);x=l(he,"path to a subfolder or a test file"),he.forEach(o),se=l(T," to run the test. Otherwise, you\u2019ll run all the tests in the "),W=s(T,"CODE",{});var Yo=n(W);gt=l(Yo,"tests"),Yo.forEach(o),ne=l(T," or "),ie=s(T,"CODE",{});var bt=n(ie);Oe=l(bt,"examples"),bt.forEach(o),Y=l(T," folder, which will take a very long time!"),T.forEach(o)},m(ue,T){f(ue,_,T),e(_,xe),e(_,$),e($,x),e(_,se),e(_,W),e(W,gt),e(_,ne),e(_,ie),e(ie,Oe),e(_,Y)},d(ue){ue&&o(_)}}}function Wv(Ka){let _,xe,$,x,se,W,gt,ne,ie,Oe,Y,ue,T,he,Yo,bt,Ue,si,_t,ni,ii,es,jo,Et,ui,kt,hi,fi,ts,fe,Ge,Or,$t,di,Ur,ci,os,Xo,pi,rs,O,Gr,mi,yi,Lr,wi,vi,Nr,gi,bi,Jr,_i,ls,Le,Ei,Tt,ki,$i,as,Ne,Ti,It,Ii,Pi,ss,Bo,Zr,Mi,ns,de,Je,qr,Pt,Si,Dr,Ci,is,Ze,Ri,Mt,Wi,Ai,us,ce,qe,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sp,H,Cp,qa,Rp,Wp,Da,Ap,xp,Ha,Op,Up,Gp,qo,Lp,Fa,Np,Jp,pn,nt,Zp,Ya,qp,Dp,mn,Ae,it,ja,Do,Hp,Xa,Fp,yn,pr,Yp,wn,ut,Ba,jp,Xp,Va,Bp,vn,Ho,gn;return W=new R({}),$t=new R({}),Pt=new R({}),St=new R({}),Ct=new R({}),At=new E({props:{code:"dHJhbnNmb3JtZXJzLWNsaSUyMGVudg==",highlighted:'transformers-cli <span class="hljs-built_in">env</span>'}}),xt=new E({props:{code:"cHl0aG9uJTIwc3JjJTJGdHJhbnNmb3JtZXJzJTJGY29tbWFuZHMlMkZ0cmFuc2Zvcm1lcnNfY2xpLnB5JTIwZW52",highlighted:'python src/transformers/commands/transformers_cli.py <span class="hljs-built_in">env</span>'}}),Ot=new R({}),Jt=new R({}),Dt=new R({}),Ft=new R({}),Vt=new E({props:{code:"Z2l0JTIwY2xvbmUlMjBnaXQlNDBnaXRodWIuY29tJTNBJTNDeW91ciUyMEdpdGh1YiUyMGhhbmRsZSUzRSUyRnRyYW5zZm9ybWVycy5naXQlMEFjZCUyMHRyYW5zZm9ybWVycyUwQWdpdCUyMHJlbW90ZSUyMGFkZCUyMHVwc3RyZWFtJTIwaHR0cHMlM0ElMkYlMkZnaXRodWIuY29tJTJGaHVnZ2luZ2ZhY2UlMkZ0cmFuc2Zvcm1lcnMuZ2l0",highlighted:`git <span class="hljs-built_in">clone</span> git@github.com:&lt;your Github handle&gt;/transformers.git
<span class="hljs-built_in">cd</span> transformers
git remote add upstream https://github.com/huggingface/transformers.git`}}),zt=new E({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjAtYiUyMGEtZGVzY3JpcHRpdmUtbmFtZS1mb3ItbXktY2hhbmdlcw==",highlighted:"git checkout -b a-descriptive-name-for-my-changes"}}),Qt=new E({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1lJTIwJTIyLiU1QmRldiU1RCUyMg==",highlighted:'pip install -e <span class="hljs-string">&quot;.[dev]&quot;</span>'}}),Kt=new E({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1lJTIwJTIyLiU1QnF1YWxpdHklNUQlMjI=",highlighted:'pip install -e <span class="hljs-string">&quot;.[quality]&quot;</span>'}}),eo=new E({props:{code:"cHl0ZXN0JTIwdGVzdHMlMkYlM0NURVNUX1RPX1JVTiUzRS5weQ==",highlighted:"pytest tests/&lt;TEST_TO_RUN&gt;.py"}}),ro=new E({props:{code:"bWFrZSUyMGZpeHVw",highlighted:"make fixup"}}),lo=new E({props:{code:"bWFrZSUyMHN0eWxl",highlighted:"make style"}}),so=new E({props:{code:"bWFrZSUyMHF1YWxpdHk=",highlighted:"make quality"}}),no=new E({props:{code:"bWFrZSUyMHJlcG8tY29uc2lzdGVuY3k=",highlighted:"make repo-consistency"}}),fo=new E({props:{code:"cGlwJTIwaW5zdGFsbCUyMCUyMi4lNUJkb2NzJTVEJTIy",highlighted:'pip install <span class="hljs-string">&quot;.[docs]&quot;</span>'}}),co=new E({props:{code:"ZG9jLWJ1aWxkZXIlMjBidWlsZCUyMHRyYW5zZm9ybWVycyUyMGRvY3MlMkZzb3VyY2UlMkZlbiUyMC0tYnVpbGRfZGlyJTIwfiUyRnRtcCUyRnRlc3QtYnVpbGQ=",highlighted:"doc-builder build transformers docs/source/en --build_dir ~/tmp/test-build"}}),mo=new E({props:{code:"Z2l0JTIwYWRkJTIwbW9kaWZpZWRfZmlsZS5weSUwQWdpdCUyMGNvbW1pdA==",highlighted:`git add modified_file.py
git commit`}}),vo=new E({props:{code:"Z2l0JTIwZmV0Y2glMjB1cHN0cmVhbSUwQWdpdCUyMHJlYmFzZSUyMHVwc3RyZWFtJTJGbWFpbg==",highlighted:`git fetch upstream
git rebase upstream/main`}}),go=new E({props:{code:"Z2l0JTIwcHVzaCUyMC11JTIwb3JpZ2luJTIwYS1kZXNjcmlwdGl2ZS1uYW1lLWZvci1teS1jaGFuZ2Vz",highlighted:"git push -u origin a-descriptive-name-for-my-changes"}}),Eo=new R({}),Mo=new R({}),Ro=new E({props:{code:"cHl0aG9uJTIwLW0lMjBweXRlc3QlMjAtbiUyMGF1dG8lMjAtLWRpc3QlM0Rsb2FkZmlsZSUyMC1zJTIwLXYlMjAuJTJGdGVzdHMlMkZtb2RlbHMlMkZteV9uZXdfbW9kZWw=",highlighted:"python -m pytest -n auto --dist=loadfile -s -v ./tests/models/my_new_model"}}),Wo=new E({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwZXhhbXBsZXMlMkZ4eHglMkZyZXF1aXJlbWVudHMudHh0JTIwJTIwJTIzJTIwb25seSUyMG5lZWRlZCUyMHRoZSUyMGZpcnN0JTIwdGltZSUwQXB5dGhvbiUyMC1tJTIwcHl0ZXN0JTIwLW4lMjBhdXRvJTIwLS1kaXN0JTNEbG9hZGZpbGUlMjAtcyUyMC12JTIwLiUyRmV4YW1wbGVzJTJGcHl0b3JjaCUyRnRleHQtY2xhc3NpZmljYXRpb24=",highlighted:`pip install -r examples/xxx/requirements.txt  <span class="hljs-comment"># only needed the first time</span>
python -m pytest -n auto --dist=loadfile -s -v ./examples/pytorch/text-classification`}}),tt=new Cv({props:{warning:!0,$$slots:{default:[Rv]},$$scope:{ctx:Ka}}}),Ao=new E({props:{code:"UlVOX1NMT1clM0R5ZXMlMjBweXRob24lMjAtbSUyMHB5dGVzdCUyMC1uJTIwYXV0byUyMC0tZGlzdCUzRGxvYWRmaWxlJTIwLXMlMjAtdiUyMC4lMkZ0ZXN0cyUyRm1vZGVscyUyRm15X25ld19tb2RlbCUwQVJVTl9TTE9XJTNEeWVzJTIwcHl0aG9uJTIwLW0lMjBweXRlc3QlMjAtbiUyMGF1dG8lMjAtLWRpc3QlM0Rsb2FkZmlsZSUyMC1zJTIwLXYlMjAuJTJGZXhhbXBsZXMlMkZweXRvcmNoJTJGdGV4dC1jbGFzc2lmaWNhdGlvbg==",highlighted:`RUN_SLOW=<span class="hljs-built_in">yes</span> python -m pytest -n auto --dist=loadfile -s -v ./tests/models/my_new_model
RUN_SLOW=<span class="hljs-built_in">yes</span> python -m pytest -n auto --dist=loadfile -s -v ./examples/pytorch/text-classification`}}),xo=new E({props:{code:"cHl0aG9uJTIwLW0lMjB1bml0dGVzdCUyMGRpc2NvdmVyJTIwLXMlMjB0ZXN0cyUyMC10JTIwLiUyMC12JTBBcHl0aG9uJTIwLW0lMjB1bml0dGVzdCUyMGRpc2NvdmVyJTIwLXMlMjBleGFtcGxlcyUyMC10JTIwZXhhbXBsZXMlMjAtdg==",highlighted:`python -m unittest discover -s tests -t . -v
python -m unittest discover -s examples -t examples -v`}}),Oo=new R({}),Lo=new R({}),Jo=new E({props:{code:"Z2l0JTIwY29uZmlnJTIwY29yZS5hdXRvY3JsZiUyMGlucHV0",highlighted:"git config core.autocrlf input"}}),Do=new R({}),Ho=new E({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjAtYiUyMHlvdXItYnJhbmNoLWZvci1zeW5jaW5nJTBBZ2l0JTIwcHVsbCUyMC0tc3F1YXNoJTIwLS1uby1jb21taXQlMjB1cHN0cmVhbSUyMG1haW4lMEFnaXQlMjBjb21taXQlMjAtbSUyMCclM0N5b3VyJTIwbWVzc2FnZSUyMHdpdGhvdXQlMjBHaXRIdWIlMjByZWZlcmVuY2VzJTNFJyUwQWdpdCUyMHB1c2glMjAtLXNldC11cHN0cmVhbSUyMG9yaWdpbiUyMHlvdXItYnJhbmNoLWZvci1zeW5jaW5n",highlighted:`git checkout -b your-branch-for-syncing
git pull --squash --no-commit upstream main
git commit -m <span class="hljs-string">&#x27;&lt;your message without GitHub references&gt;&#x27;</span>
git push --set-upstream origin your-branch-for-syncing`}}),{c(){_=a("meta"),xe=u(),$=a("h1"),x=a("a"),se=a("span"),m(W.$$.fragment),gt=u(),ne=a("span"),ie=r("Contribute to \u{1F917} Transformers"),Oe=u(),Y=a("p"),ue=r(`Everyone is welcome to contribute, and we value everybody\u2019s contribution. Code
contributions are not the only way to help the community. Answering questions, helping
others, and improving the documentation are also immensely valuable.`),T=u(),he=a("p"),Yo=r(`It also helps us if you spread the word! Reference the library in blog posts
about the awesome projects it made possible, shout out on Twitter every time it has
helped you, or simply \u2B50\uFE0F the repository to say thank you.`),bt=u(),Ue=a("p"),si=r(`However you choose to contribute, please be mindful and respect our
`),_t=a("a"),ni=r("code of conduct"),ii=r("."),es=u(),jo=a("p"),Et=a("strong"),ui=r("This guide was heavily inspired by the awesome "),kt=a("a"),hi=r("scikit-learn guide to contributing"),fi=r("."),ts=u(),fe=a("h2"),Ge=a("a"),Or=a("span"),m($t.$$.fragment),di=u(),Ur=a("span"),ci=r("Ways to contribute"),os=u(),Xo=a("p"),pi=r("There are several ways you can contribute to \u{1F917} Transformers:"),rs=u(),O=a("ul"),Gr=a("li"),mi=r("Fix outstanding issues with the existing code."),yi=u(),Lr=a("li"),wi=r("Submit issues related to bugs or desired new features."),vi=u(),Nr=a("li"),gi=r("Implement new models."),bi=u(),Jr=a("li"),_i=r("Contribute to the examples or to the documentation."),ls=u(),Le=a("p"),Ei=r("If you don\u2019t know where to start, there is a special "),Tt=a("a"),ki=r(`Good First
Issue`),$i=r(` listing. It will give you a list of
open issues that are beginner-friendly and help you start contributing to open-source. Just comment in the issue that you\u2019d like to work
on it.`),as=u(),Ne=a("p"),Ti=r("For something slightly more challenging, you can also take a look at the "),It=a("a"),Ii=r("Good Second Issue"),Pi=r(" list. In general though, if you feel like you know what you\u2019re doing, go for it and we\u2019ll help you get there! \u{1F680}"),ss=u(),Bo=a("blockquote"),Zr=a("p"),Mi=r("All contributions are equally valuable to the community. \u{1F970}"),ns=u(),de=a("h2"),Je=a("a"),qr=a("span"),m(Pt.$$.fragment),Si=u(),Dr=a("span"),Ci=r("Fixing outstanding issues"),is=u(),Ze=a("p"),Ri=r("If you notice an issue with the existing code and have a fix in mind, feel free to "),Mt=a("a"),Wi=r("start contributing"),Ai=r(" and open a Pull Request!"),us=u(),ce=a("h2"),qe=a("a"),Hr=a("span"),m(St.$$.fragment),xi=u(),Fr=a("span"),Oi=r("Submitting a bug-related issue or feature request"),hs=u(),Vo=a("p"),Ui=r(`Do your best to follow these guidelines when submitting a bug-related issue or a feature
request. It will make it easier for us to come back to you quickly and with good
feedback.`),fs=u(),pe=a("h3"),De=a("a"),Yr=a("span"),m(Ct.$$.fragment),Gi=u(),jr=a("span"),Li=r("Did you find a bug?"),ds=u(),zo=a("p"),Ni=r("The \u{1F917} Transformers library is robust and reliable thanks to users who report the problems they encounter."),cs=u(),j=a("p"),Ji=r("Before you report an issue, we would really appreciate it if you could "),Xr=a("strong"),Zi=r(`make sure the bug was not
already reported`),qi=r(" (use the search bar on GitHub under Issues). Your issue should also be related to bugs in the library itself, and not your code. If you\u2019re unsure whether the bug is in your code or the library, please ask on the "),Rt=a("a"),Di=r("forum"),Hi=r(" first. This helps us respond quicker to fixing issues related to the library versus general questions."),ps=u(),Qo=a("p"),Fi=r("Once you\u2019ve confirmed the bug hasn\u2019t already been reported, please include the following information in your issue so we can quickly resolve it:"),ms=u(),U=a("ul"),A=a("li"),Yi=r("Your "),Br=a("strong"),ji=r("OS type and version"),Xi=r(" and "),Vr=a("strong"),Bi=r("Python"),Vi=r(", "),zr=a("strong"),zi=r("PyTorch"),Qi=r(` and
`),Qr=a("strong"),Ki=r("TensorFlow"),eu=r(" versions when applicable."),tu=u(),Kr=a("li"),ou=r(`A short, self-contained, code snippet that allows us to reproduce the bug in
less than 30s.`),ru=u(),Wt=a("li"),lu=r("The "),el=a("em"),au=r("full"),su=r(" traceback if an exception is raised."),nu=u(),tl=a("li"),iu=r("Attach any other additional information, like screenshots, you think may help."),ys=u(),Ko=a("p"),uu=r("To get the OS and software versions automatically, run the following command:"),ws=u(),m(At.$$.fragment),vs=u(),er=a("p"),hu=r("You can also run the same command from the root of the repository:"),gs=u(),m(xt.$$.fragment),bs=u(),me=a("h3"),He=a("a"),ol=a("span"),m(Ot.$$.fragment),fu=u(),rl=a("span"),du=r("Do you want a new feature?"),_s=u(),tr=a("p"),cu=r("If there is a new feature you\u2019d like to see in \u{1F917} Transformers, please open an issue and describe:"),Es=u(),G=a("ol"),Ut=a("li"),Gt=a("p"),pu=r("What is the "),ll=a("em"),mu=r("motivation"),yu=r(" behind this feature? Is it related to a problem or frustration with the library? Is it a feature related to something you need for a project? Is it something you worked on and think it could benefit the community?"),wu=u(),al=a("p"),vu=r("Whatever it is, we\u2019d love to hear about it!"),gu=u(),sl=a("li"),nl=a("p"),bu=r("Describe your requested feature in as much detail as possible. The more you can tell us about it, the better we\u2019ll be able to help you."),_u=u(),il=a("li"),Lt=a("p"),Eu=r("Provide a "),ul=a("em"),ku=r("code snippet"),$u=r(" that demonstrates the features usage."),Tu=u(),hl=a("li"),fl=a("p"),Iu=r("If the feature is related to a paper, please include a link."),ks=u(),or=a("p"),Pu=r("If your issue is well written we\u2019re already 80% of the way there by the time you create it."),$s=u(),Fe=a("p"),Mu=r("We have added "),Nt=a("a"),Su=r("templates"),Cu=r(" to help you get started with your issue."),Ts=u(),ye=a("h2"),Ye=a("a"),dl=a("span"),m(Jt.$$.fragment),Ru=u(),cl=a("span"),Wu=r("Do you want to implement a new model?"),Is=u(),rr=a("p"),Au=r("New models are constantly released and if you want to implement a new model, please provide the following information"),Ps=u(),X=a("ul"),pl=a("li"),xu=r("A short description of the model and link to the paper."),Ou=u(),ml=a("li"),Uu=r("Link to the implementation if it is open-sourced."),Gu=u(),yl=a("li"),Lu=r("Link to the model weights if they are available."),Ms=u(),lr=a("p"),Nu=r("If you are willing to contribute the model yourself, let us know so we can help you add it to \u{1F917} Transformers!"),Ss=u(),B=a("p"),Ju=r("We have added a "),Zt=a("a"),Zu=r("detailed guide and templates"),qu=r(" to help you get started with adding a new model, and we also have a more technical guide for "),qt=a("a"),Du=r("how to add a model to \u{1F917} Transformers"),Hu=r("."),Cs=u(),we=a("h2"),je=a("a"),wl=a("span"),m(Dt.$$.fragment),Fu=u(),vl=a("span"),Yu=r("Do you want to add documentation?"),Rs=u(),ar=a("p"),ju=r("We\u2019re always looking for improvements to the documentation that make it more clear and accurate. Please let us know how the documentation can be improved such as typos and any content that is missing, unclear or inaccurate. We\u2019ll be happy to make the changes or help you make a contribution if you\u2019re interested!"),Ws=u(),Xe=a("p"),Xu=r("For more details about how to generate, build, and write the documentation, take a look at the documentation "),Ht=a("a"),Bu=r("README"),Vu=r("."),As=u(),ve=a("h2"),Be=a("a"),gl=a("span"),m(Ft.$$.fragment),zu=u(),bl=a("span"),Qu=r("Create a Pull Request"),xs=u(),sr=a("p"),Ku=r(`Before writing any code, we strongly advise you to search through the existing PRs or
issues to make sure nobody is already working on the same thing. If you are
unsure, it is always a good idea to open an issue to get some feedback.`),Os=u(),M=a("p"),eh=r("You will need basic "),_l=a("code"),th=r("git"),oh=r(` proficiency to contribute to
\u{1F917} Transformers. While `),El=a("code"),rh=r("git"),lh=r(` is not the easiest tool to use, it has the greatest
manual. Type `),kl=a("code"),ah=r("git --help"),sh=r(" in a shell and enjoy! If you prefer books, "),Yt=a("a"),nh=r(`Pro
Git`),ih=r(" is a very good reference."),Us=u(),Ve=a("p"),uh=r("You\u2019ll need "),$l=a("strong"),nr=a("a"),hh=r("Python 3.7"),fh=r(" or above to contribute to \u{1F917} Transformers. Follow the steps below to start contributing:"),Gs=u(),k=a("ol"),Tl=a("li"),ge=a("p"),dh=r("Fork the "),jt=a("a"),ch=r("repository"),ph=r(` by
clicking on the `),Il=a("strong"),Xt=a("a"),mh=r("Fork"),yh=r(` button on the repository\u2019s page. This creates a copy of the code
under your GitHub user account.`),wh=u(),Bt=a("li"),Pl=a("p"),vh=r("Clone your fork to your local disk, and add the base repository as a remote:"),gh=u(),m(Vt.$$.fragment),bh=u(),be=a("li"),Ml=a("p"),_h=r("Create a new branch to hold your development changes:"),Eh=u(),m(zt.$$.fragment),kh=u(),_e=a("p"),$h=r("\u{1F6A8} "),Sl=a("strong"),Th=r("Do not"),Ih=r(" work on the "),Cl=a("code"),Ph=r("main"),Mh=r(" branch!"),Sh=u(),I=a("li"),Rl=a("p"),Ch=r("Set up a development environment by running the following command in a virtual environment:"),Rh=u(),m(Qt.$$.fragment),Wh=u(),Ee=a("p"),Ah=r(`If \u{1F917} Transformers was already installed in the virtual environment, remove
it with `),Wl=a("code"),xh=r("pip uninstall transformers"),Oh=r(` before reinstalling it in editable
mode with the `),Al=a("code"),Uh=r("-e"),Gh=r(" flag."),Lh=u(),xl=a("p"),Nh=r(`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\u2019s the case make sure to install the Deep Learning framework you are working with
(PyTorch, TensorFlow and/or Flax) then do:`),Jh=u(),m(Kt.$$.fragment),Zh=u(),Ol=a("p"),qh=r("which should be enough for most use cases."),Dh=u(),c=a("li"),Ul=a("p"),Hh=r("Develop the features on your branch."),Fh=u(),Gl=a("p"),Yh=r(`As you work on your code, you should make sure the test suite
passes. Run the tests impacted by your changes like this:`),jh=u(),m(eo.$$.fragment),Xh=u(),to=a("p"),Bh=r(`For more information about tests, check out the
`),oo=a("a"),Vh=r("Testing"),zh=r(" guide."),Qh=u(),ke=a("p"),Kh=r("\u{1F917} Transformers relies on "),Ll=a("code"),ef=r("black"),tf=r(" and "),Nl=a("code"),of=r("ruff"),rf=r(` to format its source code
consistently. After you make changes, apply automatic style corrections and code verifications
that can\u2019t be automated in one go with:`),lf=u(),m(ro.$$.fragment),af=u(),Jl=a("p"),sf=r("This target is also optimized to only work with files modified by the PR you\u2019re working on."),nf=u(),Zl=a("p"),uf=r(`If you prefer to run the checks one after the other, the following command applies the
style corrections:`),hf=u(),m(lo.$$.fragment),ff=u(),ao=a("p"),df=r("\u{1F917} Transformers also uses "),ql=a("code"),cf=r("ruff"),pf=r(` and a few custom scripts to check for coding mistakes. Quality
controls are run by the CI, but you can run the same checks with:`),mf=u(),m(so.$$.fragment),yf=u(),Dl=a("p"),wf=r(`Finally, we have a lot of scripts to make sure we didn\u2019t forget to update
some files when adding a new model. You can run these scripts with:`),vf=u(),m(no.$$.fragment),gf=u(),io=a("p"),bf=r(`To learn more about those checks and how to fix any issues with them, check out the
`),uo=a("a"),_f=r("Checks on a Pull Request"),Ef=r(" guide."),kf=u(),ho=a("p"),$f=r("If you\u2019re modifying documents under "),Hl=a("code"),Tf=r("docs/source"),If=r(` directory, make sure the documentation can still be built. This check will also run in the CI when you open a pull request. To run a local check
make sure you install the documentation builder:`),Pf=u(),m(fo.$$.fragment),Mf=u(),Fl=a("p"),Sf=r("Run the following command from the root of the repository:"),Cf=u(),m(co.$$.fragment),Rf=u(),po=a("p"),Wf=r("This will build the documentation in the "),Yl=a("code"),Af=r("~/tmp/test-build"),xf=r(` folder where you can inspect the generated
Markdown files with your favorite editor. You can also preview the docs on GitHub when you open a pull request.`),Of=u(),$e=a("p"),Uf=r("Once you\u2019re happy with your changes, add changed files with "),jl=a("code"),Gf=r("git add"),Lf=r(` and
record your changes locally with `),Xl=a("code"),Nf=r("git commit"),Jf=r(":"),Zf=u(),m(mo.$$.fragment),qf=u(),yo=a("p"),Df=r("Please remember to write "),wo=a("a"),Hf=r(`good commit
messages`),Ff=r(" to clearly communicate the changes you made!"),Yf=u(),Te=a("p"),jf=r(`To keep your copy of the code up to date with the original
repository, rebase your branch on `),Bl=a("code"),Xf=r("upstream/branch"),Bf=u(),Vl=a("em"),Vf=r("before"),zf=r(" you open a pull request or if requested by a maintainer:"),Qf=u(),m(vo.$$.fragment),Kf=u(),zl=a("p"),ed=r("Push your changes to your branch:"),td=u(),m(go.$$.fragment),od=u(),bo=a("p"),rd=r("If you\u2019ve already opened a pull request, you\u2019ll need to force push with the "),Ql=a("code"),ld=r("--force"),ad=r(" flag. Otherwise, if the pull request hasn\u2019t been opened yet, you can just push your changes normally."),sd=u(),Kl=a("li"),Ie=a("p"),nd=r("Now you can go to your fork of the repository on GitHub and click on "),ea=a("strong"),id=r("Pull request"),ud=r(" to open a pull request. Make sure you tick off all the boxes in our "),_o=a("a"),hd=r("checklist"),fd=r(" below. When you\u2019re ready, you can send your changes to the project maintainers for review."),dd=u(),ta=a("li"),oa=a("p"),cd=r(`It\u2019s ok if maintainers request changes, it happens to our core contributors
too! So everyone can see the changes in the pull request, work in your local
branch and push the changes to your fork. They will automatically appear in
the pull request.`),Ls=u(),Pe=a("h3"),ze=a("a"),ra=a("span"),m(Eo.$$.fragment),pd=u(),la=a("span"),md=r("Pull request checklist"),Ns=u(),P=a("p"),yd=r("\u2610 The pull request title should summarize your contribution."),wd=a("br"),vd=r(`
\u2610 If your pull request addresses an issue, please mention the issue number in the pull
request description to make sure they are linked (and people viewing the issue know you
are working on it).`),gd=a("br"),bd=r(`
\u2610 To indicate a work in progress please prefix the title with `),aa=a("code"),_d=r("[WIP]"),Ed=r(`. These are
useful to avoid duplicated work, and to differentiate it from PRs ready to be merged.
\u2610 Make sure existing tests pass.`),kd=a("br"),$d=r(`
\u2610 If adding a new feature, also add tests for it.`),Td=a("br"),Js=u(),V=a("ul"),ko=a("li"),Id=r(`If you are adding a new model, make sure you use
`),sa=a("code"),Pd=r("ModelTester.all_model_classes = (MyModel, MyModelWithLMHead,...)"),Md=r(" to trigger the common tests."),Sd=u(),Me=a("li"),Cd=r("If you are adding new "),na=a("code"),Rd=r("@slow"),Wd=r(` tests, make sure they pass using
`),ia=a("code"),Ad=r("RUN_SLOW=1 python -m pytest tests/models/my_new_model/test_my_new_model.py"),xd=r("."),Od=u(),Qe=a("li"),Ud=r(`If you are adding a new tokenizer, write tests and make sure
`),ua=a("code"),Gd=r("RUN_SLOW=1 python -m pytest tests/models/{your_model_name}/test_tokenization_{your_model_name}.py"),Ld=r(` passes.
CircleCI does not run the slow tests, but GitHub Actions does every night!`),Nd=a("br"),Zs=u(),S=a("p"),Jd=r(`\u2610 All public methods must have informative docstrings (see
`),$o=a("a"),ha=a("code"),Zd=r("modeling_bert.py"),qd=r(`
for an example).`),Dd=a("br"),Hd=r(`
\u2610 Due to the rapidly growing repository, don\u2019t add any images, videos and other
non-text files that\u2019ll significantly weigh down the repository. Instead, use a Hub
repository such as `),To=a("a"),fa=a("code"),Fd=r("hf-internal-testing"),Yd=r(`
to host these files and reference them by URL. We recommend placing documentation
related images in the following repository:
`),Io=a("a"),jd=r("huggingface/documentation-images"),Xd=r(`.
You can open a PR on this dataset repostitory and ask a Hugging Face member to merge it.`),qs=u(),Ke=a("p"),Bd=r("For more information about the checks run on a pull request, take a look at our "),Po=a("a"),Vd=r("Checks on a Pull Request"),zd=r(" guide."),Ds=u(),Se=a("h3"),et=a("a"),da=a("span"),m(Mo.$$.fragment),Qd=u(),ca=a("span"),Kd=r("Tests"),Hs=u(),z=a("p"),ec=r(`An extensive test suite is included to test the library behavior and several examples. Library tests can be found in
the `),So=a("a"),tc=r("tests"),oc=r(` folder and examples tests in the
`),Co=a("a"),rc=r("examples"),lc=r(" folder."),Fs=u(),L=a("p"),ac=r("We like "),pa=a("code"),sc=r("pytest"),nc=r(" and "),ma=a("code"),ic=r("pytest-xdist"),uc=r(` because it\u2019s faster. From the root of the
repository, specify a `),ya=a("em"),hc=r("path to a subfolder or a test file"),fc=r(" to run the test."),Ys=u(),m(Ro.$$.fragment),js=u(),N=a("p"),dc=r("Similarly, for the "),wa=a("code"),cc=r("examples"),pc=r(" directory, specify a "),va=a("em"),mc=r("path to a subfolder or test file"),yc=r(" to run the test. For example, the following command tests the text classification subfolder in the PyTorch "),ga=a("code"),wc=r("examples"),vc=r(" directory:"),Xs=u(),m(Wo.$$.fragment),Bs=u(),J=a("p"),gc=r("In fact, this is actually how our "),ba=a("code"),bc=r("make test"),_c=r(" and "),_a=a("code"),Ec=r("make test-examples"),kc=r(" commands are implemented (not including the "),Ea=a("code"),$c=r("pip install"),Tc=r(")!"),Vs=u(),ir=a("p"),Ic=r(`You can also specify a smaller set of tests in order to test only the feature
you\u2019re working on.`),zs=u(),Q=a("p"),Pc=r("By default, slow tests are skipped but you can set the "),ka=a("code"),Mc=r("RUN_SLOW"),Sc=r(` environment variable to
`),$a=a("code"),Cc=r("yes"),Rc=r(` to run them. This will download many gigabytes of models so make sure you
have enough disk space, a good internet connection or a lot of patience!`),Qs=u(),m(tt.$$.fragment),Ks=u(),m(Ao.$$.fragment),en=u(),ur=a("p"),Wc=r("Like the slow tests, there are other environment variables available which not enabled by default during testing:"),tn=u(),K=a("ul"),hr=a("li"),Ta=a("code"),Ac=r("RUN_CUSTOM_TOKENIZERS"),xc=r(": Enables tests for custom tokenizers."),Oc=u(),fr=a("li"),Ia=a("code"),Uc=r("RUN_PT_FLAX_CROSS_TESTS"),Gc=r(": Enables tests for PyTorch + Flax integration."),Lc=u(),dr=a("li"),Pa=a("code"),Nc=r("RUN_PT_TF_CROSS_TESTS"),Jc=r(": Enables tests for TensorFlow + PyTorch integration."),on=u(),ot=a("p"),Zc=r("More environment variables and additional information can be found in the "),cr=a("a"),qc=r("testing_utils.py"),Dc=r("."),rn=u(),ee=a("p"),Hc=r("\u{1F917} Transformers uses "),Ma=a("code"),Fc=r("pytest"),Yc=r(` as a test runner only. It doesn\u2019t use any
`),Sa=a("code"),jc=r("pytest"),Xc=r("-specific features in the test suite itself."),ln=u(),te=a("p"),Bc=r("This means "),Ca=a("code"),Vc=r("unittest"),zc=r(` is fully supported. Here\u2019s how to run tests with
`),Ra=a("code"),Qc=r("unittest"),Kc=r(":"),an=u(),m(xo.$$.fragment),sn=u(),Ce=a("h3"),rt=a("a"),Wa=a("span"),m(Oo.$$.fragment),ep=u(),Aa=a("span"),tp=r("Style guide"),nn=u(),oe=a("p"),op=r("For documentation strings, \u{1F917} Transformers follows the "),Uo=a("a"),rp=r("Google Python Style Guide"),lp=r(`.
Check our `),Go=a("a"),ap=r("documentation writing guide"),sp=r(`
for more information.`),un=u(),Re=a("h3"),lt=a("a"),xa=a("span"),m(Lo.$$.fragment),np=u(),Oa=a("span"),ip=r("Develop on Windows"),hn=u(),Z=a("p"),up=r("On Windows (unless you\u2019re working in "),No=a("a"),hp=r("Windows Subsystem for Linux"),fp=r(" or WSL), you need to configure git to transform Windows "),Ua=a("code"),dp=r("CRLF"),cp=r(" line endings to Linux "),Ga=a("code"),pp=r("LF"),mp=r(" line endings:"),fn=u(),m(Jo.$$.fragment),dn=u(),at=a("p"),yp=r("One way to run the "),La=a("code"),wp=r("make"),vp=r(" command on Windows is with MSYS2:"),cn=u(),q=a("ol"),st=a("li"),Zo=a("a"),gp=r("Download MSYS2"),bp=r(", and we assume it\u2019s installed in "),Na=a("code"),_p=r("C:\\msys64"),Ep=r("."),kp=u(),We=a("li"),$p=r("Open the command line "),Ja=a("code"),Tp=r("C:\\msys64\\msys2.exe"),Ip=r(" (it should be available from the "),Za=a("strong"),Pp=r("Start"),Mp=r(" menu)."),Sp=u(),H=a("li"),Cp=r("Run in the shell: "),qa=a("code"),Rp=r("pacman -Syu"),Wp=r(" and install "),Da=a("code"),Ap=r("make"),xp=r(" with "),Ha=a("code"),Op=r("pacman -S make"),Up=r("."),Gp=u(),qo=a("li"),Lp=r("Add "),Fa=a("code"),Np=r("C:\\msys64\\usr\\bin"),Jp=r(" to your PATH environment variable."),pn=u(),nt=a("p"),Zp=r("You can now use "),Ya=a("code"),qp=r("make"),Dp=r(" from any terminal (Powershell, cmd.exe, etc.)! \u{1F389}"),mn=u(),Ae=a("h3"),it=a("a"),ja=a("span"),m(Do.$$.fragment),Hp=u(),Xa=a("span"),Fp=r("Sync a forked repository with upstream main (the Hugging Face repository)"),yn=u(),pr=a("p"),Yp=r("When updating the main branch of a forked repository, please follow these steps to avoid pinging the upstream repository which adds reference notes to each upstream PR, and sends unnecessary notifications to the developers involved in these PRs."),wn=u(),ut=a("ol"),Ba=a("li"),jp=r("When possible, avoid syncing with the upstream using a branch and PR on the forked repository. Instead, merge directly into the forked main."),Xp=u(),Va=a("li"),Bp=r("If a PR is absolutely necessary, use the following steps after checking out your branch:"),vn=u(),m(Ho.$$.fragment),this.h()},l(t){const i=Mv('[data-svelte="svelte-1phssyn"]',document.head);_=s(i,"META",{name:!0,content:!0}),i.forEach(o),xe=h(t),$=s(t,"H1",{class:!0});var Fo=n($);x=s(Fo,"A",{id:!0,class:!0,href:!0});var Kp=n(x);se=s(Kp,"SPAN",{});var em=n(se);y(W.$$.fragment,em),em.forEach(o),Kp.forEach(o),gt=h(Fo),ne=s(Fo,"SPAN",{});var tm=n(ne);ie=l(tm,"Contribute to \u{1F917} Transformers"),tm.forEach(o),Fo.forEach(o),Oe=h(t),Y=s(t,"P",{});var om=n(Y);ue=l(om,`Everyone is welcome to contribute, and we value everybody\u2019s contribution. Code
contributions are not the only way to help the community. Answering questions, helping
others, and improving the documentation are also immensely valuable.`),om.forEach(o),T=h(t),he=s(t,"P",{});var rm=n(he);Yo=l(rm,`It also helps us if you spread the word! Reference the library in blog posts
about the awesome projects it made possible, shout out on Twitter every time it has
helped you, or simply \u2B50\uFE0F the repository to say thank you.`),rm.forEach(o),bt=h(t),Ue=s(t,"P",{});var bn=n(Ue);si=l(bn,`However you choose to contribute, please be mindful and respect our
`),_t=s(bn,"A",{href:!0,rel:!0});var lm=n(_t);ni=l(lm,"code of conduct"),lm.forEach(o),ii=l(bn,"."),bn.forEach(o),es=h(t),jo=s(t,"P",{});var am=n(jo);Et=s(am,"STRONG",{});var _n=n(Et);ui=l(_n,"This guide was heavily inspired by the awesome "),kt=s(_n,"A",{href:!0,rel:!0});var sm=n(kt);hi=l(sm,"scikit-learn guide to contributing"),sm.forEach(o),fi=l(_n,"."),_n.forEach(o),am.forEach(o),ts=h(t),fe=s(t,"H2",{class:!0});var En=n(fe);Ge=s(En,"A",{id:!0,class:!0,href:!0});var nm=n(Ge);Or=s(nm,"SPAN",{});var im=n(Or);y($t.$$.fragment,im),im.forEach(o),nm.forEach(o),di=h(En),Ur=s(En,"SPAN",{});var um=n(Ur);ci=l(um,"Ways to contribute"),um.forEach(o),En.forEach(o),os=h(t),Xo=s(t,"P",{});var hm=n(Xo);pi=l(hm,"There are several ways you can contribute to \u{1F917} Transformers:"),hm.forEach(o),rs=h(t),O=s(t,"UL",{});var ht=n(O);Gr=s(ht,"LI",{});var fm=n(Gr);mi=l(fm,"Fix outstanding issues with the existing code."),fm.forEach(o),yi=h(ht),Lr=s(ht,"LI",{});var dm=n(Lr);wi=l(dm,"Submit issues related to bugs or desired new features."),dm.forEach(o),vi=h(ht),Nr=s(ht,"LI",{});var cm=n(Nr);gi=l(cm,"Implement new models."),cm.forEach(o),bi=h(ht),Jr=s(ht,"LI",{});var pm=n(Jr);_i=l(pm,"Contribute to the examples or to the documentation."),pm.forEach(o),ht.forEach(o),ls=h(t),Le=s(t,"P",{});var kn=n(Le);Ei=l(kn,"If you don\u2019t know where to start, there is a special "),Tt=s(kn,"A",{href:!0,rel:!0});var mm=n(Tt);ki=l(mm,`Good First
Issue`),mm.forEach(o),$i=l(kn,` listing. It will give you a list of
open issues that are beginner-friendly and help you start contributing to open-source. Just comment in the issue that you\u2019d like to work
on it.`),kn.forEach(o),as=h(t),Ne=s(t,"P",{});var $n=n(Ne);Ti=l($n,"For something slightly more challenging, you can also take a look at the "),It=s($n,"A",{href:!0,rel:!0});var ym=n(It);Ii=l(ym,"Good Second Issue"),ym.forEach(o),Pi=l($n," list. In general though, if you feel like you know what you\u2019re doing, go for it and we\u2019ll help you get there! \u{1F680}"),$n.forEach(o),ss=h(t),Bo=s(t,"BLOCKQUOTE",{});var wm=n(Bo);Zr=s(wm,"P",{});var vm=n(Zr);Mi=l(vm,"All contributions are equally valuable to the community. \u{1F970}"),vm.forEach(o),wm.forEach(o),ns=h(t),de=s(t,"H2",{class:!0});var Tn=n(de);Je=s(Tn,"A",{id:!0,class:!0,href:!0});var gm=n(Je);qr=s(gm,"SPAN",{});var bm=n(qr);y(Pt.$$.fragment,bm),bm.forEach(o),gm.forEach(o),Si=h(Tn),Dr=s(Tn,"SPAN",{});var _m=n(Dr);Ci=l(_m,"Fixing outstanding issues"),_m.forEach(o),Tn.forEach(o),is=h(t),Ze=s(t,"P",{});var In=n(Ze);Ri=l(In,"If you notice an issue with the existing code and have a fix in mind, feel free to "),Mt=s(In,"A",{href:!0,rel:!0});var Em=n(Mt);Wi=l(Em,"start contributing"),Em.forEach(o),Ai=l(In," and open a Pull Request!"),In.forEach(o),us=h(t),ce=s(t,"H2",{class:!0});var Pn=n(ce);qe=s(Pn,"A",{id:!0,class:!0,href:!0});var km=n(qe);Hr=s(km,"SPAN",{});var $m=n(Hr);y(St.$$.fragment,$m),$m.forEach(o),km.forEach(o),xi=h(Pn),Fr=s(Pn,"SPAN",{});var Tm=n(Fr);Oi=l(Tm,"Submitting a bug-related issue or feature request"),Tm.forEach(o),Pn.forEach(o),hs=h(t),Vo=s(t,"P",{});var Im=n(Vo);Ui=l(Im,`Do your best to follow these guidelines when submitting a bug-related issue or a feature
request. It will make it easier for us to come back to you quickly and with good
feedback.`),Im.forEach(o),fs=h(t),pe=s(t,"H3",{class:!0});var Mn=n(pe);De=s(Mn,"A",{id:!0,class:!0,href:!0});var Pm=n(De);Yr=s(Pm,"SPAN",{});var Mm=n(Yr);y(Ct.$$.fragment,Mm),Mm.forEach(o),Pm.forEach(o),Gi=h(Mn),jr=s(Mn,"SPAN",{});var Sm=n(jr);Li=l(Sm,"Did you find a bug?"),Sm.forEach(o),Mn.forEach(o),ds=h(t),zo=s(t,"P",{});var Cm=n(zo);Ni=l(Cm,"The \u{1F917} Transformers library is robust and reliable thanks to users who report the problems they encounter."),Cm.forEach(o),cs=h(t),j=s(t,"P",{});var mr=n(j);Ji=l(mr,"Before you report an issue, we would really appreciate it if you could "),Xr=s(mr,"STRONG",{});var Rm=n(Xr);Zi=l(Rm,`make sure the bug was not
already reported`),Rm.forEach(o),qi=l(mr," (use the search bar on GitHub under Issues). Your issue should also be related to bugs in the library itself, and not your code. If you\u2019re unsure whether the bug is in your code or the library, please ask on the "),Rt=s(mr,"A",{href:!0,rel:!0});var Wm=n(Rt);Di=l(Wm,"forum"),Wm.forEach(o),Hi=l(mr," first. This helps us respond quicker to fixing issues related to the library versus general questions."),mr.forEach(o),ps=h(t),Qo=s(t,"P",{});var Am=n(Qo);Fi=l(Am,"Once you\u2019ve confirmed the bug hasn\u2019t already been reported, please include the following information in your issue so we can quickly resolve it:"),Am.forEach(o),ms=h(t),U=s(t,"UL",{});var ft=n(U);A=s(ft,"LI",{});var re=n(A);Yi=l(re,"Your "),Br=s(re,"STRONG",{});var xm=n(Br);ji=l(xm,"OS type and version"),xm.forEach(o),Xi=l(re," and "),Vr=s(re,"STRONG",{});var Om=n(Vr);Bi=l(Om,"Python"),Om.forEach(o),Vi=l(re,", "),zr=s(re,"STRONG",{});var Um=n(zr);zi=l(Um,"PyTorch"),Um.forEach(o),Qi=l(re,` and
`),Qr=s(re,"STRONG",{});var Gm=n(Qr);Ki=l(Gm,"TensorFlow"),Gm.forEach(o),eu=l(re," versions when applicable."),re.forEach(o),tu=h(ft),Kr=s(ft,"LI",{});var Lm=n(Kr);ou=l(Lm,`A short, self-contained, code snippet that allows us to reproduce the bug in
less than 30s.`),Lm.forEach(o),ru=h(ft),Wt=s(ft,"LI",{});var Sn=n(Wt);lu=l(Sn,"The "),el=s(Sn,"EM",{});var Nm=n(el);au=l(Nm,"full"),Nm.forEach(o),su=l(Sn," traceback if an exception is raised."),Sn.forEach(o),nu=h(ft),tl=s(ft,"LI",{});var Jm=n(tl);iu=l(Jm,"Attach any other additional information, like screenshots, you think may help."),Jm.forEach(o),ft.forEach(o),ys=h(t),Ko=s(t,"P",{});var Zm=n(Ko);uu=l(Zm,"To get the OS and software versions automatically, run the following command:"),Zm.forEach(o),ws=h(t),y(At.$$.fragment,t),vs=h(t),er=s(t,"P",{});var qm=n(er);hu=l(qm,"You can also run the same command from the root of the repository:"),qm.forEach(o),gs=h(t),y(xt.$$.fragment,t),bs=h(t),me=s(t,"H3",{class:!0});var Cn=n(me);He=s(Cn,"A",{id:!0,class:!0,href:!0});var Dm=n(He);ol=s(Dm,"SPAN",{});var Hm=n(ol);y(Ot.$$.fragment,Hm),Hm.forEach(o),Dm.forEach(o),fu=h(Cn),rl=s(Cn,"SPAN",{});var Fm=n(rl);du=l(Fm,"Do you want a new feature?"),Fm.forEach(o),Cn.forEach(o),_s=h(t),tr=s(t,"P",{});var Ym=n(tr);cu=l(Ym,"If there is a new feature you\u2019d like to see in \u{1F917} Transformers, please open an issue and describe:"),Ym.forEach(o),Es=h(t),G=s(t,"OL",{});var dt=n(G);Ut=s(dt,"LI",{});var Rn=n(Ut);Gt=s(Rn,"P",{});var Wn=n(Gt);pu=l(Wn,"What is the "),ll=s(Wn,"EM",{});var jm=n(ll);mu=l(jm,"motivation"),jm.forEach(o),yu=l(Wn," behind this feature? Is it related to a problem or frustration with the library? Is it a feature related to something you need for a project? Is it something you worked on and think it could benefit the community?"),Wn.forEach(o),wu=h(Rn),al=s(Rn,"P",{});var Xm=n(al);vu=l(Xm,"Whatever it is, we\u2019d love to hear about it!"),Xm.forEach(o),Rn.forEach(o),gu=h(dt),sl=s(dt,"LI",{});var Bm=n(sl);nl=s(Bm,"P",{});var Vm=n(nl);bu=l(Vm,"Describe your requested feature in as much detail as possible. The more you can tell us about it, the better we\u2019ll be able to help you."),Vm.forEach(o),Bm.forEach(o),_u=h(dt),il=s(dt,"LI",{});var zm=n(il);Lt=s(zm,"P",{});var An=n(Lt);Eu=l(An,"Provide a "),ul=s(An,"EM",{});var Qm=n(ul);ku=l(Qm,"code snippet"),Qm.forEach(o),$u=l(An," that demonstrates the features usage."),An.forEach(o),zm.forEach(o),Tu=h(dt),hl=s(dt,"LI",{});var Km=n(hl);fl=s(Km,"P",{});var ey=n(fl);Iu=l(ey,"If the feature is related to a paper, please include a link."),ey.forEach(o),Km.forEach(o),dt.forEach(o),ks=h(t),or=s(t,"P",{});var ty=n(or);Pu=l(ty,"If your issue is well written we\u2019re already 80% of the way there by the time you create it."),ty.forEach(o),$s=h(t),Fe=s(t,"P",{});var xn=n(Fe);Mu=l(xn,"We have added "),Nt=s(xn,"A",{href:!0,rel:!0});var oy=n(Nt);Su=l(oy,"templates"),oy.forEach(o),Cu=l(xn," to help you get started with your issue."),xn.forEach(o),Ts=h(t),ye=s(t,"H2",{class:!0});var On=n(ye);Ye=s(On,"A",{id:!0,class:!0,href:!0});var ry=n(Ye);dl=s(ry,"SPAN",{});var ly=n(dl);y(Jt.$$.fragment,ly),ly.forEach(o),ry.forEach(o),Ru=h(On),cl=s(On,"SPAN",{});var ay=n(cl);Wu=l(ay,"Do you want to implement a new model?"),ay.forEach(o),On.forEach(o),Is=h(t),rr=s(t,"P",{});var sy=n(rr);Au=l(sy,"New models are constantly released and if you want to implement a new model, please provide the following information"),sy.forEach(o),Ps=h(t),X=s(t,"UL",{});var yr=n(X);pl=s(yr,"LI",{});var ny=n(pl);xu=l(ny,"A short description of the model and link to the paper."),ny.forEach(o),Ou=h(yr),ml=s(yr,"LI",{});var iy=n(ml);Uu=l(iy,"Link to the implementation if it is open-sourced."),iy.forEach(o),Gu=h(yr),yl=s(yr,"LI",{});var uy=n(yl);Lu=l(uy,"Link to the model weights if they are available."),uy.forEach(o),yr.forEach(o),Ms=h(t),lr=s(t,"P",{});var hy=n(lr);Nu=l(hy,"If you are willing to contribute the model yourself, let us know so we can help you add it to \u{1F917} Transformers!"),hy.forEach(o),Ss=h(t),B=s(t,"P",{});var wr=n(B);Ju=l(wr,"We have added a "),Zt=s(wr,"A",{href:!0,rel:!0});var fy=n(Zt);Zu=l(fy,"detailed guide and templates"),fy.forEach(o),qu=l(wr," to help you get started with adding a new model, and we also have a more technical guide for "),qt=s(wr,"A",{href:!0,rel:!0});var dy=n(qt);Du=l(dy,"how to add a model to \u{1F917} Transformers"),dy.forEach(o),Hu=l(wr,"."),wr.forEach(o),Cs=h(t),we=s(t,"H2",{class:!0});var Un=n(we);je=s(Un,"A",{id:!0,class:!0,href:!0});var cy=n(je);wl=s(cy,"SPAN",{});var py=n(wl);y(Dt.$$.fragment,py),py.forEach(o),cy.forEach(o),Fu=h(Un),vl=s(Un,"SPAN",{});var my=n(vl);Yu=l(my,"Do you want to add documentation?"),my.forEach(o),Un.forEach(o),Rs=h(t),ar=s(t,"P",{});var yy=n(ar);ju=l(yy,"We\u2019re always looking for improvements to the documentation that make it more clear and accurate. Please let us know how the documentation can be improved such as typos and any content that is missing, unclear or inaccurate. We\u2019ll be happy to make the changes or help you make a contribution if you\u2019re interested!"),yy.forEach(o),Ws=h(t),Xe=s(t,"P",{});var Gn=n(Xe);Xu=l(Gn,"For more details about how to generate, build, and write the documentation, take a look at the documentation "),Ht=s(Gn,"A",{href:!0,rel:!0});var wy=n(Ht);Bu=l(wy,"README"),wy.forEach(o),Vu=l(Gn,"."),Gn.forEach(o),As=h(t),ve=s(t,"H2",{class:!0});var Ln=n(ve);Be=s(Ln,"A",{id:!0,class:!0,href:!0});var vy=n(Be);gl=s(vy,"SPAN",{});var gy=n(gl);y(Ft.$$.fragment,gy),gy.forEach(o),vy.forEach(o),zu=h(Ln),bl=s(Ln,"SPAN",{});var by=n(bl);Qu=l(by,"Create a Pull Request"),by.forEach(o),Ln.forEach(o),xs=h(t),sr=s(t,"P",{});var _y=n(sr);Ku=l(_y,`Before writing any code, we strongly advise you to search through the existing PRs or
issues to make sure nobody is already working on the same thing. If you are
unsure, it is always a good idea to open an issue to get some feedback.`),_y.forEach(o),Os=h(t),M=s(t,"P",{});var le=n(M);eh=l(le,"You will need basic "),_l=s(le,"CODE",{});var Ey=n(_l);th=l(Ey,"git"),Ey.forEach(o),oh=l(le,` proficiency to contribute to
\u{1F917} Transformers. While `),El=s(le,"CODE",{});var ky=n(El);rh=l(ky,"git"),ky.forEach(o),lh=l(le,` is not the easiest tool to use, it has the greatest
manual. Type `),kl=s(le,"CODE",{});var $y=n(kl);ah=l($y,"git --help"),$y.forEach(o),sh=l(le," in a shell and enjoy! If you prefer books, "),Yt=s(le,"A",{href:!0,rel:!0});var Ty=n(Yt);nh=l(Ty,`Pro
Git`),Ty.forEach(o),ih=l(le," is a very good reference."),le.forEach(o),Us=h(t),Ve=s(t,"P",{});var Nn=n(Ve);uh=l(Nn,"You\u2019ll need "),$l=s(Nn,"STRONG",{});var Iy=n($l);nr=s(Iy,"A",{href:!0});var Py=n(nr);hh=l(Py,"Python 3.7"),Py.forEach(o),Iy.forEach(o),fh=l(Nn," or above to contribute to \u{1F917} Transformers. Follow the steps below to start contributing:"),Nn.forEach(o),Gs=h(t),k=s(t,"OL",{});var C=n(k);Tl=s(C,"LI",{});var My=n(Tl);ge=s(My,"P",{});var vr=n(ge);dh=l(vr,"Fork the "),jt=s(vr,"A",{href:!0,rel:!0});var Sy=n(jt);ch=l(Sy,"repository"),Sy.forEach(o),ph=l(vr,` by
clicking on the `),Il=s(vr,"STRONG",{});var Cy=n(Il);Xt=s(Cy,"A",{href:!0,rel:!0});var Ry=n(Xt);mh=l(Ry,"Fork"),Ry.forEach(o),Cy.forEach(o),yh=l(vr,` button on the repository\u2019s page. This creates a copy of the code
under your GitHub user account.`),vr.forEach(o),My.forEach(o),wh=h(C),Bt=s(C,"LI",{});var Jn=n(Bt);Pl=s(Jn,"P",{});var Wy=n(Pl);vh=l(Wy,"Clone your fork to your local disk, and add the base repository as a remote:"),Wy.forEach(o),gh=h(Jn),y(Vt.$$.fragment,Jn),Jn.forEach(o),bh=h(C),be=s(C,"LI",{});var gr=n(be);Ml=s(gr,"P",{});var Ay=n(Ml);_h=l(Ay,"Create a new branch to hold your development changes:"),Ay.forEach(o),Eh=h(gr),y(zt.$$.fragment,gr),kh=h(gr),_e=s(gr,"P",{});var br=n(_e);$h=l(br,"\u{1F6A8} "),Sl=s(br,"STRONG",{});var xy=n(Sl);Th=l(xy,"Do not"),xy.forEach(o),Ih=l(br," work on the "),Cl=s(br,"CODE",{});var Oy=n(Cl);Ph=l(Oy,"main"),Oy.forEach(o),Mh=l(br," branch!"),br.forEach(o),gr.forEach(o),Sh=h(C),I=s(C,"LI",{});var D=n(I);Rl=s(D,"P",{});var Uy=n(Rl);Ch=l(Uy,"Set up a development environment by running the following command in a virtual environment:"),Uy.forEach(o),Rh=h(D),y(Qt.$$.fragment,D),Wh=h(D),Ee=s(D,"P",{});var _r=n(Ee);Ah=l(_r,`If \u{1F917} Transformers was already installed in the virtual environment, remove
it with `),Wl=s(_r,"CODE",{});var Gy=n(Wl);xh=l(Gy,"pip uninstall transformers"),Gy.forEach(o),Oh=l(_r,` before reinstalling it in editable
mode with the `),Al=s(_r,"CODE",{});var Ly=n(Al);Uh=l(Ly,"-e"),Ly.forEach(o),Gh=l(_r," flag."),_r.forEach(o),Lh=h(D),xl=s(D,"P",{});var Ny=n(xl);Nh=l(Ny,`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\u2019s the case make sure to install the Deep Learning framework you are working with
(PyTorch, TensorFlow and/or Flax) then do:`),Ny.forEach(o),Jh=h(D),y(Kt.$$.fragment,D),Zh=h(D),Ol=s(D,"P",{});var Jy=n(Ol);qh=l(Jy,"which should be enough for most use cases."),Jy.forEach(o),D.forEach(o),Dh=h(C),c=s(C,"LI",{});var p=n(c);Ul=s(p,"P",{});var Zy=n(Ul);Hh=l(Zy,"Develop the features on your branch."),Zy.forEach(o),Fh=h(p),Gl=s(p,"P",{});var qy=n(Gl);Yh=l(qy,`As you work on your code, you should make sure the test suite
passes. Run the tests impacted by your changes like this:`),qy.forEach(o),jh=h(p),y(eo.$$.fragment,p),Xh=h(p),to=s(p,"P",{});var Zn=n(to);Bh=l(Zn,`For more information about tests, check out the
`),oo=s(Zn,"A",{href:!0,rel:!0});var Dy=n(oo);Vh=l(Dy,"Testing"),Dy.forEach(o),zh=l(Zn," guide."),Zn.forEach(o),Qh=h(p),ke=s(p,"P",{});var Er=n(ke);Kh=l(Er,"\u{1F917} Transformers relies on "),Ll=s(Er,"CODE",{});var Hy=n(Ll);ef=l(Hy,"black"),Hy.forEach(o),tf=l(Er," and "),Nl=s(Er,"CODE",{});var Fy=n(Nl);of=l(Fy,"ruff"),Fy.forEach(o),rf=l(Er,` to format its source code
consistently. After you make changes, apply automatic style corrections and code verifications
that can\u2019t be automated in one go with:`),Er.forEach(o),lf=h(p),y(ro.$$.fragment,p),af=h(p),Jl=s(p,"P",{});var Yy=n(Jl);sf=l(Yy,"This target is also optimized to only work with files modified by the PR you\u2019re working on."),Yy.forEach(o),nf=h(p),Zl=s(p,"P",{});var jy=n(Zl);uf=l(jy,`If you prefer to run the checks one after the other, the following command applies the
style corrections:`),jy.forEach(o),hf=h(p),y(lo.$$.fragment,p),ff=h(p),ao=s(p,"P",{});var qn=n(ao);df=l(qn,"\u{1F917} Transformers also uses "),ql=s(qn,"CODE",{});var Xy=n(ql);cf=l(Xy,"ruff"),Xy.forEach(o),pf=l(qn,` and a few custom scripts to check for coding mistakes. Quality
controls are run by the CI, but you can run the same checks with:`),qn.forEach(o),mf=h(p),y(so.$$.fragment,p),yf=h(p),Dl=s(p,"P",{});var By=n(Dl);wf=l(By,`Finally, we have a lot of scripts to make sure we didn\u2019t forget to update
some files when adding a new model. You can run these scripts with:`),By.forEach(o),vf=h(p),y(no.$$.fragment,p),gf=h(p),io=s(p,"P",{});var Dn=n(io);bf=l(Dn,`To learn more about those checks and how to fix any issues with them, check out the
`),uo=s(Dn,"A",{href:!0,rel:!0});var Vy=n(uo);_f=l(Vy,"Checks on a Pull Request"),Vy.forEach(o),Ef=l(Dn," guide."),Dn.forEach(o),kf=h(p),ho=s(p,"P",{});var Hn=n(ho);$f=l(Hn,"If you\u2019re modifying documents under "),Hl=s(Hn,"CODE",{});var zy=n(Hl);Tf=l(zy,"docs/source"),zy.forEach(o),If=l(Hn,` directory, make sure the documentation can still be built. This check will also run in the CI when you open a pull request. To run a local check
make sure you install the documentation builder:`),Hn.forEach(o),Pf=h(p),y(fo.$$.fragment,p),Mf=h(p),Fl=s(p,"P",{});var Qy=n(Fl);Sf=l(Qy,"Run the following command from the root of the repository:"),Qy.forEach(o),Cf=h(p),y(co.$$.fragment,p),Rf=h(p),po=s(p,"P",{});var Fn=n(po);Wf=l(Fn,"This will build the documentation in the "),Yl=s(Fn,"CODE",{});var Ky=n(Yl);Af=l(Ky,"~/tmp/test-build"),Ky.forEach(o),xf=l(Fn,` folder where you can inspect the generated
Markdown files with your favorite editor. You can also preview the docs on GitHub when you open a pull request.`),Fn.forEach(o),Of=h(p),$e=s(p,"P",{});var kr=n($e);Uf=l(kr,"Once you\u2019re happy with your changes, add changed files with "),jl=s(kr,"CODE",{});var ew=n(jl);Gf=l(ew,"git add"),ew.forEach(o),Lf=l(kr,` and
record your changes locally with `),Xl=s(kr,"CODE",{});var tw=n(Xl);Nf=l(tw,"git commit"),tw.forEach(o),Jf=l(kr,":"),kr.forEach(o),Zf=h(p),y(mo.$$.fragment,p),qf=h(p),yo=s(p,"P",{});var Yn=n(yo);Df=l(Yn,"Please remember to write "),wo=s(Yn,"A",{href:!0,rel:!0});var ow=n(wo);Hf=l(ow,`good commit
messages`),ow.forEach(o),Ff=l(Yn," to clearly communicate the changes you made!"),Yn.forEach(o),Yf=h(p),Te=s(p,"P",{});var $r=n(Te);jf=l($r,`To keep your copy of the code up to date with the original
repository, rebase your branch on `),Bl=s($r,"CODE",{});var rw=n(Bl);Xf=l(rw,"upstream/branch"),rw.forEach(o),Bf=h($r),Vl=s($r,"EM",{});var lw=n(Vl);Vf=l(lw,"before"),lw.forEach(o),zf=l($r," you open a pull request or if requested by a maintainer:"),$r.forEach(o),Qf=h(p),y(vo.$$.fragment,p),Kf=h(p),zl=s(p,"P",{});var aw=n(zl);ed=l(aw,"Push your changes to your branch:"),aw.forEach(o),td=h(p),y(go.$$.fragment,p),od=h(p),bo=s(p,"P",{});var jn=n(bo);rd=l(jn,"If you\u2019ve already opened a pull request, you\u2019ll need to force push with the "),Ql=s(jn,"CODE",{});var sw=n(Ql);ld=l(sw,"--force"),sw.forEach(o),ad=l(jn," flag. Otherwise, if the pull request hasn\u2019t been opened yet, you can just push your changes normally."),jn.forEach(o),p.forEach(o),sd=h(C),Kl=s(C,"LI",{});var nw=n(Kl);Ie=s(nw,"P",{});var Tr=n(Ie);nd=l(Tr,"Now you can go to your fork of the repository on GitHub and click on "),ea=s(Tr,"STRONG",{});var iw=n(ea);id=l(iw,"Pull request"),iw.forEach(o),ud=l(Tr," to open a pull request. Make sure you tick off all the boxes in our "),_o=s(Tr,"A",{href:!0,rel:!0});var uw=n(_o);hd=l(uw,"checklist"),uw.forEach(o),fd=l(Tr," below. When you\u2019re ready, you can send your changes to the project maintainers for review."),Tr.forEach(o),nw.forEach(o),dd=h(C),ta=s(C,"LI",{});var hw=n(ta);oa=s(hw,"P",{});var fw=n(oa);cd=l(fw,`It\u2019s ok if maintainers request changes, it happens to our core contributors
too! So everyone can see the changes in the pull request, work in your local
branch and push the changes to your fork. They will automatically appear in
the pull request.`),fw.forEach(o),hw.forEach(o),C.forEach(o),Ls=h(t),Pe=s(t,"H3",{class:!0});var Xn=n(Pe);ze=s(Xn,"A",{id:!0,class:!0,href:!0});var dw=n(ze);ra=s(dw,"SPAN",{});var cw=n(ra);y(Eo.$$.fragment,cw),cw.forEach(o),dw.forEach(o),pd=h(Xn),la=s(Xn,"SPAN",{});var pw=n(la);md=l(pw,"Pull request checklist"),pw.forEach(o),Xn.forEach(o),Ns=h(t),P=s(t,"P",{});var F=n(P);yd=l(F,"\u2610 The pull request title should summarize your contribution."),wd=s(F,"BR",{}),vd=l(F,`
\u2610 If your pull request addresses an issue, please mention the issue number in the pull
request description to make sure they are linked (and people viewing the issue know you
are working on it).`),gd=s(F,"BR",{}),bd=l(F,`
\u2610 To indicate a work in progress please prefix the title with `),aa=s(F,"CODE",{});var mw=n(aa);_d=l(mw,"[WIP]"),mw.forEach(o),Ed=l(F,`. These are
useful to avoid duplicated work, and to differentiate it from PRs ready to be merged.
\u2610 Make sure existing tests pass.`),kd=s(F,"BR",{}),$d=l(F,`
\u2610 If adding a new feature, also add tests for it.`),Td=s(F,"BR",{}),F.forEach(o),Js=h(t),V=s(t,"UL",{});var Ir=n(V);ko=s(Ir,"LI",{});var Bn=n(ko);Id=l(Bn,`If you are adding a new model, make sure you use
`),sa=s(Bn,"CODE",{});var yw=n(sa);Pd=l(yw,"ModelTester.all_model_classes = (MyModel, MyModelWithLMHead,...)"),yw.forEach(o),Md=l(Bn," to trigger the common tests."),Bn.forEach(o),Sd=h(Ir),Me=s(Ir,"LI",{});var Pr=n(Me);Cd=l(Pr,"If you are adding new "),na=s(Pr,"CODE",{});var ww=n(na);Rd=l(ww,"@slow"),ww.forEach(o),Wd=l(Pr,` tests, make sure they pass using
`),ia=s(Pr,"CODE",{});var vw=n(ia);Ad=l(vw,"RUN_SLOW=1 python -m pytest tests/models/my_new_model/test_my_new_model.py"),vw.forEach(o),xd=l(Pr,"."),Pr.forEach(o),Od=h(Ir),Qe=s(Ir,"LI",{});var za=n(Qe);Ud=l(za,`If you are adding a new tokenizer, write tests and make sure
`),ua=s(za,"CODE",{});var gw=n(ua);Gd=l(gw,"RUN_SLOW=1 python -m pytest tests/models/{your_model_name}/test_tokenization_{your_model_name}.py"),gw.forEach(o),Ld=l(za,` passes.
CircleCI does not run the slow tests, but GitHub Actions does every night!`),Nd=s(za,"BR",{}),za.forEach(o),Ir.forEach(o),Zs=h(t),S=s(t,"P",{});var ae=n(S);Jd=l(ae,`\u2610 All public methods must have informative docstrings (see
`),$o=s(ae,"A",{href:!0,rel:!0});var bw=n($o);ha=s(bw,"CODE",{});var _w=n(ha);Zd=l(_w,"modeling_bert.py"),_w.forEach(o),bw.forEach(o),qd=l(ae,`
for an example).`),Dd=s(ae,"BR",{}),Hd=l(ae,`
\u2610 Due to the rapidly growing repository, don\u2019t add any images, videos and other
non-text files that\u2019ll significantly weigh down the repository. Instead, use a Hub
repository such as `),To=s(ae,"A",{href:!0,rel:!0});var Ew=n(To);fa=s(Ew,"CODE",{});var kw=n(fa);Fd=l(kw,"hf-internal-testing"),kw.forEach(o),Ew.forEach(o),Yd=l(ae,`
to host these files and reference them by URL. We recommend placing documentation
related images in the following repository:
`),Io=s(ae,"A",{href:!0,rel:!0});var $w=n(Io);jd=l($w,"huggingface/documentation-images"),$w.forEach(o),Xd=l(ae,`.
You can open a PR on this dataset repostitory and ask a Hugging Face member to merge it.`),ae.forEach(o),qs=h(t),Ke=s(t,"P",{});var Vn=n(Ke);Bd=l(Vn,"For more information about the checks run on a pull request, take a look at our "),Po=s(Vn,"A",{href:!0,rel:!0});var Tw=n(Po);Vd=l(Tw,"Checks on a Pull Request"),Tw.forEach(o),zd=l(Vn," guide."),Vn.forEach(o),Ds=h(t),Se=s(t,"H3",{class:!0});var zn=n(Se);et=s(zn,"A",{id:!0,class:!0,href:!0});var Iw=n(et);da=s(Iw,"SPAN",{});var Pw=n(da);y(Mo.$$.fragment,Pw),Pw.forEach(o),Iw.forEach(o),Qd=h(zn),ca=s(zn,"SPAN",{});var Mw=n(ca);Kd=l(Mw,"Tests"),Mw.forEach(o),zn.forEach(o),Hs=h(t),z=s(t,"P",{});var Mr=n(z);ec=l(Mr,`An extensive test suite is included to test the library behavior and several examples. Library tests can be found in
the `),So=s(Mr,"A",{href:!0,rel:!0});var Sw=n(So);tc=l(Sw,"tests"),Sw.forEach(o),oc=l(Mr,` folder and examples tests in the
`),Co=s(Mr,"A",{href:!0,rel:!0});var Cw=n(Co);rc=l(Cw,"examples"),Cw.forEach(o),lc=l(Mr," folder."),Mr.forEach(o),Fs=h(t),L=s(t,"P",{});var ct=n(L);ac=l(ct,"We like "),pa=s(ct,"CODE",{});var Rw=n(pa);sc=l(Rw,"pytest"),Rw.forEach(o),nc=l(ct," and "),ma=s(ct,"CODE",{});var Ww=n(ma);ic=l(Ww,"pytest-xdist"),Ww.forEach(o),uc=l(ct,` because it\u2019s faster. From the root of the
repository, specify a `),ya=s(ct,"EM",{});var Aw=n(ya);hc=l(Aw,"path to a subfolder or a test file"),Aw.forEach(o),fc=l(ct," to run the test."),ct.forEach(o),Ys=h(t),y(Ro.$$.fragment,t),js=h(t),N=s(t,"P",{});var pt=n(N);dc=l(pt,"Similarly, for the "),wa=s(pt,"CODE",{});var xw=n(wa);cc=l(xw,"examples"),xw.forEach(o),pc=l(pt," directory, specify a "),va=s(pt,"EM",{});var Ow=n(va);mc=l(Ow,"path to a subfolder or test file"),Ow.forEach(o),yc=l(pt," to run the test. For example, the following command tests the text classification subfolder in the PyTorch "),ga=s(pt,"CODE",{});var Uw=n(ga);wc=l(Uw,"examples"),Uw.forEach(o),vc=l(pt," directory:"),pt.forEach(o),Xs=h(t),y(Wo.$$.fragment,t),Bs=h(t),J=s(t,"P",{});var mt=n(J);gc=l(mt,"In fact, this is actually how our "),ba=s(mt,"CODE",{});var Gw=n(ba);bc=l(Gw,"make test"),Gw.forEach(o),_c=l(mt," and "),_a=s(mt,"CODE",{});var Lw=n(_a);Ec=l(Lw,"make test-examples"),Lw.forEach(o),kc=l(mt," commands are implemented (not including the "),Ea=s(mt,"CODE",{});var Nw=n(Ea);$c=l(Nw,"pip install"),Nw.forEach(o),Tc=l(mt,")!"),mt.forEach(o),Vs=h(t),ir=s(t,"P",{});var Jw=n(ir);Ic=l(Jw,`You can also specify a smaller set of tests in order to test only the feature
you\u2019re working on.`),Jw.forEach(o),zs=h(t),Q=s(t,"P",{});var Sr=n(Q);Pc=l(Sr,"By default, slow tests are skipped but you can set the "),ka=s(Sr,"CODE",{});var Zw=n(ka);Mc=l(Zw,"RUN_SLOW"),Zw.forEach(o),Sc=l(Sr,` environment variable to
`),$a=s(Sr,"CODE",{});var qw=n($a);Cc=l(qw,"yes"),qw.forEach(o),Rc=l(Sr,` to run them. This will download many gigabytes of models so make sure you
have enough disk space, a good internet connection or a lot of patience!`),Sr.forEach(o),Qs=h(t),y(tt.$$.fragment,t),Ks=h(t),y(Ao.$$.fragment,t),en=h(t),ur=s(t,"P",{});var Dw=n(ur);Wc=l(Dw,"Like the slow tests, there are other environment variables available which not enabled by default during testing:"),Dw.forEach(o),tn=h(t),K=s(t,"UL",{});var Cr=n(K);hr=s(Cr,"LI",{});var Vp=n(hr);Ta=s(Vp,"CODE",{});var Hw=n(Ta);Ac=l(Hw,"RUN_CUSTOM_TOKENIZERS"),Hw.forEach(o),xc=l(Vp,": Enables tests for custom tokenizers."),Vp.forEach(o),Oc=h(Cr),fr=s(Cr,"LI",{});var zp=n(fr);Ia=s(zp,"CODE",{});var Fw=n(Ia);Uc=l(Fw,"RUN_PT_FLAX_CROSS_TESTS"),Fw.forEach(o),Gc=l(zp,": Enables tests for PyTorch + Flax integration."),zp.forEach(o),Lc=h(Cr),dr=s(Cr,"LI",{});var Qp=n(dr);Pa=s(Qp,"CODE",{});var Yw=n(Pa);Nc=l(Yw,"RUN_PT_TF_CROSS_TESTS"),Yw.forEach(o),Jc=l(Qp,": Enables tests for TensorFlow + PyTorch integration."),Qp.forEach(o),Cr.forEach(o),on=h(t),ot=s(t,"P",{});var Qn=n(ot);Zc=l(Qn,"More environment variables and additional information can be found in the "),cr=s(Qn,"A",{href:!0});var jw=n(cr);qc=l(jw,"testing_utils.py"),jw.forEach(o),Dc=l(Qn,"."),Qn.forEach(o),rn=h(t),ee=s(t,"P",{});var Rr=n(ee);Hc=l(Rr,"\u{1F917} Transformers uses "),Ma=s(Rr,"CODE",{});var Xw=n(Ma);Fc=l(Xw,"pytest"),Xw.forEach(o),Yc=l(Rr,` as a test runner only. It doesn\u2019t use any
`),Sa=s(Rr,"CODE",{});var Bw=n(Sa);jc=l(Bw,"pytest"),Bw.forEach(o),Xc=l(Rr,"-specific features in the test suite itself."),Rr.forEach(o),ln=h(t),te=s(t,"P",{});var Wr=n(te);Bc=l(Wr,"This means "),Ca=s(Wr,"CODE",{});var Vw=n(Ca);Vc=l(Vw,"unittest"),Vw.forEach(o),zc=l(Wr,` is fully supported. Here\u2019s how to run tests with
`),Ra=s(Wr,"CODE",{});var zw=n(Ra);Qc=l(zw,"unittest"),zw.forEach(o),Kc=l(Wr,":"),Wr.forEach(o),an=h(t),y(xo.$$.fragment,t),sn=h(t),Ce=s(t,"H3",{class:!0});var Kn=n(Ce);rt=s(Kn,"A",{id:!0,class:!0,href:!0});var Qw=n(rt);Wa=s(Qw,"SPAN",{});var Kw=n(Wa);y(Oo.$$.fragment,Kw),Kw.forEach(o),Qw.forEach(o),ep=h(Kn),Aa=s(Kn,"SPAN",{});var ev=n(Aa);tp=l(ev,"Style guide"),ev.forEach(o),Kn.forEach(o),nn=h(t),oe=s(t,"P",{});var Ar=n(oe);op=l(Ar,"For documentation strings, \u{1F917} Transformers follows the "),Uo=s(Ar,"A",{href:!0,rel:!0});var tv=n(Uo);rp=l(tv,"Google Python Style Guide"),tv.forEach(o),lp=l(Ar,`.
Check our `),Go=s(Ar,"A",{href:!0,rel:!0});var ov=n(Go);ap=l(ov,"documentation writing guide"),ov.forEach(o),sp=l(Ar,`
for more information.`),Ar.forEach(o),un=h(t),Re=s(t,"H3",{class:!0});var ei=n(Re);lt=s(ei,"A",{id:!0,class:!0,href:!0});var rv=n(lt);xa=s(rv,"SPAN",{});var lv=n(xa);y(Lo.$$.fragment,lv),lv.forEach(o),rv.forEach(o),np=h(ei),Oa=s(ei,"SPAN",{});var av=n(Oa);ip=l(av,"Develop on Windows"),av.forEach(o),ei.forEach(o),hn=h(t),Z=s(t,"P",{});var yt=n(Z);up=l(yt,"On Windows (unless you\u2019re working in "),No=s(yt,"A",{href:!0,rel:!0});var sv=n(No);hp=l(sv,"Windows Subsystem for Linux"),sv.forEach(o),fp=l(yt," or WSL), you need to configure git to transform Windows "),Ua=s(yt,"CODE",{});var nv=n(Ua);dp=l(nv,"CRLF"),nv.forEach(o),cp=l(yt," line endings to Linux "),Ga=s(yt,"CODE",{});var iv=n(Ga);pp=l(iv,"LF"),iv.forEach(o),mp=l(yt," line endings:"),yt.forEach(o),fn=h(t),y(Jo.$$.fragment,t),dn=h(t),at=s(t,"P",{});var ti=n(at);yp=l(ti,"One way to run the "),La=s(ti,"CODE",{});var uv=n(La);wp=l(uv,"make"),uv.forEach(o),vp=l(ti," command on Windows is with MSYS2:"),ti.forEach(o),cn=h(t),q=s(t,"OL",{});var wt=n(q);st=s(wt,"LI",{});var Qa=n(st);Zo=s(Qa,"A",{href:!0,rel:!0});var hv=n(Zo);gp=l(hv,"Download MSYS2"),hv.forEach(o),bp=l(Qa,", and we assume it\u2019s installed in "),Na=s(Qa,"CODE",{});var fv=n(Na);_p=l(fv,"C:\\msys64"),fv.forEach(o),Ep=l(Qa,"."),Qa.forEach(o),kp=h(wt),We=s(wt,"LI",{});var xr=n(We);$p=l(xr,"Open the command line "),Ja=s(xr,"CODE",{});var dv=n(Ja);Tp=l(dv,"C:\\msys64\\msys2.exe"),dv.forEach(o),Ip=l(xr," (it should be available from the "),Za=s(xr,"STRONG",{});var cv=n(Za);Pp=l(cv,"Start"),cv.forEach(o),Mp=l(xr," menu)."),xr.forEach(o),Sp=h(wt),H=s(wt,"LI",{});var vt=n(H);Cp=l(vt,"Run in the shell: "),qa=s(vt,"CODE",{});var pv=n(qa);Rp=l(pv,"pacman -Syu"),pv.forEach(o),Wp=l(vt," and install "),Da=s(vt,"CODE",{});var mv=n(Da);Ap=l(mv,"make"),mv.forEach(o),xp=l(vt," with "),Ha=s(vt,"CODE",{});var yv=n(Ha);Op=l(yv,"pacman -S make"),yv.forEach(o),Up=l(vt,"."),vt.forEach(o),Gp=h(wt),qo=s(wt,"LI",{});var oi=n(qo);Lp=l(oi,"Add "),Fa=s(oi,"CODE",{});var wv=n(Fa);Np=l(wv,"C:\\msys64\\usr\\bin"),wv.forEach(o),Jp=l(oi," to your PATH environment variable."),oi.forEach(o),wt.forEach(o),pn=h(t),nt=s(t,"P",{});var ri=n(nt);Zp=l(ri,"You can now use "),Ya=s(ri,"CODE",{});var vv=n(Ya);qp=l(vv,"make"),vv.forEach(o),Dp=l(ri," from any terminal (Powershell, cmd.exe, etc.)! \u{1F389}"),ri.forEach(o),mn=h(t),Ae=s(t,"H3",{class:!0});var li=n(Ae);it=s(li,"A",{id:!0,class:!0,href:!0});var gv=n(it);ja=s(gv,"SPAN",{});var bv=n(ja);y(Do.$$.fragment,bv),bv.forEach(o),gv.forEach(o),Hp=h(li),Xa=s(li,"SPAN",{});var _v=n(Xa);Fp=l(_v,"Sync a forked repository with upstream main (the Hugging Face repository)"),_v.forEach(o),li.forEach(o),yn=h(t),pr=s(t,"P",{});var Ev=n(pr);Yp=l(Ev,"When updating the main branch of a forked repository, please follow these steps to avoid pinging the upstream repository which adds reference notes to each upstream PR, and sends unnecessary notifications to the developers involved in these PRs."),Ev.forEach(o),wn=h(t),ut=s(t,"OL",{});var ai=n(ut);Ba=s(ai,"LI",{});var kv=n(Ba);jp=l(kv,"When possible, avoid syncing with the upstream using a branch and PR on the forked repository. Instead, merge directly into the forked main."),kv.forEach(o),Xp=h(ai),Va=s(ai,"LI",{});var $v=n(Va);Bp=l($v,"If a PR is absolutely necessary, use the following steps after checking out your branch:"),$v.forEach(o),ai.forEach(o),vn=h(t),y(Ho.$$.fragment,t),this.h()},h(){d(_,"name","hf:doc:metadata"),d(_,"content",JSON.stringify(Av)),d(x,"id","contribute-to-transformers"),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","#contribute-to-transformers"),d($,"class","relative group"),d(_t,"href","https://github.com/huggingface/transformers/blob/main/CODE_OF_CONDUCT.md"),d(_t,"rel","nofollow"),d(kt,"href","https://github.com/scikit-learn/scikit-learn/blob/main/CONTRIBUTING.md"),d(kt,"rel","nofollow"),d(Ge,"id","ways-to-contribute"),d(Ge,"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(Ge,"href","#ways-to-contribute"),d(fe,"class","relative group"),d(Tt,"href","https://github.com/huggingface/transformers/contribute"),d(Tt,"rel","nofollow"),d(It,"href","https://github.com/huggingface/transformers/labels/Good%20Second%20Issue"),d(It,"rel","nofollow"),d(Je,"id","fixing-outstanding-issues"),d(Je,"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(Je,"href","#fixing-outstanding-issues"),d(de,"class","relative group"),d(Mt,"href","https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md/#create-a-pull-request"),d(Mt,"rel","nofollow"),d(qe,"id","submitting-a-bugrelated-issue-or-feature-request"),d(qe,"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(qe,"href","#submitting-a-bugrelated-issue-or-feature-request"),d(ce,"class","relative group"),d(De,"id","did-you-find-a-bug"),d(De,"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(De,"href","#did-you-find-a-bug"),d(pe,"class","relative group"),d(Rt,"href","https://discuss.huggingface.co/"),d(Rt,"rel","nofollow"),d(He,"id","do-you-want-a-new-feature"),d(He,"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(He,"href","#do-you-want-a-new-feature"),d(me,"class","relative group"),d(Nt,"href","https://github.com/huggingface/transformers/tree/main/templates"),d(Nt,"rel","nofollow"),d(Ye,"id","do-you-want-to-implement-a-new-model"),d(Ye,"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(Ye,"href","#do-you-want-to-implement-a-new-model"),d(ye,"class","relative group"),d(Zt,"href","https://github.com/huggingface/transformers/tree/main/templates"),d(Zt,"rel","nofollow"),d(qt,"href","https://huggingface.co/docs/transformers/add_new_model"),d(qt,"rel","nofollow"),d(je,"id","do-you-want-to-add-documentation"),d(je,"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(je,"href","#do-you-want-to-add-documentation"),d(we,"class","relative group"),d(Ht,"href","https://github.com/huggingface/transformers/tree/main/docs"),d(Ht,"rel","nofollow"),d(Be,"id","create-a-pull-request"),d(Be,"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(Be,"href","#create-a-pull-request"),d(ve,"class","relative group"),d(Yt,"href","https://git-scm.com/book/en/v2"),d(Yt,"rel","nofollow"),d(nr,"href","(https://github.com/huggingface/transformers/blob/main/setup.py#L426)"),d(jt,"href","https://github.com/huggingface/transformers"),d(jt,"rel","nofollow"),d(Xt,"href","https://github.com/huggingface/transformers/fork"),d(Xt,"rel","nofollow"),d(oo,"href","https://huggingface.co/docs/transformers/testing"),d(oo,"rel","nofollow"),d(uo,"href","https://huggingface.co/docs/transformers/pr_checks"),d(uo,"rel","nofollow"),d(wo,"href","https://chris.beams.io/posts/git-commit/"),d(wo,"rel","nofollow"),d(_o,"href","https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md/#pull-request-checklist"),d(_o,"rel","nofollow"),d(ze,"id","pull-request-checklist"),d(ze,"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(ze,"href","#pull-request-checklist"),d(Pe,"class","relative group"),d($o,"href","https://github.com/huggingface/transformers/blob/main/src/transformers/models/bert/modeling_bert.py"),d($o,"rel","nofollow"),d(To,"href","https://huggingface.co/hf-internal-testing"),d(To,"rel","nofollow"),d(Io,"href","https://huggingface.co/datasets/huggingface/documentation-images"),d(Io,"rel","nofollow"),d(Po,"href","https://huggingface.co/docs/transformers/pr_checks"),d(Po,"rel","nofollow"),d(et,"id","tests"),d(et,"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(et,"href","#tests"),d(Se,"class","relative group"),d(So,"href","https://github.com/huggingface/transformers/tree/main/tests"),d(So,"rel","nofollow"),d(Co,"href","https://github.com/huggingface/transformers/tree/main/examples"),d(Co,"rel","nofollow"),d(cr,"href","src/transformers/testing_utils.py"),d(rt,"id","style-guide"),d(rt,"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(rt,"href","#style-guide"),d(Ce,"class","relative group"),d(Uo,"href","https://google.github.io/styleguide/pyguide.html"),d(Uo,"rel","nofollow"),d(Go,"href","https://github.com/huggingface/transformers/tree/main/docs#writing-documentation---specification"),d(Go,"rel","nofollow"),d(lt,"id","develop-on-windows"),d(lt,"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(lt,"href","#develop-on-windows"),d(Re,"class","relative group"),d(No,"href","https://learn.microsoft.com/en-us/windows/wsl/"),d(No,"rel","nofollow"),d(Zo,"href","https://www.msys2.org/"),d(Zo,"rel","nofollow"),d(it,"id","sync-a-forked-repository-with-upstream-main-the-hugging-face-repository"),d(it,"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(it,"href","#sync-a-forked-repository-with-upstream-main-the-hugging-face-repository"),d(Ae,"class","relative group")},m(t,i){e(document.head,_),f(t,xe,i),f(t,$,i),e($,x),e(x,se),w(W,se,null),e($,gt),e($,ne),e(ne,ie),f(t,Oe,i),f(t,Y,i),e(Y,ue),f(t,T,i),f(t,he,i),e(he,Yo),f(t,bt,i),f(t,Ue,i),e(Ue,si),e(Ue,_t),e(_t,ni),e(Ue,ii),f(t,es,i),f(t,jo,i),e(jo,Et),e(Et,ui),e(Et,kt),e(kt,hi),e(Et,fi),f(t,ts,i),f(t,fe,i),e(fe,Ge),e(Ge,Or),w($t,Or,null),e(fe,di),e(fe,Ur),e(Ur,ci),f(t,os,i),f(t,Xo,i),e(Xo,pi),f(t,rs,i),f(t,O,i),e(O,Gr),e(Gr,mi),e(O,yi),e(O,Lr),e(Lr,wi),e(O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oe,Uo),e(Uo,rp),e(oe,lp),e(oe,Go),e(Go,ap),e(oe,sp),f(t,un,i),f(t,Re,i),e(Re,lt),e(lt,xa),w(Lo,xa,null),e(Re,np),e(Re,Oa),e(Oa,ip),f(t,hn,i),f(t,Z,i),e(Z,up),e(Z,No),e(No,hp),e(Z,fp),e(Z,Ua),e(Ua,dp),e(Z,cp),e(Z,Ga),e(Ga,pp),e(Z,mp),f(t,fn,i),w(Jo,t,i),f(t,dn,i),f(t,at,i),e(at,yp),e(at,La),e(La,wp),e(at,vp),f(t,cn,i),f(t,q,i),e(q,st),e(st,Zo),e(Zo,gp),e(st,bp),e(st,Na),e(Na,_p),e(st,Ep),e(q,kp),e(q,We),e(We,$p),e(We,Ja),e(Ja,Tp),e(We,Ip),e(We,Za),e(Za,Pp),e(We,Mp),e(q,Sp),e(q,H),e(H,Cp),e(H,qa),e(qa,Rp),e(H,Wp),e(H,Da),e(Da,Ap),e(H,xp),e(H,Ha),e(Ha,Op),e(H,Up),e(q,Gp),e(q,qo),e(qo,Lp),e(qo,Fa),e(Fa,Np),e(qo,Jp),f(t,pn,i),f(t,nt,i),e(nt,Zp),e(nt,Ya),e(Ya,qp),e(nt,Dp),f(t,mn,i),f(t,Ae,i),e(Ae,it),e(it,ja),w(Do,ja,null),e(Ae,Hp),e(Ae,Xa),e(Xa,Fp),f(t,yn,i),f(t,pr,i),e(pr,Yp),f(t,wn,i),f(t,ut,i),e(ut,Ba),e(Ba,jp),e(ut,Xp),e(ut,Va),e(Va,Bp),f(t,vn,i),w(Ho,t,i),gn=!0},p(t,[i]){const Fo={};i&2&&(Fo.$$scope={dirty:i,ctx:t}),tt.$set(Fo)},i(t){gn||(v(W.$$.fragment,t),v($t.$$.fragment,t),v(Pt.$$.fragment,t),v(St.$$.fragment,t),v(Ct.$$.fragment,t),v(At.$$.fragment,t),v(xt.$$.fragment,t),v(Ot.$$.fragment,t),v(Jt.$$.fragment,t),v(Dt.$$.fragment,t),v(Ft.$$.fragment,t),v(Vt.$$.fragment,t),v(zt.$$.fragment,t),v(Qt.$$.fragment,t),v(Kt.$$.fragment,t),v(eo.$$.fragment,t),v(ro.$$.fragment,t),v(lo.$$.fragment,t),v(so.$$.fragment,t),v(no.$$.fragment,t),v(fo.$$.fragment,t),v(co.$$.fragment,t),v(mo.$$.fragment,t),v(vo.$$.fragment,t),v(go.$$.fragment,t),v(Eo.$$.fragment,t),v(Mo.$$.fragment,t),v(Ro.$$.fragment,t),v(Wo.$$.fragment,t),v(tt.$$.fragment,t),v(Ao.$$.fragment,t),v(xo.$$.fragment,t),v(Oo.$$.fragment,t),v(Lo.$$.fragment,t),v(Jo.$$.fragment,t),v(Do.$$.fragment,t),v(Ho.$$.fragment,t),gn=!0)},o(t){g(W.$$.fragment,t),g($t.$$.fragment,t),g(Pt.$$.fragment,t),g(St.$$.fragment,t),g(Ct.$$.fragment,t),g(At.$$.fragment,t),g(xt.$$.fragment,t),g(Ot.$$.fragment,t),g(Jt.$$.fragment,t),g(Dt.$$.fragment,t),g(Ft.$$.fragment,t),g(Vt.$$.fragment,t),g(zt.$$.fragment,t),g(Qt.$$.fragment,t),g(Kt.$$.fragment,t),g(eo.$$.fragment,t),g(ro.$$.fragment,t),g(lo.$$.fragment,t),g(so.$$.fragment,t),g(no.$$.fragment,t),g(fo.$$.fragment,t),g(co.$$.fragment,t),g(mo.$$.fragment,t),g(vo.$$.fragment,t),g(go.$$.fragment,t),g(Eo.$$.fragment,t),g(Mo.$$.fragment,t),g(Ro.$$.fragment,t),g(Wo.$$.fragment,t),g(tt.$$.fragment,t),g(Ao.$$.fragment,t),g(xo.$$.fragment,t),g(Oo.$$.fragment,t),g(Lo.$$.fragment,t),g(Jo.$$.fragment,t),g(Do.$$.fragment,t),g(Ho.$$.fragment,t),gn=!1},d(t){o(_),t&&o(xe),t&&o($),b(W),t&&o(Oe),t&&o(Y),t&&o(T),t&&o(he),t&&o(bt),t&&o(Ue),t&&o(es),t&&o(jo),t&&o(ts),t&&o(fe),b($t),t&&o(os),t&&o(Xo),t&&o(rs),t&&o(O),t&&o(ls),t&&o(Le),t&&o(as),t&&o(Ne),t&&o(ss),t&&o(Bo),t&&o(ns),t&&o(de),b(Pt),t&&o(is),t&&o(Ze),t&&o(us),t&&o(ce),b(St),t&&o(hs),t&&o(Vo),t&&o(fs),t&&o(pe),b(Ct),t&&o(ds),t&&o(zo),t&&o(cs),t&&o(j),t&&o(ps),t&&o(Qo),t&&o(ms),t&&o(U),t&&o(ys),t&&o(Ko),t&&o(ws),b(At,t),t&&o(vs),t&&o(er),t&&o(gs),b(xt,t),t&&o(bs),t&&o(me),b(Ot),t&&o(_s),t&&o(tr),t&&o(Es),t&&o(G),t&&o(ks),t&&o(or),t&&o($s),t&&o(Fe),t&&o(Ts),t&&o(ye),b(Jt),t&&o(Is),t&&o(rr),t&&o(Ps),t&&o(X),t&&o(Ms),t&&o(lr),t&&o(Ss),t&&o(B),t&&o(Cs),t&&o(we),b(Dt),t&&o(Rs),t&&o(ar),t&&o(Ws),t&&o(Xe),t&&o(As),t&&o(ve),b(Ft),t&&o(xs),t&&o(sr),t&&o(Os),t&&o(M),t&&o(Us),t&&o(Ve),t&&o(Gs),t&&o(k),b(Vt),b(zt),b(Qt),b(Kt),b(eo),b(ro),b(lo),b(so),b(no),b(fo),b(co),b(mo),b(vo),b(go),t&&o(Ls),t&&o(Pe),b(Eo),t&&o(Ns),t&&o(P),t&&o(Js),t&&o(V),t&&o(Zs),t&&o(S),t&&o(qs),t&&o(Ke),t&&o(Ds),t&&o(Se),b(Mo),t&&o(Hs),t&&o(z),t&&o(Fs),t&&o(L),t&&o(Ys),b(Ro,t),t&&o(js),t&&o(N),t&&o(Xs),b(Wo,t),t&&o(Bs),t&&o(J),t&&o(Vs),t&&o(ir),t&&o(zs),t&&o(Q),t&&o(Qs),b(tt,t),t&&o(Ks),b(Ao,t),t&&o(en),t&&o(ur),t&&o(tn),t&&o(K),t&&o(on),t&&o(ot),t&&o(rn),t&&o(ee),t&&o(ln),t&&o(te),t&&o(an),b(xo,t),t&&o(sn),t&&o(Ce),b(Oo),t&&o(nn),t&&o(oe),t&&o(un),t&&o(Re),b(Lo),t&&o(hn),t&&o(Z),t&&o(fn),b(Jo,t),t&&o(dn),t&&o(at),t&&o(cn),t&&o(q),t&&o(pn),t&&o(nt),t&&o(mn),t&&o(Ae),b(Do),t&&o(yn),t&&o(pr),t&&o(wn),t&&o(ut),t&&o(vn),b(Ho,t)}}}const Av={local:"contribute-to-transformers",sections:[{local:"ways-to-contribute",title:"Ways to contribute"},{local:"fixing-outstanding-issues",title:"Fixing outstanding issues"},{local:"submitting-a-bugrelated-issue-or-feature-request",sections:[{local:"did-you-find-a-bug",title:"Did you find a bug?"},{local:"do-you-want-a-new-feature",title:"Do you want a new feature?"}],title:"Submitting a bug-related issue or feature request"},{local:"do-you-want-to-implement-a-new-model",title:"Do you want to implement a new model?"},{local:"do-you-want-to-add-documentation",title:"Do you want to add documentation?"},{local:"create-a-pull-request",sections:[{local:"pull-request-checklist",title:"Pull request checklist"},{local:"tests",title:"Tests"},{local:"style-guide",title:"Style guide"},{local:"develop-on-windows",title:"Develop on Windows"},{local:"sync-a-forked-repository-with-upstream-main-the-hugging-face-repository",title:"Sync a forked repository with upstream main (the Hugging Face repository)"}],title:"Create a Pull Request"}],title:"Contribute to \u{1F917} Transformers"};function xv(Ka){return Sv(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Nv extends Tv{constructor(_){super();Iv(this,_,xv,Wv,Pv,{})}}export{Nv as default,Av as metadata};
