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,Hs,Ps,fl,Os,Js,ml,js,Gs,ql,Ue,Kl,Ke,Ss,ea,et,Zs,ta,se,tt,Ws,De,Ys,Fs,yl,Vs,la,B,re,gl,Ie,Xs,vl,zs,aa,y,Bs,_l,Rs,Qs,wl,qs,Ks,bl,er,tr,El,lr,ar,oa,Le,sa,R,ie,$l,Ne,or,kl,sr,ra,k,xe,rr,He,ir,nr,cr,lt,hr,Pe,dr,pr,at,ur,Oe,fr,mr,ot,yr,Je,gr,ia;return ce=new je({}),he=new je({}),ue=new je({}),fe=new Ge({props:{code:"cGlwJTIwaW5zdGFsbCUyMGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZzcGFjeSUyRmVuX2NvcmVfd2ViX3NtJTJGcmVzb2x2ZSUyRm1haW4lMkZlbl9jb3JlX3dlYl9zbS1hbnktcHkzLW5vbmUtYW55LndobA==",highlighted:"pip install https://huggingface.co/spacy/en_core_web_sm/resolve/main/en_core_web_sm-any-py3-none-any.whl"}}),me=new Ge({props:{code:"JTIzJTIwVXNpbmclMjBzcGFjeS5sb2FkKCkuJTBBaW1wb3J0JTIwc3BhY3klMEFubHAlMjAlM0QlMjBzcGFjeS5sb2FkKCUyMmVuX2NvcmVfd2ViX3NtJTIyKSUwQSUwQSUyMyUyMEltcG9ydGluZyUyMGFzJTIwbW9kdWxlLiUwQWltcG9ydCUyMGVuX2NvcmVfd2ViX3NtJTBBbmxwJTIwJTNEJTIwZW5fY29yZV93ZWJfc20ubG9hZCgp",highlighted:`<span class="hljs-comment"># Using spacy.load().</span>
<span class="hljs-keyword">import</span> spacy
nlp = spacy.load(<span class="hljs-string">&quot;en_core_web_sm&quot;</span>)

<span class="hljs-comment"># Importing as module.</span>
<span class="hljs-keyword">import</span> en_core_web_sm
nlp = en_core_web_sm.load()`}}),ye=new je({}),ge=new je({}),ve=new Ge({props:{code:"cGlwJTIwaW5zdGFsbCUyMHNwYWN5LWh1Z2dpbmdmYWNlLWh1Yg==",highlighted:"pip install spacy-huggingface-hub"}}),_e=new Ge({props:{code:"cHl0aG9uJTIwLW0lMjBzcGFjeSUyMGh1Z2dpbmdmYWNlLWh1YiUyMC0taGVscA==",highlighted:'python -m spacy huggingface-hub --<span class="hljs-built_in">help</span>'}}),we=new Ge({props:{code:"cHl0aG9uJTIwLW0lMjBzcGFjeSUyMGh1Z2dpbmdmYWNlLWh1YiUyMHB1c2glMjAlNUJ3aGxfcGF0aCU1RCUyMCU1Qi0tb3JnJTVEJTIwJTVCLS1tc2clNUQlMjAlNUItLWxvY2FsLXJlcG8lNUQlMjAlNUItLXZlcmJvc2UlNUQ=",highlighted:"python -m spacy huggingface-hub push [whl_path] [--org] [--msg] [--local-repo] [--verbose]"}}),Ue=new Ge({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4lMEFweXRob24lMjAtbSUyMHNwYWN5JTIwcGFja2FnZSUyMC4lMkZlbl9uZXJfZmFzaGlvbiUyMC4lMkZvdXRwdXQlMjAtLWJ1aWxkJTIwd2hlZWwlMEFjZCUyMC4lMkZvdXRwdXQlMkZlbl9uZXJfZmFzaGlvbi0wLjAuMCUyRmRpc3QlMEFweXRob24lMjAtbSUyMHNwYWN5JTIwaHVnZ2luZ2ZhY2UtaHViJTIwcHVzaCUyMGVuX25lcl9mYXNoaW9uLTAuMC4wLXB5My1ub25lLWFueS53aGw=",highlighted:`huggingface-cli login
python -m spacy package ./en_ner_fashion ./output --build wheel
<span class="hljs-built_in">cd</span> ./output/en_ner_fashion-0.0.0/dist
python -m spacy huggingface-hub push en_ner_fashion-0.0.0-py3-none-any.whl`}}),Ie=new je({}),Le=new Ge({props:{code:"ZnJvbSUyMHNwYWN5X2h1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMHB1c2glMEElMEFyZXN1bHQlMjAlM0QlMjBwdXNoKCUyMi4lMkZlbl9uZXJfZmFzaGlvbi0wLjAuMC1weTMtbm9uZS1hbnkud2hsJTIyKSUwQXByaW50KHJlc3VsdCU1QiUyMnVybCUyMiU1RCk=",highlighted:`<span class="hljs-keyword">from</span> spacy_huggingface_hub <span class="hljs-keyword">import</span> push

result = push(<span class="hljs-string">&quot;./en_ner_fashion-0.0.0-py3-none-any.whl&quot;</span>)
<span class="hljs-built_in">print</span>(result[<span class="hljs-string">&quot;url&quot;</span>])`}}),Ne=new je({}),{c(){L=a("meta"),Al=c(),N=a("h1"),Q=a("a"),mt=a("span"),g(ce.$$.fragment),Ua=c(),yt=a("span"),Da=r("Using spaCy at Hugging Face"),Tl=c(),x=a("p"),gt=a("code"),Ia=r("spaCy"),La=r(" is a popular library for advanced Natural Language Processing used widely across industry. "),vt=a("code"),Na=r("spaCy"),xa=r(" makes it easy to use and train pipelines for tasks like named entity recognition, text classification, part of speech tagging and more, and lets you build powerful applications to process and analyze large volumes of text."),Ml=c(),H=a("h2"),q=a("a"),_t=a("span"),g(he.$$.fragment),Ha=c(),wt=a("span"),Pa=r("Exploring spaCy models in the Hub"),Ul=c(),u=a("p"),Oa=r("The official models from "),bt=a("code"),Ja=r("spaCy"),ja=r(" 3.3 are in the "),Et=a("code"),Ga=r("spaCy"),Sa=c(),de=a("a"),Za=r("Organization Page"),Wa=r(". Anyone in the community can also share their "),$t=a("code"),Ya=r("spaCy"),Fa=r(" models, which you can find by filtering at the left of the "),pe=a("a"),Va=r("models page"),Xa=r("."),Dl=c(),Se=a("p"),za=r("All models on the Hub come up with useful features"),Il=c(),f=a("ol"),kt=a("li"),Ba=r("An automatically generated model card with label scheme, metrics, components, and more."),Ra=c(),Ct=a("li"),Qa=r("An evaluation sections at top right where you can look at the metrics."),qa=c(),At=a("li"),Ka=r("Metadata tags that help for discoverability and contain information such as license and language."),eo=c(),Tt=a("li"),to=r("An interactive widget you can use to play out with the model directly in the browser"),lo=c(),Mt=a("li"),ao=r("An Inference API that allows to make inference requests."),Ll=c(),P=a("div"),Ze=a("img"),oo=c(),We=a("img"),Nl=c(),O=a("h2"),K=a("a"),Ut=a("span"),g(ue.$$.fragment),so=c(),Dt=a("span"),ro=r("Using existing models"),xl=c(),ee=a("p"),io=r("All "),It=a("code"),no=r("spaCy"),co=r(" models from the Hub can be directly installed using pip install."),Hl=c(),g(fe.$$.fragment),Pl=c(),A=a("p"),ho=r("To find the link of interest, you can go to a repository with a "),Lt=a("code"),po=r("spaCy"),uo=r(" model. When you open the repository, you can click "),Nt=a("code"),fo=r("Use in spaCy"),mo=r(" and you will be given a working snippet that you can use to install and load the model!"),Ol=c(),J=a("div"),Ye=a("img"),yo=c(),Fe=a("img"),Jl=c(),j=a("div"),Ve=a("img"),go=c(),Xe=a("img"),jl=c(),ze=a("p"),vo=r("Once installed, you can load the model as any spaCy pipeline."),Gl=c(),g(me.$$.fragment),Sl=c(),G=a("h2"),te=a("a"),xt=a("span"),g(ye.$$.fragment),_o=c(),Ht=a("span"),wo=r("Sharing your models"),Zl=c(),S=a("h3"),le=a("a"),Pt=a("span"),g(ge.$$.fragment),bo=c(),Ot=a("span"),Eo=r("Using the spaCy CLI (recommended)"),Wl=c(),T=a("p"),$o=r("The "),Jt=a("code"),ko=r("spacy-huggingface-hub"),Co=r(" library extends "),jt=a("code"),Ao=r("spaCy"),To=r(" native CLI so people can easily push their packaged models to the Hub."),Yl=c(),Be=a("p"),Mo=r("You can install spacy-huggingface-hub from pip:"),Fl=c(),g(ve.$$.fragment),Vl=c(),Re=a("p"),Uo=r("You can then check if the command has been registered successfully"),Xl=c(),g(_e.$$.fragment),zl=c(),ae=a("p"),Do=r("To push with the CLI, you can use the "),Gt=a("code"),Io=r("huggingface-hub push"),Lo=r(" command as seen below."),Bl=c(),g(we.$$.fragment),Rl=c(),oe=a("table"),St=a("thead"),Z=a("tr"),Zt=a("th"),No=r("Argument"),xo=c(),Wt=a("th"),Ho=r("Type"),Po=c(),Yt=a("th"),Oo=r("Description"),Jo=c(),$=a("tbody"),W=a("tr"),Ft=a("td"),Vt=a("code"),jo=r("whl_path"),Go=c(),Qe=a("td"),So=r("str / "),Xt=a("code"),Zo=r("Path"),Wo=c(),Y=a("td"),Yo=r("The path to the "),zt=a("code"),Fo=r(".whl"),Vo=r(" file packaged with "),be=a("a"),Bt=a("code"),Xo=r("spacy package"),zo=r("."),Bo=c(),F=a("tr"),Ee=a("td"),Rt=a("code"),Ro=r("--org"),Qo=r(", "),Qt=a("code"),qo=r("-o"),Ko=c(),qt=a("td"),es=r("str"),ts=c(),Kt=a("td"),ls=r("Optional name of organization to which the pipeline should be uploaded."),as=c(),V=a("tr"),$e=a("td"),el=a("code"),os=r("--msg"),ss=r(", "),tl=a("code"),rs=r("-m"),is=c(),ll=a("td"),ns=r("str"),cs=c(),ke=a("td"),hs=r("Commit message to use for update. Defaults to "),al=a("code"),ds=r('"Update spaCy pipeline"'),ps=r("."),us=c(),X=a("tr"),Ce=a("td"),ol=a("code"),fs=r("--local-repo"),ms=r(", "),sl=a("code"),ys=r("-l"),gs=c(),qe=a("td"),vs=r("str / "),rl=a("code"),_s=r("Path"),ws=c(),Ae=a("td"),bs=r("Local path to the model repository (will be created if it doesn\u2019t exist). Defaults to "),il=a("code"),Es=r("hub"),$s=r(" in the current working directory."),ks=c(),z=a("tr"),Te=a("td"),nl=a("code"),Cs=r("--verbose"),As=r(", "),cl=a("code"),Ts=r("-V"),Ms=c(),hl=a("td"),Us=r("bool"),Ds=c(),dl=a("td"),Is=r("Output additional info for debugging, e.g. the full generated hub metadata."),Ql=c(),m=a("p"),Ls=r("You can then upload any pipeline packaged with "),Me=a("a"),pl=a("code"),Ns=r("spacy package"),xs=r(". Make sure to set "),ul=a("code"),Hs=r("--build wheel"),Ps=r(" to output a binary .whl file. The uploader will read all metadata from the pipeline package, including the auto-generated pretty "),fl=a("code"),Os=r("README.md"),Js=r(" and the model details available in the "),ml=a("code"),js=r("meta.json"),Gs=r("."),ql=c(),g(Ue.$$.fragment),Kl=c(),Ke=a("p"),Ss=r("In just a minute, you can get your packaged model in the Hub, try it out directly in the browser, and share it with the rest of the community. All the required metadata will be uploaded for you and you even get a cool model card."),ea=c(),et=a("p"),Zs=r("The command will output two things:"),ta=c(),se=a("ul"),tt=a("li"),Ws=r("Where to find your repo in the Hub! For example, "),De=a("a"),Ys=r("https://huggingface.co/spacy/en_core_web_sm"),Fs=c(),yl=a("li"),Vs=r("And how to install the pipeline directly from the Hub!"),la=c(),B=a("h3"),re=a("a"),gl=a("span"),g(Ie.$$.fragment),Xs=c(),vl=a("span"),zs=r("From a Python script"),aa=c(),y=a("p"),Bs=r("You can use the "),_l=a("code"),Rs=r("push"),Qs=r(" function from Python. It returns a dictionary containing the "),wl=a("code"),qs=r('"url"'),Ks=r(" and \u201D"),bl=a("code"),er=r("whl_url"),tr=r("\u201D of the published model and the wheel file, which you can later install with "),El=a("code"),lr=r("pip install"),ar=r("."),oa=c(),g(Le.$$.fragment),sa=c(),R=a("h2"),ie=a("a"),$l=a("span"),g(Ne.$$.fragment),or=c(),kl=a("span"),sr=r("Additional resources"),ra=c(),k=a("ul"),xe=a("li"),rr=r("spacy-huggingface-hub "),He=a("a"),ir=r("library"),nr=r("."),cr=c(),lt=a("li"),hr=r("Launch "),Pe=a("a"),dr=r("blog post"),pr=c(),at=a("li"),ur=r("spaCy v 3.1 "),Oe=a("a"),fr=r("Announcement"),mr=c(),ot=a("li"),yr=r("spaCy "),Je=a("a"),gr=r("documentation"),this.h()},l(t){const n=un('[data-svelte="svelte-1phssyn"]',document.head);L=o(n,"META",{name:!0,content:!0}),n.forEach(l),Al=h(t),N=o(t,"H1",{class:!0});var na=s(N);Q=o(na,"A",{id:!0,class:!0,href:!0});var Ir=s(Q);mt=o(Ir,"SPAN",{});var Lr=s(mt);v(ce.$$.fragment,Lr),Lr.forEach(l),Ir.forEach(l),Ua=h(na),yt=o(na,"SPAN",{});var Nr=s(yt);Da=i(Nr,"Using spaCy at Hugging Face"),Nr.forEach(l),na.forEach(l),Tl=h(t),x=o(t,"P",{});var Cl=s(x);gt=o(Cl,"CODE",{});var xr=s(gt);Ia=i(xr,"spaCy"),xr.forEach(l),La=i(Cl," is a popular library for advanced Natural Language Processing used widely across industry. "),vt=o(Cl,"CODE",{});var Hr=s(vt);Na=i(Hr,"spaCy"),Hr.forEach(l),xa=i(Cl," makes it easy to use and train pipelines for tasks like named entity recognition, text classification, part of speech tagging and more, and lets you build powerful applications to process and analyze large volumes of text."),Cl.forEach(l),Ml=h(t),H=o(t,"H2",{class:!0});var ca=s(H);q=o(ca,"A",{id:!0,class:!0,href:!0});var Pr=s(q);_t=o(Pr,"SPAN",{});var Or=s(_t);v(he.$$.fragment,Or),Or.forEach(l),Pr.forEach(l),Ha=h(ca),wt=o(ca,"SPAN",{});var Jr=s(wt);Pa=i(Jr,"Exploring spaCy models in the Hub"),Jr.forEach(l),ca.forEach(l),Ul=h(t),u=o(t,"P",{});var C=s(u);Oa=i(C,"The official models from "),bt=o(C,"CODE",{});var jr=s(bt);Ja=i(jr,"spaCy"),jr.forEach(l),ja=i(C," 3.3 are in the "),Et=o(C,"CODE",{});var Gr=s(Et);Ga=i(Gr,"spaCy"),Gr.forEach(l),Sa=h(C),de=o(C,"A",{href:!0,rel:!0});var Sr=s(de);Za=i(Sr,"Organization Page"),Sr.forEach(l),Wa=i(C,". Anyone in the community can also share their "),$t=o(C,"CODE",{});var Zr=s($t);Ya=i(Zr,"spaCy"),Zr.forEach(l),Fa=i(C," models, which you can find by filtering at the left of the "),pe=o(C,"A",{href:!0,rel:!0});var Wr=s(pe);Va=i(Wr,"models page"),Wr.forEach(l),Xa=i(C,"."),C.forEach(l),Dl=h(t),Se=o(t,"P",{});var Yr=s(Se);za=i(Yr,"All models on the Hub come up with useful features"),Yr.forEach(l),Il=h(t),f=o(t,"OL",{});var M=s(f);kt=o(M,"LI",{});var Fr=s(kt);Ba=i(Fr,"An automatically generated model card with label scheme, metrics, components, and more."),Fr.forEach(l),Ra=h(M),Ct=o(M,"LI",{});var Vr=s(Ct);Qa=i(Vr,"An evaluation sections at top right where you can look at the metrics."),Vr.forEach(l),qa=h(M),At=o(M,"LI",{});var Xr=s(At);Ka=i(Xr,"Metadata tags that help for discoverability and contain information such as license and language."),Xr.forEach(l),eo=h(M),Tt=o(M,"LI",{});var zr=s(Tt);to=i(zr,"An interactive widget you can use to play out with the model directly in the browser"),zr.forEach(l),lo=h(M),Mt=o(M,"LI",{});var Br=s(Mt);ao=i(Br,"An Inference API that allows to make inference requests."),Br.forEach(l),M.forEach(l),Ll=h(t),P=o(t,"DIV",{class:!0});var ha=s(P);Ze=o(ha,"IMG",{class:!0,src:!0}),oo=h(ha),We=o(ha,"IMG",{class:!0,src:!0}),ha.forEach(l),Nl=h(t),O=o(t,"H2",{class:!0});var da=s(O);K=o(da,"A",{id:!0,class:!0,href:!0});var Rr=s(K);Ut=o(Rr,"SPAN",{});var Qr=s(Ut);v(ue.$$.fragment,Qr),Qr.forEach(l),Rr.forEach(l),so=h(da),Dt=o(da,"SPAN",{});var qr=s(Dt);ro=i(qr,"Using existing models"),qr.forEach(l),da.forEach(l),xl=h(t),ee=o(t,"P",{});var pa=s(ee);io=i(pa,"All "),It=o(pa,"CODE",{});var Kr=s(It);no=i(Kr,"spaCy"),Kr.forEach(l),co=i(pa," models from the Hub can be directly installed using pip install."),pa.forEach(l),Hl=h(t),v(fe.$$.fragment,t),Pl=h(t),A=o(t,"P",{});var st=s(A);ho=i(st,"To find the link of interest, you can go to a repository with a "),Lt=o(st,"CODE",{});var ei=s(Lt);po=i(ei,"spaCy"),ei.forEach(l),uo=i(st," model. When you open the repository, you can click "),Nt=o(st,"CODE",{});var ti=s(Nt);fo=i(ti,"Use in spaCy"),ti.forEach(l),mo=i(st," and you will be given a working snippet that you can use to install and load the model!"),st.forEach(l),Ol=h(t),J=o(t,"DIV",{class:!0});var ua=s(J);Ye=o(ua,"IMG",{class:!0,src:!0}),yo=h(ua),Fe=o(ua,"IMG",{class:!0,src:!0}),ua.forEach(l),Jl=h(t),j=o(t,"DIV",{class:!0});var fa=s(j);Ve=o(fa,"IMG",{class:!0,src:!0}),go=h(fa),Xe=o(fa,"IMG",{class:!0,src:!0}),fa.forEach(l),jl=h(t),ze=o(t,"P",{});var li=s(ze);vo=i(li,"Once installed, you can load the model as any spaCy pipeline."),li.forEach(l),Gl=h(t),v(me.$$.fragment,t),Sl=h(t),G=o(t,"H2",{class:!0});var ma=s(G);te=o(ma,"A",{id:!0,class:!0,href:!0});var ai=s(te);xt=o(ai,"SPAN",{});var oi=s(xt);v(ye.$$.fragment,oi),oi.forEach(l),ai.forEach(l),_o=h(ma),Ht=o(ma,"SPAN",{});var si=s(Ht);wo=i(si,"Sharing your models"),si.forEach(l),ma.forEach(l),Zl=h(t),S=o(t,"H3",{class:!0});var ya=s(S);le=o(ya,"A",{id:!0,class:!0,href:!0});var ri=s(le);Pt=o(ri,"SPAN",{});var ii=s(Pt);v(ge.$$.fragment,ii),ii.forEach(l),ri.forEach(l),bo=h(ya),Ot=o(ya,"SPAN",{});var ni=s(Ot);Eo=i(ni,"Using the spaCy CLI (recommended)"),ni.forEach(l),ya.forEach(l),Wl=h(t),T=o(t,"P",{});var rt=s(T);$o=i(rt,"The "),Jt=o(rt,"CODE",{});var ci=s(Jt);ko=i(ci,"spacy-huggingface-hub"),ci.forEach(l),Co=i(rt," library extends "),jt=o(rt,"CODE",{});var hi=s(jt);Ao=i(hi,"spaCy"),hi.forEach(l),To=i(rt," native CLI so people can easily push their packaged models to the Hub."),rt.forEach(l),Yl=h(t),Be=o(t,"P",{});var di=s(Be);Mo=i(di,"You can install spacy-huggingface-hub from pip:"),di.forEach(l),Fl=h(t),v(ve.$$.fragment,t),Vl=h(t),Re=o(t,"P",{});var pi=s(Re);Uo=i(pi,"You can then check if the command has been registered successfully"),pi.forEach(l),Xl=h(t),v(_e.$$.fragment,t),zl=h(t),ae=o(t,"P",{});var ga=s(ae);Do=i(ga,"To push with the CLI, you can use the "),Gt=o(ga,"CODE",{});var ui=s(Gt);Io=i(ui,"huggingface-hub push"),ui.forEach(l),Lo=i(ga," command as seen below."),ga.forEach(l),Bl=h(t),v(we.$$.fragment,t),Rl=h(t),oe=o(t,"TABLE",{});var va=s(oe);St=o(va,"THEAD",{});var fi=s(St);Z=o(fi,"TR",{});var it=s(Z);Zt=o(it,"TH",{});var mi=s(Zt);No=i(mi,"Argument"),mi.forEach(l),xo=h(it),Wt=o(it,"TH",{});var yi=s(Wt);Ho=i(yi,"Type"),yi.forEach(l),Po=h(it),Yt=o(it,"TH",{});var gi=s(Yt);Oo=i(gi,"Description"),gi.forEach(l),it.forEach(l),fi.forEach(l),Jo=h(va),$=o(va,"TBODY",{});var U=s($);W=o(U,"TR",{});var nt=s(W);Ft=o(nt,"TD",{});var vi=s(Ft);Vt=o(vi,"CODE",{});var _i=s(Vt);jo=i(_i,"whl_path"),_i.forEach(l),vi.forEach(l),Go=h(nt),Qe=o(nt,"TD",{});var vr=s(Qe);So=i(vr,"str / "),Xt=o(vr,"CODE",{});var wi=s(Xt);Zo=i(wi,"Path"),wi.forEach(l),vr.forEach(l),Wo=h(nt),Y=o(nt,"TD",{});var ct=s(Y);Yo=i(ct,"The path to the "),zt=o(ct,"CODE",{});var bi=s(zt);Fo=i(bi,".whl"),bi.forEach(l),Vo=i(ct," file packaged with "),be=o(ct,"A",{href:!0,rel:!0});var Ei=s(be);Bt=o(Ei,"CODE",{});var $i=s(Bt);Xo=i($i,"spacy package"),$i.forEach(l),Ei.forEach(l),zo=i(ct,"."),ct.forEach(l),nt.forEach(l),Bo=h(U),F=o(U,"TR",{});var ht=s(F);Ee=o(ht,"TD",{});var _a=s(Ee);Rt=o(_a,"CODE",{});var ki=s(Rt);Ro=i(ki,"--org"),ki.forEach(l),Qo=i(_a,", "),Qt=o(_a,"CODE",{});var Ci=s(Qt);qo=i(Ci,"-o"),Ci.forEach(l),_a.forEach(l),Ko=h(ht),qt=o(ht,"TD",{});var Ai=s(qt);es=i(Ai,"str"),Ai.forEach(l),ts=h(ht),Kt=o(ht,"TD",{});var Ti=s(Kt);ls=i(Ti,"Optional name of organization to which the pipeline should be uploaded."),Ti.forEach(l),ht.forEach(l),as=h(U),V=o(U,"TR",{});var dt=s(V);$e=o(dt,"TD",{});var wa=s($e);el=o(wa,"CODE",{});var Mi=s(el);os=i(Mi,"--msg"),Mi.forEach(l),ss=i(wa,", "),tl=o(wa,"CODE",{});var Ui=s(tl);rs=i(Ui,"-m"),Ui.forEach(l),wa.forEach(l),is=h(dt),ll=o(dt,"TD",{});var Di=s(ll);ns=i(Di,"str"),Di.forEach(l),cs=h(dt),ke=o(dt,"TD",{});var ba=s(ke);hs=i(ba,"Commit message to use for update. Defaults to "),al=o(ba,"CODE",{});var Ii=s(al);ds=i(Ii,'"Update spaCy pipeline"'),Ii.forEach(l),ps=i(ba,"."),ba.forEach(l),dt.forEach(l),us=h(U),X=o(U,"TR",{});var pt=s(X);Ce=o(pt,"TD",{});var Ea=s(Ce);ol=o(Ea,"CODE",{});var Li=s(ol);fs=i(Li,"--local-repo"),Li.forEach(l),ms=i(Ea,", "),sl=o(Ea,"CODE",{});var Ni=s(sl);ys=i(Ni,"-l"),Ni.forEach(l),Ea.forEach(l),gs=h(pt),qe=o(pt,"TD",{});var _r=s(qe);vs=i(_r,"str / "),rl=o(_r,"CODE",{});var xi=s(rl);_s=i(xi,"Path"),xi.forEach(l),_r.forEach(l),ws=h(pt),Ae=o(pt,"TD",{});var $a=s(Ae);bs=i($a,"Local path to the model repository (will be created if it doesn\u2019t exist). Defaults to "),il=o($a,"CODE",{});var Hi=s(il);Es=i(Hi,"hub"),Hi.forEach(l),$s=i($a," in the current working directory."),$a.forEach(l),pt.forEach(l),ks=h(U),z=o(U,"TR",{});var ut=s(z);Te=o(ut,"TD",{});var ka=s(Te);nl=o(ka,"CODE",{});var Pi=s(nl);Cs=i(Pi,"--verbose"),Pi.forEach(l),As=i(ka,", "),cl=o(ka,"CODE",{});var Oi=s(cl);Ts=i(Oi,"-V"),Oi.forEach(l),ka.forEach(l),Ms=h(ut),hl=o(ut,"TD",{});var Ji=s(hl);Us=i(Ji,"bool"),Ji.forEach(l),Ds=h(ut),dl=o(ut,"TD",{});var ji=s(dl);Is=i(ji,"Output additional info for debugging, e.g. the full generated hub metadata."),ji.forEach(l),ut.forEach(l),U.forEach(l),va.forEach(l),Ql=h(t),m=o(t,"P",{});var D=s(m);Ls=i(D,"You can then upload any pipeline packaged with "),Me=o(D,"A",{href:!0,rel:!0});var Gi=s(Me);pl=o(Gi,"CODE",{});var Si=s(pl);Ns=i(Si,"spacy package"),Si.forEach(l),Gi.forEach(l),xs=i(D,". Make sure to set "),ul=o(D,"CODE",{});var Zi=s(ul);Hs=i(Zi,"--build wheel"),Zi.forEach(l),Ps=i(D," to output a binary .whl file. The uploader will read all metadata from the pipeline package, including the auto-generated pretty "),fl=o(D,"CODE",{});var Wi=s(fl);Os=i(Wi,"README.md"),Wi.forEach(l),Js=i(D," and the model details available in the "),ml=o(D,"CODE",{});var Yi=s(ml);js=i(Yi,"meta.json"),Yi.forEach(l),Gs=i(D,"."),D.forEach(l),ql=h(t),v(Ue.$$.fragment,t),Kl=h(t),Ke=o(t,"P",{});var Fi=s(Ke);Ss=i(Fi,"In just a minute, you can get your packaged model in the Hub, try it out directly in the browser, and share it with the rest of the community. All the required metadata will be uploaded for you and you even get a cool model card."),Fi.forEach(l),ea=h(t),et=o(t,"P",{});var Vi=s(et);Zs=i(Vi,"The command will output two things:"),Vi.forEach(l),ta=h(t),se=o(t,"UL",{});var Ca=s(se);tt=o(Ca,"LI",{});var wr=s(tt);Ws=i(wr,"Where to find your repo in the Hub! For example, "),De=o(wr,"A",{href:!0,rel:!0});var Xi=s(De);Ys=i(Xi,"https://huggingface.co/spacy/en_core_web_sm"),Xi.forEach(l),wr.forEach(l),Fs=h(Ca),yl=o(Ca,"LI",{});var zi=s(yl);Vs=i(zi,"And how to install the pipeline directly from the Hub!"),zi.forEach(l),Ca.forEach(l),la=h(t),B=o(t,"H3",{class:!0});var Aa=s(B);re=o(Aa,"A",{id:!0,class:!0,href:!0});var Bi=s(re);gl=o(Bi,"SPAN",{});var Ri=s(gl);v(Ie.$$.fragment,Ri),Ri.forEach(l),Bi.forEach(l),Xs=h(Aa),vl=o(Aa,"SPAN",{});var Qi=s(vl);zs=i(Qi,"From a Python script"),Qi.forEach(l),Aa.forEach(l),aa=h(t),y=o(t,"P",{});var I=s(y);Bs=i(I,"You can use the "),_l=o(I,"CODE",{});var qi=s(_l);Rs=i(qi,"push"),qi.forEach(l),Qs=i(I," function from Python. It returns a dictionary containing the "),wl=o(I,"CODE",{});var Ki=s(wl);qs=i(Ki,'"url"'),Ki.forEach(l),Ks=i(I," and \u201D"),bl=o(I,"CODE",{});var en=s(bl);er=i(en,"whl_url"),en.forEach(l),tr=i(I,"\u201D of the published model and the wheel file, which you can later install with "),El=o(I,"CODE",{});var tn=s(El);lr=i(tn,"pip install"),tn.forEach(l),ar=i(I,"."),I.forEach(l),oa=h(t),v(Le.$$.fragment,t),sa=h(t),R=o(t,"H2",{class:!0});var Ta=s(R);ie=o(Ta,"A",{id:!0,class:!0,href:!0});var ln=s(ie);$l=o(ln,"SPAN",{});var an=s($l);v(Ne.$$.fragment,an),an.forEach(l),ln.forEach(l),or=h(Ta),kl=o(Ta,"SPAN",{});var on=s(kl);sr=i(on,"Additional resources"),on.forEach(l),Ta.forEach(l),ra=h(t),k=o(t,"UL",{});var ne=s(k);xe=o(ne,"LI",{});var Ma=s(xe);rr=i(Ma,"spacy-huggingface-hub "),He=o(Ma,"A",{href:!0,rel:!0});var sn=s(He);ir=i(sn,"library"),sn.forEach(l),nr=i(Ma,"."),Ma.forEach(l),cr=h(ne),lt=o(ne,"LI",{});var br=s(lt);hr=i(br,"Launch "),Pe=o(br,"A",{href:!0,rel:!0});var rn=s(Pe);dr=i(rn,"blog post"),rn.forEach(l),br.forEach(l),pr=h(ne),at=o(ne,"LI",{});var Er=s(at);ur=i(Er,"spaCy v 3.1 "),Oe=o(Er,"A",{href:!0,rel:!0});var nn=s(Oe);fr=i(nn,"Announcement"),nn.forEach(l),Er.forEach(l),mr=h(ne),ot=o(ne,"LI",{});var $r=s(ot);yr=i($r,"spaCy "),Je=o($r,"A",{href:!0,rel:!0});var cn=s(Je);gr=i(cn,"documentation"),cn.forEach(l),$r.forEach(l),ne.forEach(l),this.h()},h(){d(L,"name","hf:doc:metadata"),d(L,"content",JSON.stringify(gn)),d(Q,"id","using-spacy-at-hugging-face"),d(Q,"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(Q,"href","#using-spacy-at-hugging-face"),d(N,"class","relative group"),d(q,"id","exploring-spacy-models-in-the-hub"),d(q,"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(q,"href","#exploring-spacy-models-in-the-hub"),d(H,"class","relative group"),d(de,"href","https://huggingface.co/spacy"),d(de,"rel","nofollow"),d(pe,"href","https://huggingface.co/models?library=spacy"),d(pe,"rel","nofollow"),d(Ze,"class","block dark:hidden"),ft(Ze.src,Cr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-spacy_widget.png")||d(Ze,"src",Cr),d(We,"class","hidden dark:block"),ft(We.src,Ar="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-spacy_widget-dark.png")||d(We,"src",Ar),d(P,"class","flex justify-center"),d(K,"id","using-existing-models"),d(K,"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(K,"href","#using-existing-models"),d(O,"class","relative group"),d(Ye,"class","block dark:hidden"),ft(Ye.src,Tr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-spacy_snippet.png")||d(Ye,"src",Tr),d(Fe,"class","hidden dark:block"),ft(Fe.src,Mr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-spacy_snippet-dark.png")||d(Fe,"src",Mr),d(J,"class","flex justify-center"),d(Ve,"class","block dark:hidden"),ft(Ve.src,Ur="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-spacy_snippet2.png")||d(Ve,"src",Ur),d(Xe,"class","hidden dark:block"),ft(Xe.src,Dr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-spacy_snippet2-dark.png")||d(Xe,"src",Dr),d(j,"class","flex justify-center"),d(te,"id","sharing-your-models"),d(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"),d(te,"href","#sharing-your-models"),d(G,"class","relative group"),d(le,"id","using-the-spacy-cli-recommended"),d(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"),d(le,"href","#using-the-spacy-cli-recommended"),d(S,"class","relative group"),d(be,"href","https://spacy.io/api/cli#package"),d(be,"rel","nofollow"),d(Me,"href","https://spacy.io/api/cli#package"),d(Me,"rel","nofollow"),d(De,"href","https://huggingface.co/spacy/en_core_web_sm"),d(De,"rel","nofollow"),d(re,"id","from-a-python-script"),d(re,"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(re,"href","#from-a-python-script"),d(B,"class","relative group"),d(ie,"id","additional-resources"),d(ie,"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(ie,"href","#additional-resources"),d(R,"class","relative group"),d(He,"href","https://github.com/explosion/spacy-huggingface-hub"),d(He,"rel","nofollow"),d(Pe,"href","https://huggingface.co/blog/spacy"),d(Pe,"rel","nofollow"),d(Oe,"href","https://explosion.ai/blog/spacy-v3-1#huggingface-hub"),d(Oe,"rel","nofollow"),d(Je,"href","https://spacy.io/universe/project/spacy-huggingface-hub/"),d(Je,"rel","nofollow")},m(t,n){e(document.head,L),p(t,Al,n),p(t,N,n),e(N,Q),e(Q,mt),_(ce,mt,null),e(N,Ua),e(N,yt),e(yt,Da),p(t,Tl,n),p(t,x,n),e(x,gt),e(gt,Ia),e(x,La),e(x,vt),e(vt,Na),e(x,xa),p(t,Ml,n),p(t,H,n),e(H,q),e(q,_t),_(he,_t,null),e(H,Ha),e(H,wt),e(wt,Pa),p(t,Ul,n),p(t,u,n),e(u,Oa),e(u,bt),e(bt,Ja),e(u,ja),e(u,Et),e(Et,Ga),e(u,Sa),e(u,de),e(de,Za),e(u,Wa),e(u,$t),e($t,Ya),e(u,Fa),e(u,pe),e(pe,Va),e(u,Xa),p(t,Dl,n),p(t,Se,n),e(Se,za),p(t,Il,n),p(t,f,n),e(f,kt),e(kt,Ba),e(f,Ra),e(f,Ct),e(Ct,Qa),e(f,qa),e(f,At),e(At,Ka),e(f,eo),e(f,Tt),e(Tt,to),e(f,lo),e(f,Mt),e(Mt,ao),p(t,Ll,n),p(t,P,n),e(P,Ze),e(P,oo),e(P,We),p(t,Nl,n),p(t,O,n),e(O,K),e(K,Ut),_(ue,Ut,null),e(O,so),e(O,Dt),e(Dt,ro),p(t,xl,n),p(t,ee,n),e(ee,io),e(ee,It),e(It,no),e(ee,co),p(t,Hl,n),_(fe,t,n),p(t,Pl,n),p(t,A,n),e(A,ho),e(A,Lt),e(Lt,po),e(A,uo),e(A,Nt),e(Nt,fo),e(A,mo),p(t,Ol,n),p(t,J,n),e(J,Ye),e(J,yo),e(J,Fe),p(t,Jl,n),p(t,j,n),e(j,Ve),e(j,go),e(j,Xe),p(t,jl,n),p(t,ze,n),e(ze,vo),p(t,Gl,n),_(me,t,n),p(t,Sl,n),p(t,G,n),e(G,te),e(te,xt),_(ye,xt,null),e(G,_o),e(G,Ht),e(Ht,wo),p(t,Zl,n),p(t,S,n),e(S,le),e(le,Pt),_(ge,Pt,null),e(S,bo),e(S,Ot),e(Ot,Eo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e(m,Me),e(Me,pl),e(pl,Ns),e(m,xs),e(m,ul),e(ul,Hs),e(m,Ps),e(m,fl),e(fl,Os),e(m,Js),e(m,ml),e(ml,js),e(m,Gs),p(t,ql,n),_(Ue,t,n),p(t,Kl,n),p(t,Ke,n),e(Ke,Ss),p(t,ea,n),p(t,et,n),e(et,Zs),p(t,ta,n),p(t,se,n),e(se,tt),e(tt,Ws),e(tt,De),e(De,Ys),e(se,Fs),e(se,yl),e(yl,Vs),p(t,la,n),p(t,B,n),e(B,re),e(re,gl),_(Ie,gl,null),e(B,Xs),e(B,vl),e(vl,zs),p(t,aa,n),p(t,y,n),e(y,Bs),e(y,_l),e(_l,Rs),e(y,Qs),e(y,wl),e(wl,qs),e(y,Ks),e(y,bl),e(bl,er),e(y,tr),e(y,El),e(El,lr),e(y,ar),p(t,oa,n),_(Le,t,n),p(t,sa,n),p(t,R,n),e(R,ie),e(ie,$l),_(Ne,$l,null),e(R,or),e(R,kl),e(kl,sr),p(t,ra,n),p(t,k,n),e(k,xe),e(xe,rr),e(xe,He),e(He,ir),e(xe,nr),e(k,cr),e(k,lt),e(lt,hr),e(lt,Pe),e(Pe,dr),e(k,pr),e(k,at),e(at,ur),e(at,Oe),e(Oe,fr),e(k,mr),e(k,ot),e(ot,yr),e(ot,Je),e(Je,gr),ia=!0},p:fn,i(t){ia||(w(ce.$$.fragment,t),w(he.$$.fragment,t),w(ue.$$.fragment,t),w(fe.$$.fragment,t),w(me.$$.fragment,t),w(ye.$$.fragment,t),w(ge.$$.fragment,t),w(ve.$$.fragment,t),w(_e.$$.fragment,t),w(we.$$.fragment,t),w(Ue.$$.fragment,t),w(Ie.$$.fragment,t),w(Le.$$.fragment,t),w(Ne.$$.fragment,t),ia=!0)},o(t){b(ce.$$.fragment,t),b(he.$$.fragment,t),b(ue.$$.fragment,t),b(fe.$$.fragment,t),b(me.$$.fragment,t),b(ye.$$.fragment,t),b(ge.$$.fragment,t),b(ve.$$.fragment,t),b(_e.$$.fragment,t),b(we.$$.fragment,t),b(Ue.$$.fragment,t),b(Ie.$$.fragment,t),b(Le.$$.fragment,t),b(Ne.$$.fragment,t),ia=!1},d(t){l(L),t&&l(Al),t&&l(N),E(ce),t&&l(Tl),t&&l(x),t&&l(Ml),t&&l(H),E(he),t&&l(Ul),t&&l(u),t&&l(Dl),t&&l(Se),t&&l(Il),t&&l(f),t&&l(Ll),t&&l(P),t&&l(Nl),t&&l(O),E(ue),t&&l(xl),t&&l(ee),t&&l(Hl),E(fe,t),t&&l(Pl),t&&l(A),t&&l(Ol),t&&l(J),t&&l(Jl),t&&l(j),t&&l(jl),t&&l(ze),t&&l(Gl),E(me,t),t&&l(Sl),t&&l(G),E(ye),t&&l(Zl),t&&l(S),E(ge),t&&l(Wl),t&&l(T),t&&l(Yl),t&&l(Be),t&&l(Fl),E(ve,t),t&&l(Vl),t&&l(Re),t&&l(Xl),E(_e,t),t&&l(zl),t&&l(ae),t&&l(Bl),E(we,t),t&&l(Rl),t&&l(oe),t&&l(Ql),t&&l(m),t&&l(ql),E(Ue,t),t&&l(Kl),t&&l(Ke),t&&l(ea),t&&l(et),t&&l(ta),t&&l(se),t&&l(la),t&&l(B),E(Ie),t&&l(aa),t&&l(y),t&&l(oa),E(Le,t),t&&l(sa),t&&l(R),E(Ne),t&&l(ra),t&&l(k)}}}const gn={local:"using-spacy-at-hugging-face",sections:[{local:"exploring-spacy-models-in-the-hub",title:"Exploring spaCy models in the Hub"},{local:"using-existing-models",title:"Using existing models"},{local:"sharing-your-models",sections:[{local:"using-the-spacy-cli-recommended",title:"Using the spaCy CLI (recommended)"},{local:"from-a-python-script",title:"From a Python script"}],title:"Sharing your models"},{local:"additional-resources",title:"Additional resources"}],title:"Using spaCy at Hugging Face"};function vn(kr){return mn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class En extends hn{constructor(L){super();dn(this,L,vn,yn,pn,{})}}export{En as default,gn as metadata};
