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