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