import{S as qi,i as zi,s as Ui,e as l,k as p,w as u,t as n,M as Yi,c as r,d as o,m as h,a,x as v,h as s,b as m,N as Bi,G as t,g as f,y as _,q as $,o as w,B as g,v as Gi}from"../chunks/vendor-hf-doc-builder.js";import{T as Ar}from"../chunks/Tip-hf-doc-builder.js";import{I as $e}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as T}from"../chunks/CodeBlock-hf-doc-builder.js";function Wi(R){let c,P,d,b,k;return{c(){c=l("p"),P=n("You must keep the "),d=l("code"),b=n("transformers"),k=n(" folder if you want to keep using the library.")},l(y){c=r(y,"P",{});var E=a(c);P=s(E,"You must keep the "),d=r(E,"CODE",{});var A=a(d);b=s(A,"transformers"),A.forEach(o),k=s(E," folder if you want to keep using the library."),E.forEach(o)},m(y,E){f(y,c,E),t(c,P),t(c,d),t(d,b),t(c,k)},d(y){y&&o(c)}}}function Vi(R){let c,P,d,b,k,y,E,A,O,S,x;return{c(){c=l("p"),P=n("\u{1F917} Transformers will use the shell environment variables "),d=l("code"),b=n("PYTORCH_TRANSFORMERS_CACHE"),k=n(" or "),y=l("code"),E=n("PYTORCH_PRETRAINED_BERT_CACHE"),A=n(" if you are coming from an earlier iteration of this library and have set those environment variables, unless you specify the shell environment variable "),O=l("code"),S=n("TRANSFORMERS_CACHE"),x=n(".")},l(H){c=r(H,"P",{});var F=a(c);P=s(F,"\u{1F917} Transformers will use the shell environment variables "),d=r(F,"CODE",{});var U=a(d);b=s(U,"PYTORCH_TRANSFORMERS_CACHE"),U.forEach(o),k=s(F," or "),y=r(F,"CODE",{});var bt=a(y);E=s(bt,"PYTORCH_PRETRAINED_BERT_CACHE"),bt.forEach(o),A=s(F," if you are coming from an earlier iteration of this library and have set those environment variables, unless you specify the shell environment variable "),O=r(F,"CODE",{});var we=a(O);S=s(we,"TRANSFORMERS_CACHE"),we.forEach(o),x=s(F,"."),F.forEach(o)},m(H,F){f(H,c,F),t(c,P),t(c,d),t(d,b),t(c,k),t(c,y),t(y,E),t(c,A),t(c,O),t(O,S),t(c,x)},d(H){H&&o(c)}}}function Xi(R){let c,P,d,b,k,y,E,A;return{c(){c=l("p"),P=n("Add "),d=l("a"),b=n("\u{1F917} Datasets"),k=n(" to your offline training workflow by setting the environment variable "),y=l("code"),E=n("HF_DATASETS_OFFLINE=1"),A=n("."),this.h()},l(O){c=r(O,"P",{});var S=a(c);P=s(S,"Add "),d=r(S,"A",{href:!0,rel:!0});var x=a(d);b=s(x,"\u{1F917} Datasets"),x.forEach(o),k=s(S," to your offline training workflow by setting the environment variable "),y=r(S,"CODE",{});var H=a(y);E=s(H,"HF_DATASETS_OFFLINE=1"),H.forEach(o),A=s(S,"."),S.forEach(o),this.h()},h(){m(d,"href","https://huggingface.co/docs/datasets/"),m(d,"rel","nofollow")},m(O,S){f(O,c,S),t(c,P),t(c,d),t(d,b),t(c,k),t(c,y),t(y,E),t(c,A)},d(O){O&&o(c)}}}function Ji(R){let c,P,d,b,k;return{c(){c=l("p"),P=n("See the "),d=l("a"),b=n("How to download files from the Hub"),k=n(" section for more details on downloading files stored on the Hub."),this.h()},l(y){c=r(y,"P",{});var E=a(c);P=s(E,"See the "),d=r(E,"A",{href:!0,rel:!0});var A=a(d);b=s(A,"How to download files from the Hub"),A.forEach(o),k=s(E," section for more details on downloading files stored on the Hub."),E.forEach(o),this.h()},h(){m(d,"href","https://huggingface.co/docs/hub/how-to-downstream"),m(d,"rel","nofollow")},m(y,E){f(y,c,E),t(c,P),t(c,d),t(d,b),t(c,k)},d(y){y&&o(c)}}}function Ki(R){let c,P,d,b,k,y,E,A,O,S,x,H,F,U,bt,we,N,Tt,ge,Cr,Sr,Or,kt,ye,Fr,Ir,xr,Pt,Ee,Hr,jr,Xo,Y,te,so,be,Mr,io,Rr,Jo,D,Nr,Te,Dr,Lr,ke,qr,zr,Ko,At,Ur,Qo,Pe,Zo,Ct,Yr,el,Ae,tl,St,Br,ol,Ce,ll,Ot,Gr,rl,Se,al,Ft,Wr,nl,Oe,sl,It,Vr,il,Fe,fl,xt,Xr,pl,Ie,hl,Ht,Jr,ml,xe,cl,jt,Kr,dl,He,ul,B,oe,fo,je,Qr,po,Zr,vl,Mt,ea,_l,Me,$l,C,ta,ho,oa,la,mo,ra,aa,co,na,sa,uo,ia,fa,vo,pa,ha,Re,ma,ca,wl,Rt,da,gl,Ne,yl,G,le,_o,De,ua,$o,va,El,Nt,_a,bl,re,Le,$a,wo,wa,ga,ya,go,Ea,Tl,Dt,ba,kl,qe,Pl,L,Ta,yo,ka,Pa,Eo,Aa,Ca,Al,ae,Cl,Lt,Sa,Sl,ze,Ol,ne,Oa,bo,Fa,Ia,Fl,W,se,To,Ue,xa,ko,Ha,Il,ie,ja,Po,Ma,Ra,xl,Ye,Hl,V,fe,Ao,Be,Na,Co,Da,jl,j,La,So,qa,za,Oo,Ua,Ya,Fo,Ba,Ga,Ml,q,X,Wa,Io,Va,Xa,xo,Ja,Ka,Qa,Ge,Za,Ho,en,tn,on,J,ln,jo,rn,an,Mo,nn,sn,Rl,pe,Nl,K,he,Ro,We,fn,No,pn,Dl,me,hn,Do,mn,cn,Ll,ce,ql,qt,dn,zl,Ve,Ul,zt,un,Yl,Xe,Bl,Ut,vn,Gl,Q,de,Lo,Je,_n,qo,$n,Wl,Yt,wn,Vl,z,Ke,Qe,gn,Ze,yn,En,bn,zo,Bt,cs,Tn,et,Z,kn,Gt,Pn,An,Wt,Cn,Sn,On,ee,tt,ot,Fn,Vt,In,xn,Hn,lt,jn,rt,at,Mn,Xt,Rn,Nn,Dn,nt,Ln,st,it,qn,Jt,zn,Un,Yn,ft,Bn,pt,ht,Gn,mt,Wn,Vn,Xn,ct,dt,ut,Jn,Uo,Kn,Qn,Zn,vt,es,_t,M,ts,$t,Yo,os,ls,Bo,rs,as,wt,ns,ss,is,gt,Xl,Kt,fs,Jl,yt,Kl,ue,Ql;return y=new $e({}),be=new $e({}),Pe=new T({props:{code:"python -m venv .env",highlighted:'python -m venv .<span class="hljs-built_in">env</span>'}}),Ae=new T({props:{code:"source .env/bin/activate",highlighted:'<span class="hljs-built_in">source</span> .<span class="hljs-built_in">env</span>/bin/activate'}}),Ce=new T({props:{code:".env/Scripts/activate",highlighted:'.<span class="hljs-built_in">env</span>/Scripts/activate'}}),Se=new T({props:{code:"pip install transformers",highlighted:"pip install transformers"}}),Oe=new T({props:{code:"pip install transformers[torch]",highlighted:"pip install transformers[torch]"}}),Fe=new T({props:{code:"pip install transformers[tf-cpu]",highlighted:"pip install transformers[tf-cpu]"}}),Ie=new T({props:{code:"pip install transformers[flax]",highlighted:"pip install transformers[flax]"}}),xe=new T({props:{code:`python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))"`,highlighted:'python -c <span class="hljs-string">&quot;from transformers import pipeline; print(pipeline(&#x27;sentiment-analysis&#x27;)(&#x27;we love you&#x27;))&quot;</span>'}}),He=new T({props:{code:"[{'label': 'POSITIVE', 'score': 0.9998704791069031}]",highlighted:'[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: 0.9998704791069031}]'}}),je=new $e({}),Me=new T({props:{code:"pip install git+https://github.com/huggingface/transformers",highlighted:"pip install git+https://github.com/huggingface/transformers"}}),Ne=new T({props:{code:`python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I love you'))"`,highlighted:'python -c <span class="hljs-string">&quot;from transformers import pipeline; print(pipeline(&#x27;sentiment-analysis&#x27;)(&#x27;I love you&#x27;))&quot;</span>'}}),De=new $e({}),qe=new T({props:{code:`git clone https://github.com/huggingface/transformers.git
cd transformers
pip install -e .`,highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/transformers.git
<span class="hljs-built_in">cd</span> transformers
pip install -e .`}}),ae=new Ar({props:{warning:!0,$$slots:{default:[Wi]},$$scope:{ctx:R}}}),ze=new T({props:{code:`cd ~/transformers/
git pull`,highlighted:`<span class="hljs-built_in">cd</span> ~/transformers/
git pull`}}),Ue=new $e({}),Ye=new T({props:{code:"conda install -c huggingface transformers",highlighted:"conda install -c huggingface transformers"}}),Be=new $e({}),pe=new Ar({props:{$$slots:{default:[Vi]},$$scope:{ctx:R}}}),We=new $e({}),ce=new Ar({props:{$$slots:{default:[Xi]},$$scope:{ctx:R}}}),Ve=new T({props:{code:"python examples/pytorch/translation/run_translation.py --model_name_or_path t5-small --dataset_name wmt16 --dataset_config ro-en ...",highlighted:"python examples/pytorch/translation/run_translation.py --model_name_or_path t5-small --dataset_name wmt16 --dataset_config ro-en ..."}}),Xe=new T({props:{code:`HF_DATASETS_OFFLINE=1 TRANSFORMERS_OFFLINE=1 \\
python examples/pytorch/translation/run_translation.py --model_name_or_path t5-small --dataset_name wmt16 --dataset_config ro-en ...`,highlighted:`HF_DATASETS_OFFLINE=1 TRANSFORMERS_OFFLINE=1 \\
python examples/pytorch/translation/run_translation.py --model_name_or_path t5-small --dataset_name wmt16 --dataset_config ro-en ...`}}),Je=new $e({}),lt=new T({props:{code:`from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("bigscience/T0_3B")
model = AutoModelForSeq2SeqLM.from_pretrained("bigscience/T0_3B")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSeq2SeqLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bigscience/T0_3B&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;bigscience/T0_3B&quot;</span>)`}}),nt=new T({props:{code:`tokenizer.save_pretrained("./your/path/bigscience_t0")
model.save_pretrained("./your/path/bigscience_t0")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.save_pretrained(<span class="hljs-string">&quot;./your/path/bigscience_t0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.save_pretrained(<span class="hljs-string">&quot;./your/path/bigscience_t0&quot;</span>)`}}),ft=new T({props:{code:`tokenizer = AutoTokenizer.from_pretrained("./your/path/bigscience_t0")
model = AutoModel.from_pretrained("./your/path/bigscience_t0")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;./your/path/bigscience_t0&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;./your/path/bigscience_t0&quot;</span>)`}}),vt=new T({props:{code:"python -m pip install huggingface_hub",highlighted:"python -m pip install huggingface_hub"}}),gt=new T({props:{code:`from huggingface_hub import hf_hub_download

hf_hub_download(repo_id="bigscience/T0_3B", filename="config.json", cache_dir="./your/path/bigscience_t0")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

<span class="hljs-meta">&gt;&gt;&gt; </span>hf_hub_download(repo_id=<span class="hljs-string">&quot;bigscience/T0_3B&quot;</span>, filename=<span class="hljs-string">&quot;config.json&quot;</span>, cache_dir=<span class="hljs-string">&quot;./your/path/bigscience_t0&quot;</span>)`}}),yt=new T({props:{code:`from transformers import AutoConfig

config = AutoConfig.from_pretrained("./your/path/bigscience_t0/config.json")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>config = AutoConfig.from_pretrained(<span class="hljs-string">&quot;./your/path/bigscience_t0/config.json&quot;</span>)`}}),ue=new Ar({props:{$$slots:{default:[Ji]},$$scope:{ctx:R}}}),{c(){c=l("meta"),P=p(),d=l("h1"),b=l("a"),k=l("span"),u(y.$$.fragment),E=p(),A=l("span"),O=n("Installation"),S=p(),x=l("p"),H=n("Install \u{1F917} Transformers for whichever deep learning library you\u2019re working with, setup your cache, and optionally configure \u{1F917} Transformers to run offline."),F=p(),U=l("p"),bt=n("\u{1F917} Transformers is tested on Python 3.6+, PyTorch 1.1.0+, TensorFlow 2.0+, and Flax. Follow the installation instructions below for the deep learning library you are using:"),we=p(),N=l("ul"),Tt=l("li"),ge=l("a"),Cr=n("PyTorch"),Sr=n(" installation instructions."),Or=p(),kt=l("li"),ye=l("a"),Fr=n("TensorFlow 2.0"),Ir=n(" installation instructions."),xr=p(),Pt=l("li"),Ee=l("a"),Hr=n("Flax"),jr=n(" installation instructions."),Xo=p(),Y=l("h2"),te=l("a"),so=l("span"),u(be.$$.fragment),Mr=p(),io=l("span"),Rr=n("Install with pip"),Jo=p(),D=l("p"),Nr=n("You should install \u{1F917} Transformers in a "),Te=l("a"),Dr=n("virtual environment"),Lr=n(". If you\u2019re unfamiliar with Python virtual environments, take a look at this "),ke=l("a"),qr=n("guide"),zr=n(". A virtual environment makes it easier to manage different projects, and avoid compatibility issues between dependencies."),Ko=p(),At=l("p"),Ur=n("Start by creating a virtual environment in your project directory:"),Qo=p(),u(Pe.$$.fragment),Zo=p(),Ct=l("p"),Yr=n("Activate the virtual environment. On Linux and MacOs:"),el=p(),u(Ae.$$.fragment),tl=p(),St=l("p"),Br=n("Activate Virtual environment on Windows"),ol=p(),u(Ce.$$.fragment),ll=p(),Ot=l("p"),Gr=n("Now you\u2019re ready to install \u{1F917} Transformers with the following command:"),rl=p(),u(Se.$$.fragment),al=p(),Ft=l("p"),Wr=n("For CPU-support only, you can conveniently install \u{1F917} Transformers and a deep learning library in one line. For example, install \u{1F917} Transformers and PyTorch with:"),nl=p(),u(Oe.$$.fragment),sl=p(),It=l("p"),Vr=n("\u{1F917} Transformers and TensorFlow 2.0:"),il=p(),u(Fe.$$.fragment),fl=p(),xt=l("p"),Xr=n("\u{1F917} Transformers and Flax:"),pl=p(),u(Ie.$$.fragment),hl=p(),Ht=l("p"),Jr=n("Finally, check if \u{1F917} Transformers has been properly installed by running the following command. It will download a pretrained model:"),ml=p(),u(xe.$$.fragment),cl=p(),jt=l("p"),Kr=n("Then print out the label and score:"),dl=p(),u(He.$$.fragment),ul=p(),B=l("h2"),oe=l("a"),fo=l("span"),u(je.$$.fragment),Qr=p(),po=l("span"),Zr=n("Install from source"),vl=p(),Mt=l("p"),ea=n("Install \u{1F917} Transformers from source with the following command:"),_l=p(),u(Me.$$.fragment),$l=p(),C=l("p"),ta=n("This command installs the bleeding edge "),ho=l("code"),oa=n("main"),la=n(" version rather than the latest "),mo=l("code"),ra=n("stable"),aa=n(" version. The "),co=l("code"),na=n("main"),sa=n(" version is useful for staying up-to-date with the latest developments. For instance, if a bug has been fixed since the last official release but a new release hasn\u2019t been rolled out yet. However, this means the "),uo=l("code"),ia=n("main"),fa=n(" version may not always be stable. We strive to keep the "),vo=l("code"),pa=n("main"),ha=n(" version operational, and most issues are usually resolved within a few hours or a day. If you run into a problem, please open an "),Re=l("a"),ma=n("Issue"),ca=n(" so we can fix it even sooner!"),wl=p(),Rt=l("p"),da=n("Check if \u{1F917} Transformers has been properly installed by running the following command:"),gl=p(),u(Ne.$$.fragment),yl=p(),G=l("h2"),le=l("a"),_o=l("span"),u(De.$$.fragment),ua=p(),$o=l("span"),va=n("Editable install"),El=p(),Nt=l("p"),_a=n("You will need an editable install if you\u2019d like to:"),bl=p(),re=l("ul"),Le=l("li"),$a=n("Use the "),wo=l("code"),wa=n("main"),ga=n(" version of the source code."),ya=p(),go=l("li"),Ea=n("Contribute to \u{1F917} Transformers and need to test changes in the code."),Tl=p(),Dt=l("p"),ba=n("Clone the repository and install \u{1F917} Transformers with the following commands:"),kl=p(),u(qe.$$.fragment),Pl=p(),L=l("p"),Ta=n("These commands will link the folder you cloned the repository to and your Python library paths. Python will now look inside the folder you cloned to in addition to the normal library paths. For example, if your Python packages are typically installed in "),yo=l("code"),ka=n("~/anaconda3/envs/main/lib/python3.7/site-packages/"),Pa=n(", Python will also search the folder you cloned to: "),Eo=l("code"),Aa=n("~/transformers/"),Ca=n("."),Al=p(),u(ae.$$.fragment),Cl=p(),Lt=l("p"),Sa=n("Now you can easily update your clone to the latest version of \u{1F917} Transformers with the following command:"),Sl=p(),u(ze.$$.fragment),Ol=p(),ne=l("p"),Oa=n("Your Python environment will find the "),bo=l("code"),Fa=n("main"),Ia=n(" version of \u{1F917} Transformers on the next run."),Fl=p(),W=l("h2"),se=l("a"),To=l("span"),u(Ue.$$.fragment),xa=p(),ko=l("span"),Ha=n("Install with conda"),Il=p(),ie=l("p"),ja=n("Install from the conda channel "),Po=l("code"),Ma=n("huggingface"),Ra=n(":"),xl=p(),u(Ye.$$.fragment),Hl=p(),V=l("h2"),fe=l("a"),Ao=l("span"),u(Be.$$.fragment),Na=p(),Co=l("span"),Da=n("Cache setup"),jl=p(),j=l("p"),La=n("Pretrained models are downloaded and locally cached at: "),So=l("code"),qa=n("~/.cache/huggingface/hub"),za=n(". This is the default directory given by the shell environment variable "),Oo=l("code"),Ua=n("TRANSFORMERS_CACHE"),Ya=n(". On Windows, the default directory is given by "),Fo=l("code"),Ba=n("C:\\Users\\username\\.cache\\huggingface\\hub"),Ga=n(". You can change the shell environment variables shown below - in order of priority - to specify a different cache directory:"),Ml=p(),q=l("ol"),X=l("li"),Wa=n("Shell environment variable (default): "),Io=l("code"),Va=n("HUGGINGFACE_HUB_CACHE"),Xa=n(" or "),xo=l("code"),Ja=n("TRANSFORMERS_CACHE"),Ka=n("."),Qa=p(),Ge=l("li"),Za=n("Shell environment variable: "),Ho=l("code"),en=n("HF_HOME"),tn=n("."),on=p(),J=l("li"),ln=n("Shell environment variable: "),jo=l("code"),rn=n("XDG_CACHE_HOME"),an=n(" + "),Mo=l("code"),nn=n("/huggingface"),sn=n("."),Rl=p(),u(pe.$$.fragment),Nl=p(),K=l("h2"),he=l("a"),Ro=l("span"),u(We.$$.fragment),fn=p(),No=l("span"),pn=n("Offline mode"),Dl=p(),me=l("p"),hn=n("\u{1F917} Transformers is able to run in a firewalled or offline environment by only using local files. Set the environment variable "),Do=l("code"),mn=n("TRANSFORMERS_OFFLINE=1"),cn=n(" to enable this behavior."),Ll=p(),u(ce.$$.fragment),ql=p(),qt=l("p"),dn=n("For example, you would typically run a program on a normal network firewalled to external instances with the following command:"),zl=p(),u(Ve.$$.fragment),Ul=p(),zt=l("p"),un=n("Run this same program in an offline instance with:"),Yl=p(),u(Xe.$$.fragment),Bl=p(),Ut=l("p"),vn=n("The script should now run without hanging or waiting to timeout because it knows it should only look for local files."),Gl=p(),Q=l("h3"),de=l("a"),Lo=l("span"),u(Je.$$.fragment),_n=p(),qo=l("span"),$n=n("Fetch models and tokenizers to use offline"),Wl=p(),Yt=l("p"),wn=n("Another option for using \u{1F917} Transformers offline is to download the files ahead of time, and then point to their local path when you need to use them offline. There are three ways to do this:"),Vl=p(),z=l("ul"),Ke=l("li"),Qe=l("p"),gn=n("Download a file through the user interface on the "),Ze=l("a"),yn=n("Model Hub"),En=n(" by clicking on the \u2193 icon."),bn=p(),zo=l("p"),Bt=l("img"),Tn=p(),et=l("li"),Z=l("p"),kn=n("Use the "),Gt=l("a"),Pn=n("PreTrainedModel.from_pretrained()"),An=n(" and "),Wt=l("a"),Cn=n("PreTrainedModel.save_pretrained()"),Sn=n(" workflow:"),On=p(),ee=l("ol"),tt=l("li"),ot=l("p"),Fn=n("Download your files ahead of time with "),Vt=l("a"),In=n("PreTrainedModel.from_pretrained()"),xn=n(":"),Hn=p(),u(lt.$$.fragment),jn=p(),rt=l("li"),at=l("p"),Mn=n("Save your files to a specified directory with "),Xt=l("a"),Rn=n("PreTrainedModel.save_pretrained()"),Nn=n(":"),Dn=p(),u(nt.$$.fragment),Ln=p(),st=l("li"),it=l("p"),qn=n("Now when you\u2019re offline, reload your files with "),Jt=l("a"),zn=n("PreTrainedModel.from_pretrained()"),Un=n(" from the specified directory:"),Yn=p(),u(ft.$$.fragment),Bn=p(),pt=l("li"),ht=l("p"),Gn=n("Programmatically download files with the "),mt=l("a"),Wn=n("huggingface_hub"),Vn=n(" library:"),Xn=p(),ct=l("ol"),dt=l("li"),ut=l("p"),Jn=n("Install the "),Uo=l("code"),Kn=n("huggingface_hub"),Qn=n(" library in your virtual environment:"),Zn=p(),u(vt.$$.fragment),es=p(),_t=l("li"),M=l("p"),ts=n("Use the "),$t=l("a"),Yo=l("code"),os=n("hf_hub_download"),ls=n(" function to download a file to a specific path. For example, the following command downloads the "),Bo=l("code"),rs=n("config.json"),as=n(" file from the "),wt=l("a"),ns=n("T0"),ss=n(" model to your desired path:"),is=p(),u(gt.$$.fragment),Xl=p(),Kt=l("p"),fs=n("Once your file is downloaded and locally cached, specify it\u2019s local path to load and use it:"),Jl=p(),u(yt.$$.fragment),Kl=p(),u(ue.$$.fragment),this.h()},l(e){const i=Yi('[data-svelte="svelte-1phssyn"]',document.head);c=r(i,"META",{name:!0,content:!0}),i.forEach(o),P=h(e),d=r(e,"H1",{class:!0});var Et=a(d);b=r(Et,"A",{id:!0,class:!0,href:!0});var Go=a(b);k=r(Go,"SPAN",{});var Wo=a(k);v(y.$$.fragment,Wo),Wo.forEach(o),Go.forEach(o),E=h(Et),A=r(Et,"SPAN",{});var Vo=a(A);O=s(Vo,"Installation"),Vo.forEach(o),Et.forEach(o),S=h(e),x=r(e,"P",{});var ds=a(x);H=s(ds,"Install \u{1F917} Transformers for whichever deep learning library you\u2019re working with, setup your cache, and optionally configure \u{1F917} Transformers to run offline."),ds.forEach(o),F=h(e),U=r(e,"P",{});var us=a(U);bt=s(us,"\u{1F917} Transformers is tested on Python 3.6+, PyTorch 1.1.0+, TensorFlow 2.0+, and Flax. Follow the installation instructions below for the deep learning library you are using:"),us.forEach(o),we=h(e),N=r(e,"UL",{});var Qt=a(N);Tt=r(Qt,"LI",{});var ps=a(Tt);ge=r(ps,"A",{href:!0,rel:!0});var vs=a(ge);Cr=s(vs,"PyTorch"),vs.forEach(o),Sr=s(ps," installation instructions."),ps.forEach(o),Or=h(Qt),kt=r(Qt,"LI",{});var hs=a(kt);ye=r(hs,"A",{href:!0,rel:!0});var _s=a(ye);Fr=s(_s,"TensorFlow 2.0"),_s.forEach(o),Ir=s(hs," installation instructions."),hs.forEach(o),xr=h(Qt),Pt=r(Qt,"LI",{});var ms=a(Pt);Ee=r(ms,"A",{href:!0,rel:!0});var $s=a(Ee);Hr=s($s,"Flax"),$s.forEach(o),jr=s(ms," installation instructions."),ms.forEach(o),Qt.forEach(o),Xo=h(e),Y=r(e,"H2",{class:!0});var Zl=a(Y);te=r(Zl,"A",{id:!0,class:!0,href:!0});var ws=a(te);so=r(ws,"SPAN",{});var gs=a(so);v(be.$$.fragment,gs),gs.forEach(o),ws.forEach(o),Mr=h(Zl),io=r(Zl,"SPAN",{});var ys=a(io);Rr=s(ys,"Install with pip"),ys.forEach(o),Zl.forEach(o),Jo=h(e),D=r(e,"P",{});var Zt=a(D);Nr=s(Zt,"You should install \u{1F917} Transformers in a "),Te=r(Zt,"A",{href:!0,rel:!0});var Es=a(Te);Dr=s(Es,"virtual environment"),Es.forEach(o),Lr=s(Zt,". If you\u2019re unfamiliar with Python virtual environments, take a look at this "),ke=r(Zt,"A",{href:!0,rel:!0});var bs=a(ke);qr=s(bs,"guide"),bs.forEach(o),zr=s(Zt,". A virtual environment makes it easier to manage different projects, and avoid compatibility issues between dependencies."),Zt.forEach(o),Ko=h(e),At=r(e,"P",{});var Ts=a(At);Ur=s(Ts,"Start by creating a virtual environment in your project directory:"),Ts.forEach(o),Qo=h(e),v(Pe.$$.fragment,e),Zo=h(e),Ct=r(e,"P",{});var ks=a(Ct);Yr=s(ks,"Activate the virtual environment. On Linux and MacOs:"),ks.forEach(o),el=h(e),v(Ae.$$.fragment,e),tl=h(e),St=r(e,"P",{});var Ps=a(St);Br=s(Ps,"Activate Virtual environment on Windows"),Ps.forEach(o),ol=h(e),v(Ce.$$.fragment,e),ll=h(e),Ot=r(e,"P",{});var As=a(Ot);Gr=s(As,"Now you\u2019re ready to install \u{1F917} Transformers with the following command:"),As.forEach(o),rl=h(e),v(Se.$$.fragment,e),al=h(e),Ft=r(e,"P",{});var Cs=a(Ft);Wr=s(Cs,"For CPU-support only, you can conveniently install \u{1F917} Transformers and a deep learning library in one line. For example, install \u{1F917} Transformers and PyTorch with:"),Cs.forEach(o),nl=h(e),v(Oe.$$.fragment,e),sl=h(e),It=r(e,"P",{});var Ss=a(It);Vr=s(Ss,"\u{1F917} Transformers and TensorFlow 2.0:"),Ss.forEach(o),il=h(e),v(Fe.$$.fragment,e),fl=h(e),xt=r(e,"P",{});var Os=a(xt);Xr=s(Os,"\u{1F917} Transformers and Flax:"),Os.forEach(o),pl=h(e),v(Ie.$$.fragment,e),hl=h(e),Ht=r(e,"P",{});var Fs=a(Ht);Jr=s(Fs,"Finally, check if \u{1F917} Transformers has been properly installed by running the following command. It will download a pretrained model:"),Fs.forEach(o),ml=h(e),v(xe.$$.fragment,e),cl=h(e),jt=r(e,"P",{});var Is=a(jt);Kr=s(Is,"Then print out the label and score:"),Is.forEach(o),dl=h(e),v(He.$$.fragment,e),ul=h(e),B=r(e,"H2",{class:!0});var er=a(B);oe=r(er,"A",{id:!0,class:!0,href:!0});var xs=a(oe);fo=r(xs,"SPAN",{});var Hs=a(fo);v(je.$$.fragment,Hs),Hs.forEach(o),xs.forEach(o),Qr=h(er),po=r(er,"SPAN",{});var js=a(po);Zr=s(js,"Install from source"),js.forEach(o),er.forEach(o),vl=h(e),Mt=r(e,"P",{});var Ms=a(Mt);ea=s(Ms,"Install \u{1F917} Transformers from source with the following command:"),Ms.forEach(o),_l=h(e),v(Me.$$.fragment,e),$l=h(e),C=r(e,"P",{});var I=a(C);ta=s(I,"This command installs the bleeding edge "),ho=r(I,"CODE",{});var Rs=a(ho);oa=s(Rs,"main"),Rs.forEach(o),la=s(I," version rather than the latest "),mo=r(I,"CODE",{});var Ns=a(mo);ra=s(Ns,"stable"),Ns.forEach(o),aa=s(I," version. The "),co=r(I,"CODE",{});var Ds=a(co);na=s(Ds,"main"),Ds.forEach(o),sa=s(I," version is useful for staying up-to-date with the latest developments. For instance, if a bug has been fixed since the last official release but a new release hasn\u2019t been rolled out yet. However, this means the "),uo=r(I,"CODE",{});var Ls=a(uo);ia=s(Ls,"main"),Ls.forEach(o),fa=s(I," version may not always be stable. We strive to keep the "),vo=r(I,"CODE",{});var qs=a(vo);pa=s(qs,"main"),qs.forEach(o),ha=s(I," version operational, and most issues are usually resolved within a few hours or a day. If you run into a problem, please open an "),Re=r(I,"A",{href:!0,rel:!0});var zs=a(Re);ma=s(zs,"Issue"),zs.forEach(o),ca=s(I," so we can fix it even sooner!"),I.forEach(o),wl=h(e),Rt=r(e,"P",{});var Us=a(Rt);da=s(Us,"Check if \u{1F917} Transformers has been properly installed by running the following command:"),Us.forEach(o),gl=h(e),v(Ne.$$.fragment,e),yl=h(e),G=r(e,"H2",{class:!0});var tr=a(G);le=r(tr,"A",{id:!0,class:!0,href:!0});var Ys=a(le);_o=r(Ys,"SPAN",{});var Bs=a(_o);v(De.$$.fragment,Bs),Bs.forEach(o),Ys.forEach(o),ua=h(tr),$o=r(tr,"SPAN",{});var Gs=a($o);va=s(Gs,"Editable install"),Gs.forEach(o),tr.forEach(o),El=h(e),Nt=r(e,"P",{});var Ws=a(Nt);_a=s(Ws,"You will need an editable install if you\u2019d like to:"),Ws.forEach(o),bl=h(e),re=r(e,"UL",{});var or=a(re);Le=r(or,"LI",{});var lr=a(Le);$a=s(lr,"Use the "),wo=r(lr,"CODE",{});var Vs=a(wo);wa=s(Vs,"main"),Vs.forEach(o),ga=s(lr," version of the source code."),lr.forEach(o),ya=h(or),go=r(or,"LI",{});var Xs=a(go);Ea=s(Xs,"Contribute to \u{1F917} Transformers and need to test changes in the code."),Xs.forEach(o),or.forEach(o),Tl=h(e),Dt=r(e,"P",{});var Js=a(Dt);ba=s(Js,"Clone the repository and install \u{1F917} Transformers with the following commands:"),Js.forEach(o),kl=h(e),v(qe.$$.fragment,e),Pl=h(e),L=r(e,"P",{});var eo=a(L);Ta=s(eo,"These commands will link the folder you cloned the repository to and your Python library paths. Python will now look inside the folder you cloned to in addition to the normal library paths. For example, if your Python packages are typically installed in "),yo=r(eo,"CODE",{});var Ks=a(yo);ka=s(Ks,"~/anaconda3/envs/main/lib/python3.7/site-packages/"),Ks.forEach(o),Pa=s(eo,", Python will also search the folder you cloned to: "),Eo=r(eo,"CODE",{});var Qs=a(Eo);Aa=s(Qs,"~/transformers/"),Qs.forEach(o),Ca=s(eo,"."),eo.forEach(o),Al=h(e),v(ae.$$.fragment,e),Cl=h(e),Lt=r(e,"P",{});var Zs=a(Lt);Sa=s(Zs,"Now you can easily update your clone to the latest version of \u{1F917} Transformers with the following command:"),Zs.forEach(o),Sl=h(e),v(ze.$$.fragment,e),Ol=h(e),ne=r(e,"P",{});var rr=a(ne);Oa=s(rr,"Your Python environment will find the "),bo=r(rr,"CODE",{});var ei=a(bo);Fa=s(ei,"main"),ei.forEach(o),Ia=s(rr," version of \u{1F917} Transformers on the next run."),rr.forEach(o),Fl=h(e),W=r(e,"H2",{class:!0});var ar=a(W);se=r(ar,"A",{id:!0,class:!0,href:!0});var ti=a(se);To=r(ti,"SPAN",{});var oi=a(To);v(Ue.$$.fragment,oi),oi.forEach(o),ti.forEach(o),xa=h(ar),ko=r(ar,"SPAN",{});var li=a(ko);Ha=s(li,"Install with conda"),li.forEach(o),ar.forEach(o),Il=h(e),ie=r(e,"P",{});var nr=a(ie);ja=s(nr,"Install from the conda channel "),Po=r(nr,"CODE",{});var ri=a(Po);Ma=s(ri,"huggingface"),ri.forEach(o),Ra=s(nr,":"),nr.forEach(o),xl=h(e),v(Ye.$$.fragment,e),Hl=h(e),V=r(e,"H2",{class:!0});var sr=a(V);fe=r(sr,"A",{id:!0,class:!0,href:!0});var ai=a(fe);Ao=r(ai,"SPAN",{});var ni=a(Ao);v(Be.$$.fragment,ni),ni.forEach(o),ai.forEach(o),Na=h(sr),Co=r(sr,"SPAN",{});var si=a(Co);Da=s(si,"Cache setup"),si.forEach(o),sr.forEach(o),jl=h(e),j=r(e,"P",{});var ve=a(j);La=s(ve,"Pretrained models are downloaded and locally cached at: "),So=r(ve,"CODE",{});var ii=a(So);qa=s(ii,"~/.cache/huggingface/hub"),ii.forEach(o),za=s(ve,". This is the default directory given by the shell environment variable "),Oo=r(ve,"CODE",{});var fi=a(Oo);Ua=s(fi,"TRANSFORMERS_CACHE"),fi.forEach(o),Ya=s(ve,". On Windows, the default directory is given by "),Fo=r(ve,"CODE",{});var pi=a(Fo);Ba=s(pi,"C:\\Users\\username\\.cache\\huggingface\\hub"),pi.forEach(o),Ga=s(ve,". You can change the shell environment variables shown below - in order of priority - to specify a different cache directory:"),ve.forEach(o),Ml=h(e),q=r(e,"OL",{});var to=a(q);X=r(to,"LI",{});var oo=a(X);Wa=s(oo,"Shell environment variable (default): "),Io=r(oo,"CODE",{});var hi=a(Io);Va=s(hi,"HUGGINGFACE_HUB_CACHE"),hi.forEach(o),Xa=s(oo," or "),xo=r(oo,"CODE",{});var mi=a(xo);Ja=s(mi,"TRANSFORMERS_CACHE"),mi.forEach(o),Ka=s(oo,"."),oo.forEach(o),Qa=h(to),Ge=r(to,"LI",{});var ir=a(Ge);Za=s(ir,"Shell environment variable: "),Ho=r(ir,"CODE",{});var ci=a(Ho);en=s(ci,"HF_HOME"),ci.forEach(o),tn=s(ir,"."),ir.forEach(o),on=h(to),J=r(to,"LI",{});var lo=a(J);ln=s(lo,"Shell environment variable: "),jo=r(lo,"CODE",{});var di=a(jo);rn=s(di,"XDG_CACHE_HOME"),di.forEach(o),an=s(lo," + "),Mo=r(lo,"CODE",{});var ui=a(Mo);nn=s(ui,"/huggingface"),ui.forEach(o),sn=s(lo,"."),lo.forEach(o),to.forEach(o),Rl=h(e),v(pe.$$.fragment,e),Nl=h(e),K=r(e,"H2",{class:!0});var fr=a(K);he=r(fr,"A",{id:!0,class:!0,href:!0});var vi=a(he);Ro=r(vi,"SPAN",{});var _i=a(Ro);v(We.$$.fragment,_i),_i.forEach(o),vi.forEach(o),fn=h(fr),No=r(fr,"SPAN",{});var $i=a(No);pn=s($i,"Offline mode"),$i.forEach(o),fr.forEach(o),Dl=h(e),me=r(e,"P",{});var pr=a(me);hn=s(pr,"\u{1F917} Transformers is able to run in a firewalled or offline environment by only using local files. Set the environment variable "),Do=r(pr,"CODE",{});var wi=a(Do);mn=s(wi,"TRANSFORMERS_OFFLINE=1"),wi.forEach(o),cn=s(pr," to enable this behavior."),pr.forEach(o),Ll=h(e),v(ce.$$.fragment,e),ql=h(e),qt=r(e,"P",{});var gi=a(qt);dn=s(gi,"For example, you would typically run a program on a normal network firewalled to external instances with the following command:"),gi.forEach(o),zl=h(e),v(Ve.$$.fragment,e),Ul=h(e),zt=r(e,"P",{});var yi=a(zt);un=s(yi,"Run this same program in an offline instance with:"),yi.forEach(o),Yl=h(e),v(Xe.$$.fragment,e),Bl=h(e),Ut=r(e,"P",{});var Ei=a(Ut);vn=s(Ei,"The script should now run without hanging or waiting to timeout because it knows it should only look for local files."),Ei.forEach(o),Gl=h(e),Q=r(e,"H3",{class:!0});var hr=a(Q);de=r(hr,"A",{id:!0,class:!0,href:!0});var bi=a(de);Lo=r(bi,"SPAN",{});var Ti=a(Lo);v(Je.$$.fragment,Ti),Ti.forEach(o),bi.forEach(o),_n=h(hr),qo=r(hr,"SPAN",{});var ki=a(qo);$n=s(ki,"Fetch models and tokenizers to use offline"),ki.forEach(o),hr.forEach(o),Wl=h(e),Yt=r(e,"P",{});var Pi=a(Yt);wn=s(Pi,"Another option for using \u{1F917} Transformers offline is to download the files ahead of time, and then point to their local path when you need to use them offline. There are three ways to do this:"),Pi.forEach(o),Vl=h(e),z=r(e,"UL",{});var ro=a(z);Ke=r(ro,"LI",{});var mr=a(Ke);Qe=r(mr,"P",{});var cr=a(Qe);gn=s(cr,"Download a file through the user interface on the "),Ze=r(cr,"A",{href:!0,rel:!0});var Ai=a(Ze);yn=s(Ai,"Model Hub"),Ai.forEach(o),En=s(cr," by clicking on the \u2193 icon."),cr.forEach(o),bn=h(mr),zo=r(mr,"P",{});var Ci=a(zo);Bt=r(Ci,"IMG",{src:!0,alt:!0}),Ci.forEach(o),mr.forEach(o),Tn=h(ro),et=r(ro,"LI",{});var dr=a(et);Z=r(dr,"P",{});var ao=a(Z);kn=s(ao,"Use the "),Gt=r(ao,"A",{href:!0});var Si=a(Gt);Pn=s(Si,"PreTrainedModel.from_pretrained()"),Si.forEach(o),An=s(ao," and "),Wt=r(ao,"A",{href:!0});var Oi=a(Wt);Cn=s(Oi,"PreTrainedModel.save_pretrained()"),Oi.forEach(o),Sn=s(ao," workflow:"),ao.forEach(o),On=h(dr),ee=r(dr,"OL",{});var no=a(ee);tt=r(no,"LI",{});var ur=a(tt);ot=r(ur,"P",{});var vr=a(ot);Fn=s(vr,"Download your files ahead of time with "),Vt=r(vr,"A",{href:!0});var Fi=a(Vt);In=s(Fi,"PreTrainedModel.from_pretrained()"),Fi.forEach(o),xn=s(vr,":"),vr.forEach(o),Hn=h(ur),v(lt.$$.fragment,ur),ur.forEach(o),jn=h(no),rt=r(no,"LI",{});var _r=a(rt);at=r(_r,"P",{});var $r=a(at);Mn=s($r,"Save your files to a specified directory with "),Xt=r($r,"A",{href:!0});var Ii=a(Xt);Rn=s(Ii,"PreTrainedModel.save_pretrained()"),Ii.forEach(o),Nn=s($r,":"),$r.forEach(o),Dn=h(_r),v(nt.$$.fragment,_r),_r.forEach(o),Ln=h(no),st=r(no,"LI",{});var wr=a(st);it=r(wr,"P",{});var gr=a(it);qn=s(gr,"Now when you\u2019re offline, reload your files with "),Jt=r(gr,"A",{href:!0});var xi=a(Jt);zn=s(xi,"PreTrainedModel.from_pretrained()"),xi.forEach(o),Un=s(gr," from the specified directory:"),gr.forEach(o),Yn=h(wr),v(ft.$$.fragment,wr),wr.forEach(o),no.forEach(o),dr.forEach(o),Bn=h(ro),pt=r(ro,"LI",{});var yr=a(pt);ht=r(yr,"P",{});var Er=a(ht);Gn=s(Er,"Programmatically download files with the "),mt=r(Er,"A",{href:!0,rel:!0});var Hi=a(mt);Wn=s(Hi,"huggingface_hub"),Hi.forEach(o),Vn=s(Er," library:"),Er.forEach(o),Xn=h(yr),ct=r(yr,"OL",{});var br=a(ct);dt=r(br,"LI",{});var Tr=a(dt);ut=r(Tr,"P",{});var kr=a(ut);Jn=s(kr,"Install the "),Uo=r(kr,"CODE",{});var ji=a(Uo);Kn=s(ji,"huggingface_hub"),ji.forEach(o),Qn=s(kr," library in your virtual environment:"),kr.forEach(o),Zn=h(Tr),v(vt.$$.fragment,Tr),Tr.forEach(o),es=h(br),_t=r(br,"LI",{});var Pr=a(_t);M=r(Pr,"P",{});var _e=a(M);ts=s(_e,"Use the "),$t=r(_e,"A",{href:!0,rel:!0});var Mi=a($t);Yo=r(Mi,"CODE",{});var Ri=a(Yo);os=s(Ri,"hf_hub_download"),Ri.forEach(o),Mi.forEach(o),ls=s(_e," function to download a file to a specific path. For example, the following command downloads the "),Bo=r(_e,"CODE",{});var Ni=a(Bo);rs=s(Ni,"config.json"),Ni.forEach(o),as=s(_e," file from the "),wt=r(_e,"A",{href:!0,rel:!0});var Di=a(wt);ns=s(Di,"T0"),Di.forEach(o),ss=s(_e," model to your desired path:"),_e.forEach(o),is=h(Pr),v(gt.$$.fragment,Pr),Pr.forEach(o),br.forEach(o),yr.forEach(o),ro.forEach(o),Xl=h(e),Kt=r(e,"P",{});var Li=a(Kt);fs=s(Li,"Once your file is downloaded and locally cached, specify it\u2019s local path to load and use it:"),Li.forEach(o),Jl=h(e),v(yt.$$.fragment,e),Kl=h(e),v(ue.$$.fragment,e),this.h()},h(){m(c,"name","hf:doc:metadata"),m(c,"content",JSON.stringify(Qi)),m(b,"id","installation"),m(b,"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"),m(b,"href","#installation"),m(d,"class","relative group"),m(ge,"href","https://pytorch.org/get-started/locally/"),m(ge,"rel","nofollow"),m(ye,"href","https://www.tensorflow.org/install/pip"),m(ye,"rel","nofollow"),m(Ee,"href","https://flax.readthedocs.io/en/latest/"),m(Ee,"rel","nofollow"),m(te,"id","install-with-pip"),m(te,"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"),m(te,"href","#install-with-pip"),m(Y,"class","relative group"),m(Te,"href","https://docs.python.org/3/library/venv.html"),m(Te,"rel","nofollow"),m(ke,"href","https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/"),m(ke,"rel","nofollow"),m(oe,"id","install-from-source"),m(oe,"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"),m(oe,"href","#install-from-source"),m(B,"class","relative group"),m(Re,"href","https://github.com/huggingface/transformers/issues"),m(Re,"rel","nofollow"),m(le,"id","editable-install"),m(le,"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"),m(le,"href","#editable-install"),m(G,"class","relative group"),m(se,"id","install-with-conda"),m(se,"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"),m(se,"href","#install-with-conda"),m(W,"class","relative group"),m(fe,"id","cache-setup"),m(fe,"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"),m(fe,"href","#cache-setup"),m(V,"class","relative group"),m(he,"id","offline-mode"),m(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"),m(he,"href","#offline-mode"),m(K,"class","relative group"),m(de,"id","fetch-models-and-tokenizers-to-use-offline"),m(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(de,"href","#fetch-models-and-tokenizers-to-use-offline"),m(Q,"class","relative group"),m(Ze,"href","https://huggingface.co/models"),m(Ze,"rel","nofollow"),Bi(Bt.src,cs="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/download-icon.png")||m(Bt,"src",cs),m(Bt,"alt","download-icon"),m(Gt,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained"),m(Wt,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.save_pretrained"),m(Vt,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained"),m(Xt,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.save_pretrained"),m(Jt,"href","/docs/transformers/pr_19907/en/main_classes/model#transformers.PreTrainedModel.from_pretrained"),m(mt,"href","https://github.com/huggingface/huggingface_hub/tree/main/src/huggingface_hub"),m(mt,"rel","nofollow"),m($t,"href","https://huggingface.co/docs/hub/adding-a-library#download-files-from-the-hub"),m($t,"rel","nofollow"),m(wt,"href","https://huggingface.co/bigscience/T0_3B"),m(wt,"rel","nofollow")},m(e,i){t(document.head,c),f(e,P,i),f(e,d,i),t(d,b),t(b,k),_(y,k,null),t(d,E),t(d,A),t(A,O),f(e,S,i),f(e,x,i),t(x,H),f(e,F,i),f(e,U,i),t(U,bt),f(e,we,i),f(e,N,i),t(N,Tt),t(Tt,ge),t(ge,Cr),t(Tt,Sr),t(N,Or),t(N,kt),t(kt,ye),t(ye,Fr),t(kt,Ir),t(N,xr),t(N,Pt),t(Pt,Ee),t(Ee,Hr),t(Pt,jr),f(e,Xo,i),f(e,Y,i),t(Y,te),t(te,so),_(be,so,null),t(Y,Mr),t(Y,io),t(io,Rr),f(e,Jo,i),f(e,D,i),t(D,Nr),t(D,Te),t(Te,Dr),t(D,Lr),t(D,ke),t(ke,qr),t(D,zr),f(e,Ko,i),f(e,At,i),t(At,Ur),f(e,Qo,i),_(Pe,e,i),f(e,Zo,i),f(e,Ct,i),t(Ct,Yr),f(e,el,i),_(Ae,e,i),f(e,tl,i),f(e,St,i),t(St,Br),f(e,ol,i),_(Ce,e,i),f(e,ll,i),f(e,Ot,i),t(Ot,Gr),f(e,rl,i),_(Se,e,i),f(e,al,i),f(e,Ft,i),t(Ft,Wr),f(e,nl,i),_(Oe,e,i),f(e,sl,i),f(e,It,i),t(It,Vr),f(e,il,i),_(Fe,e,i),f(e,fl,i),f(e,xt,i),t(xt,Xr),f(e,pl,i),_(Ie,e,i),f(e,hl,i),f(e,Ht,i),t(Ht,Jr),f(e,ml,i),_(xe,e,i),f(e,cl,i),f(e,jt,i),t(jt,Kr),f(e,dl,i),_(He,e,i),f(e,ul,i),f(e,B,i),t(B,oe),t(oe,fo),_(je,fo,null),t(B,Qr),t(B,po),t(po,Zr),f(e,vl,i),f(e,Mt,i),t(Mt,ea),f(e,_l,i),_(Me,e,i),f(e,$l,i),f(e,C,i),t(C,ta),t(C,ho),t(ho,oa),t(C,la),t(C,mo),t(mo,ra),t(C,aa),t(C,co),t(co,na),t(C,sa),t(C,uo),t(uo,ia),t(C,fa),t(C,vo),t(vo,pa),t(C,ha),t(C,Re),t(Re,ma),t(C,ca),f(e,wl,i),f(e,Rt,i),t(Rt,da),f(e,gl,i),_(Ne,e,i),f(e,yl,i),f(e,G,i),t(G,le),t(le,_o),_(De,_o,null),t(G,ua),t(G,$o),t($o,va),f(e,El,i),f(e,Nt,i),t(Nt,_a),f(e,bl,i),f(e,re,i),t(re,Le),t(Le,$a),t(Le,wo),t(wo,wa),t(Le,ga),t(re,ya),t(re,go),t(go,Ea),f(e,Tl,i),f(e,Dt,i),t(Dt,ba),f(e,kl,i),_(qe,e,i),f(e,Pl,i),f(e,L,i),t(L,Ta),t(L,yo),t(yo,ka),t(L,Pa),t(L,Eo),t(Eo,Aa),t(L,Ca),f(e,Al,i),_(ae,e,i),f(e,Cl,i),f(e,Lt,i),t(Lt,Sa),f(e,Sl,i),_(ze,e,i),f(e,Ol,i),f(e,ne,i),t(ne,Oa),t(ne,bo),t(bo,Fa),t(ne,Ia),f(e,Fl,i),f(e,W,i),t(W,se),t(se,To),_(Ue,To,null),t(W,xa),t(W,ko),t(ko,Ha),f(e,Il,i),f(e,ie,i),t(ie,ja),t(ie,Po),t(Po,Ma),t(ie,Ra),f(e,xl,i),_(Ye,e,i),f(e,Hl,i),f(e,V,i),t(V,fe),t(fe,Ao),_(Be,Ao,null),t(V,Na),t(V,Co),t(Co,Da),f(e,jl,i),f(e,j,i),t(j,La),t(j,So),t(So,qa),t(j,za),t(j,Oo),t(Oo,Ua),t(j,Ya),t(j,Fo),t(Fo,Ba),t(j,Ga),f(e,Ml,i),f(e,q,i),t(q,X),t(X,Wa),t(X,Io),t(Io,Va),t(X,Xa),t(X,xo),t(xo,Ja),t(X,Ka),t(q,Qa),t(q,Ge),t(Ge,Za),t(Ge,Ho),t(Ho,en),t(Ge,tn),t(q,on),t(q,J),t(J,ln),t(J,jo),t(jo,rn),t(J,an),t(J,Mo),t(Mo,nn),t(J,sn),f(e,Rl,i),_(pe,e,i),f(e,Nl,i),f(e,K,i),t(K,he),t(he,Ro),_(We,Ro,null),t(K,fn),t(K,No),t(No,pn),f(e,Dl,i),f(e,me,i),t(me,hn),t(me,Do),t(Do,mn),t(me,cn),f(e,Ll,i),_(ce,e,i),f(e,ql,i),f(e,qt,i),t(qt,dn),f(e,zl,i),_(Ve,e,i),f(e,Ul,i),f(e,zt,i),t(zt,un),f(e,Yl,i),_(Xe,e,i),f(e,Bl,i),f(e,Ut,i),t(Ut,vn),f(e,Gl,i),f(e,Q,i),t(Q,de),t(de,Lo),_(Je,Lo,null),t(Q,_n),t(Q,qo),t(qo,$n),f(e,Wl,i),f(e,Yt,i),t(Yt,wn),f(e,Vl,i),f(e,z,i),t(z,Ke),t(Ke,Qe),t(Qe,gn),t(Qe,Ze),t(Ze,yn),t(Qe,En),t(Ke,bn),t(Ke,zo),t(zo,Bt),t(z,Tn),t(z,et),t(et,Z),t(Z,kn),t(Z,Gt),t(Gt,Pn),t(Z,An),t(Z,Wt),t(Wt,Cn),t(Z,Sn),t(et,On),t(et,ee),t(ee,tt),t(tt,ot),t(ot,Fn),t(ot,Vt),t(Vt,In),t(ot,xn),t(tt,Hn),_(lt,tt,null),t(ee,jn),t(ee,rt),t(rt,at),t(at,Mn),t(at,Xt),t(Xt,Rn),t(at,Nn),t(rt,Dn),_(nt,rt,null),t(ee,Ln),t(ee,st),t(st,it),t(it,qn),t(it,Jt),t(Jt,zn),t(it,Un),t(st,Yn),_(ft,st,null),t(z,Bn),t(z,pt),t(pt,ht),t(ht,Gn),t(ht,mt),t(mt,Wn),t(ht,Vn),t(pt,Xn),t(pt,ct),t(ct,dt),t(dt,ut),t(ut,Jn),t(ut,Uo),t(Uo,Kn),t(ut,Qn),t(dt,Zn),_(vt,dt,null),t(ct,es),t(ct,_t),t(_t,M),t(M,ts),t(M,$t),t($t,Yo),t(Yo,os),t(M,ls),t(M,Bo),t(Bo,rs),t(M,as),t(M,wt),t(wt,ns),t(M,ss),t(_t,is),_(gt,_t,null),f(e,Xl,i),f(e,Kt,i),t(Kt,fs),f(e,Jl,i),_(yt,e,i),f(e,Kl,i),_(ue,e,i),Ql=!0},p(e,[i]){const Et={};i&2&&(Et.$$scope={dirty:i,ctx:e}),ae.$set(Et);const Go={};i&2&&(Go.$$scope={dirty:i,ctx:e}),pe.$set(Go);const Wo={};i&2&&(Wo.$$scope={dirty:i,ctx:e}),ce.$set(Wo);const Vo={};i&2&&(Vo.$$scope={dirty:i,ctx:e}),ue.$set(Vo)},i(e){Ql||($(y.$$.fragment,e),$(be.$$.fragment,e),$(Pe.$$.fragment,e),$(Ae.$$.fragment,e),$(Ce.$$.fragment,e),$(Se.$$.fragment,e),$(Oe.$$.fragment,e),$(Fe.$$.fragment,e),$(Ie.$$.fragment,e),$(xe.$$.fragment,e),$(He.$$.fragment,e),$(je.$$.fragment,e),$(Me.$$.fragment,e),$(Ne.$$.fragment,e),$(De.$$.fragment,e),$(qe.$$.fragment,e),$(ae.$$.fragment,e),$(ze.$$.fragment,e),$(Ue.$$.fragment,e),$(Ye.$$.fragment,e),$(Be.$$.fragment,e),$(pe.$$.fragment,e),$(We.$$.fragment,e),$(ce.$$.fragment,e),$(Ve.$$.fragment,e),$(Xe.$$.fragment,e),$(Je.$$.fragment,e),$(lt.$$.fragment,e),$(nt.$$.fragment,e),$(ft.$$.fragment,e),$(vt.$$.fragment,e),$(gt.$$.fragment,e),$(yt.$$.fragment,e),$(ue.$$.fragment,e),Ql=!0)},o(e){w(y.$$.fragment,e),w(be.$$.fragment,e),w(Pe.$$.fragment,e),w(Ae.$$.fragment,e),w(Ce.$$.fragment,e),w(Se.$$.fragment,e),w(Oe.$$.fragment,e),w(Fe.$$.fragment,e),w(Ie.$$.fragment,e),w(xe.$$.fragment,e),w(He.$$.fragment,e),w(je.$$.fragment,e),w(Me.$$.fragment,e),w(Ne.$$.fragment,e),w(De.$$.fragment,e),w(qe.$$.fragment,e),w(ae.$$.fragment,e),w(ze.$$.fragment,e),w(Ue.$$.fragment,e),w(Ye.$$.fragment,e),w(Be.$$.fragment,e),w(pe.$$.fragment,e),w(We.$$.fragment,e),w(ce.$$.fragment,e),w(Ve.$$.fragment,e),w(Xe.$$.fragment,e),w(Je.$$.fragment,e),w(lt.$$.fragment,e),w(nt.$$.fragment,e),w(ft.$$.fragment,e),w(vt.$$.fragment,e),w(gt.$$.fragment,e),w(yt.$$.fragment,e),w(ue.$$.fragment,e),Ql=!1},d(e){o(c),e&&o(P),e&&o(d),g(y),e&&o(S),e&&o(x),e&&o(F),e&&o(U),e&&o(we),e&&o(N),e&&o(Xo),e&&o(Y),g(be),e&&o(Jo),e&&o(D),e&&o(Ko),e&&o(At),e&&o(Qo),g(Pe,e),e&&o(Zo),e&&o(Ct),e&&o(el),g(Ae,e),e&&o(tl),e&&o(St),e&&o(ol),g(Ce,e),e&&o(ll),e&&o(Ot),e&&o(rl),g(Se,e),e&&o(al),e&&o(Ft),e&&o(nl),g(Oe,e),e&&o(sl),e&&o(It),e&&o(il),g(Fe,e),e&&o(fl),e&&o(xt),e&&o(pl),g(Ie,e),e&&o(hl),e&&o(Ht),e&&o(ml),g(xe,e),e&&o(cl),e&&o(jt),e&&o(dl),g(He,e),e&&o(ul),e&&o(B),g(je),e&&o(vl),e&&o(Mt),e&&o(_l),g(Me,e),e&&o($l),e&&o(C),e&&o(wl),e&&o(Rt),e&&o(gl),g(Ne,e),e&&o(yl),e&&o(G),g(De),e&&o(El),e&&o(Nt),e&&o(bl),e&&o(re),e&&o(Tl),e&&o(Dt),e&&o(kl),g(qe,e),e&&o(Pl),e&&o(L),e&&o(Al),g(ae,e),e&&o(Cl),e&&o(Lt),e&&o(Sl),g(ze,e),e&&o(Ol),e&&o(ne),e&&o(Fl),e&&o(W),g(Ue),e&&o(Il),e&&o(ie),e&&o(xl),g(Ye,e),e&&o(Hl),e&&o(V),g(Be),e&&o(jl),e&&o(j),e&&o(Ml),e&&o(q),e&&o(Rl),g(pe,e),e&&o(Nl),e&&o(K),g(We),e&&o(Dl),e&&o(me),e&&o(Ll),g(ce,e),e&&o(ql),e&&o(qt),e&&o(zl),g(Ve,e),e&&o(Ul),e&&o(zt),e&&o(Yl),g(Xe,e),e&&o(Bl),e&&o(Ut),e&&o(Gl),e&&o(Q),g(Je),e&&o(Wl),e&&o(Yt),e&&o(Vl),e&&o(z),g(lt),g(nt),g(ft),g(vt),g(gt),e&&o(Xl),e&&o(Kt),e&&o(Jl),g(yt,e),e&&o(Kl),g(ue,e)}}}const Qi={local:"installation",sections:[{local:"install-with-pip",title:"Install with pip"},{local:"install-from-source",title:"Install from source"},{local:"editable-install",title:"Editable install"},{local:"install-with-conda",title:"Install with conda"},{local:"cache-setup",title:"Cache setup"},{local:"offline-mode",sections:[{local:"fetch-models-and-tokenizers-to-use-offline",title:"Fetch models and tokenizers to use offline"}],title:"Offline mode"}],title:"Installation"};function Zi(R){return Gi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rf extends qi{constructor(c){super();zi(this,c,Zi,Ki,Ui,{})}}export{rf as default,Qi as metadata};
