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