import{S as Ns,i as Gs,s as Bs,e as o,k as n,w as E,t as s,N as Hs,c as a,d as l,m as h,a as r,x as g,h as i,b as c,P as Rl,G as e,g as p,y as w,L as Ls,q as b,o as T,B as $,v as js}from"../chunks/vendor-hf-doc-builder.js";import{I as Je}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as fr}from"../chunks/CodeBlock-hf-doc-builder.js";function Ss(ur){let I,Ft,P,O,Xe,oe,Zl,qe,Xl,Vt,ae,Ye,ql,Yl,Qt,A,W,Fe,re,Fl,Ve,Vl,Kt,y,Ql,Qe,Kl,eo,se,to,lo,el,Ue,oo,tl,u,Ke,ao,ro,et,so,io,tt,no,ho,lt,co,ll,J,ke,mr,po,Ce,vr,ol,U,z,ot,ie,fo,at,uo,al,m,mo,rt,vo,_o,st,yo,Eo,it,go,wo,rl,ne,sl,R,bo,nt,To,$o,il,k,De,_r,Io,Me,yr,nl,C,Z,ht,he,Po,dt,Ao,hl,v,Jo,de,ct,Uo,ko,pt,Co,Do,ft,Mo,xo,dl,D,X,ut,ce,No,mt,Go,cl,q,Bo,vt,Ho,Lo,pl,pe,fl,Y,_t,M,yt,jo,So,Et,Oo,Wo,gt,zo,Ro,f,x,fe,wt,Zo,Xo,bt,qo,Yo,xe,Fo,Tt,Vo,Qo,$t,Ko,ea,N,ue,It,ta,la,Pt,oa,aa,At,ra,sa,Jt,ia,na,G,me,Ut,ha,da,kt,ca,pa,Ne,fa,Ct,ua,ma,Dt,va,_a,B,ve,Mt,ya,Ea,xt,ga,wa,Ge,ba,Nt,Ta,$a,Gt,Ia,Pa,H,_e,Bt,Aa,Ja,Ht,Ua,ka,Be,Ca,Lt,Da,Ma,ye,xa,jt,Na,Ga,Ba,L,Ee,St,Ha,La,Ot,ja,Sa,Wt,Oa,Wa,ge,za,zt,Ra,Za,ul,j,F,Rt,we,Xa,Zt,qa,ml,V,Ya,Xt,Fa,Va,vl,be,_l,He,Qa,yl,S,Q,qt,Te,Ka,Yt,er,El,K,$e,tr,Ie,lr,or,ar,Pe,rr,Ae,sr,ir,gl;return oe=new Je({}),re=new Je({}),ie=new Je({}),ne=new fr({props:{code:"aW1wb3J0JTIwYWxsZW5ubHBfbW9kZWxzJTBBZnJvbSUyMGFsbGVubmxwLnByZWRpY3RvcnMucHJlZGljdG9yJTIwaW1wb3J0JTIwUHJlZGljdG9yJTBBJTBBcHJlZGljdG9yJTIwJTNEJTIwUHJlZGljdG9yLmZyb21fcGF0aCglMjJoZiUzQSUyRiUyRmFsbGVuYWklMkZiaWRhZi1lbG1vJTIyKSUwQXByZWRpY3Rvcl9pbnB1dCUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMnBhc3NhZ2UlMjIlM0ElMjAlMjJNeSUyMG5hbWUlMjBpcyUyMFdvbGZnYW5nJTIwYW5kJTIwSSUyMGxpdmUlMjBpbiUyMEJlcmxpbiUyMiUyQyUyMCUwQSUyMCUyMCUyMCUyMCUyMnF1ZXN0aW9uJTIyJTNBJTIwJTIyV2hlcmUlMjBkbyUyMEklMjBsaXZlJTNGJTIyJTBBJTdEJTBBcHJlZGljdGlvbnMlMjAlM0QlMjBwcmVkaWN0b3IucHJlZGljdF9qc29uKHByZWRpY3Rvcl9pbnB1dCk=",highlighted:`<span class="hljs-keyword">import</span> allennlp_models
<span class="hljs-keyword">from</span> allennlp.predictors.predictor <span class="hljs-keyword">import</span> Predictor

predictor = Predictor.from_path(<span class="hljs-string">&quot;hf://allenai/bidaf-elmo&quot;</span>)
predictor_input = {
    <span class="hljs-string">&quot;passage&quot;</span>: <span class="hljs-string">&quot;My name is Wolfgang and I live in Berlin&quot;</span>, 
    <span class="hljs-string">&quot;question&quot;</span>: <span class="hljs-string">&quot;Where do I live?&quot;</span>
}
predictions = predictor.predict_json(predictor_input)`}}),he=new Je({}),ce=new Je({}),pe=new fr({props:{code:"YWxsZW5ubHAlMjBwdXNoX3RvX2hmJTIwLS1yZXBvX25hbWUlMjB0ZXN0X2FsbGVubmxwJTIwLS1hcmNoaXZlX3BhdGglMjBtb2RlbCUyMA==",highlighted:"allennlp push_to_hf --repo_name test_allennlp --archive_path model "}}),we=new Je({}),be=new fr({props:{code:"ZnJvbSUyMGFsbGVubmxwLmNvbW1vbi5wdXNoX3RvX2hmJTIwaW1wb3J0JTIwcHVzaF90b19oZiUwQSUwQXNlcmlhbGl6YXRpb25fZGlyJTIwJTNEJTIwJTIycGF0aCUyRnRvJTJGc2VyaWFsaXphdGlvbiUyRmRpcmVjdG9yeSUyMiUwQXB1c2hfdG9faGYoJTBBJTIwJTIwJTIwJTIwcmVwb19uYW1lJTNEJTIybXlfcmVwb19uYW1lJTIyJTJDJTBBJTIwJTIwJTIwJTIwc2VyaWFsaXphdGlvbl9kaXIlM0RzZXJpYWxpemF0aW9uX2RpciUyQyUwQSUyMCUyMCUyMCUyMGxvY2FsX3JlcG9fcGF0aCUzRHNlbGYubG9jYWxfcmVwb19wYXRoJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> allennlp.common.push_to_hf <span class="hljs-keyword">import</span> push_to_hf

serialization_dir = <span class="hljs-string">&quot;path/to/serialization/directory&quot;</span>
push_to_hf(
    repo_name=<span class="hljs-string">&quot;my_repo_name&quot;</span>,
    serialization_dir=serialization_dir,
    local_repo_path=self.local_repo_path
)`}}),Te=new Je({}),{c(){I=o("meta"),Ft=n(),P=o("h1"),O=o("a"),Xe=o("span"),E(oe.$$.fragment),Zl=n(),qe=o("span"),Xl=s("Using AllenNLP at Hugging Face"),Vt=n(),ae=o("p"),Ye=o("code"),ql=s("allennlp"),Yl=s(" is a NLP library for developing state-of-the-art models on different linguistic tasks. It provides high-level abstractions and APIs for common components and models in modern NLP. It also provides an extensible framework that makes it easy to run and manage NLP experiments."),Qt=n(),A=o("h2"),W=o("a"),Fe=o("span"),E(re.$$.fragment),Fl=n(),Ve=o("span"),Vl=s("Exploring allennlp in the Hub"),Kt=n(),y=o("p"),Ql=s("You can find "),Qe=o("code"),Kl=s("allennlp"),eo=s(" models on the Hub by filtering at the left of the "),se=o("a"),to=s("models page"),lo=s("."),el=n(),Ue=o("p"),oo=s("All models on the Hub come up with useful features"),tl=n(),u=o("ol"),Ke=o("li"),ao=s("A training metrics tab with automatically hosted TensorBoard traces."),ro=n(),et=o("li"),so=s("Metadata tags that help for discoverability."),io=n(),tt=o("li"),no=s("An interactive widget you can use to play out with the model directly in the browser."),ho=n(),lt=o("li"),co=s("An Inference API that allows to make inference requests."),ll=n(),J=o("div"),ke=o("img"),po=n(),Ce=o("img"),ol=n(),U=o("h2"),z=o("a"),ot=o("span"),E(ie.$$.fragment),fo=n(),at=o("span"),uo=s("Using existing models"),al=n(),m=o("p"),mo=s("You can use the "),rt=o("code"),vo=s("Predictor"),_o=s(" class to load existing models on the Hub. To achieve this, use the "),st=o("code"),yo=s("from_path"),Eo=s(" method and use the "),it=o("code"),go=s('"hf://"'),wo=s(" prefix with the repository id. Here is an end-to-end example."),rl=n(),E(ne.$$.fragment),sl=n(),R=o("p"),bo=s("To get a snippet such as this, you can click "),nt=o("code"),To=s("Use in AllenNLP"),$o=s(" at the top right,"),il=n(),k=o("div"),De=o("img"),Io=n(),Me=o("img"),nl=n(),C=o("h2"),Z=o("a"),ht=o("span"),E(he.$$.fragment),Po=n(),dt=o("span"),Ao=s("Sharing your models"),hl=n(),v=o("p"),Jo=s("The first step is to save the model locally. For example, you can use the "),de=o("a"),ct=o("code"),Uo=s("archive_model"),ko=s(" method to save the model as a "),pt=o("code"),Co=s("model.tar.gz"),Do=s(" file. You can then push the zipped model to the Hub. When you train a model with "),ft=o("code"),Mo=s("allennlp"),xo=s(", the model is automatically serialized so you can use that as a preferred option."),dl=n(),D=o("h3"),X=o("a"),ut=o("span"),E(ce.$$.fragment),No=n(),mt=o("span"),Go=s("Using the AllenNLP CLI"),cl=n(),q=o("p"),Bo=s("To push with the CLI, you can use the "),vt=o("code"),Ho=s("allennlp push_to_hf"),Lo=s(" command as seen below."),pl=n(),E(pe.$$.fragment),fl=n(),Y=o("table"),_t=o("thead"),M=o("tr"),yt=o("th"),jo=s("Argument"),So=n(),Et=o("th"),Oo=s("Type"),Wo=n(),gt=o("th"),zo=s("Description"),Ro=n(),f=o("tbody"),x=o("tr"),fe=o("td"),wt=o("code"),Zo=s("--repo_name"),Xo=s(", "),bt=o("code"),qo=s("-n"),Yo=n(),xe=o("td"),Fo=s("str / "),Tt=o("code"),Vo=s("Path"),Qo=n(),$t=o("td"),Ko=s("Name of the repository on the Hub."),ea=n(),N=o("tr"),ue=o("td"),It=o("code"),ta=s("--organization"),la=s(", "),Pt=o("code"),oa=s("-o"),aa=n(),At=o("td"),ra=s("str"),sa=n(),Jt=o("td"),ia=s("Optional name of organization to which the pipeline should be uploaded."),na=n(),G=o("tr"),me=o("td"),Ut=o("code"),ha=s("--serialization-dir"),da=s(", "),kt=o("code"),ca=s("-s"),pa=n(),Ne=o("td"),fa=s("str / "),Ct=o("code"),ua=s("Path"),ma=n(),Dt=o("td"),va=s("Path to directory with the serialized model."),_a=n(),B=o("tr"),ve=o("td"),Mt=o("code"),ya=s("--archive-path"),Ea=s(", "),xt=o("code"),ga=s("-a"),wa=n(),Ge=o("td"),ba=s("str / "),Nt=o("code"),Ta=s("Path"),$a=n(),Gt=o("td"),Ia=s("If instead of a serialization path you\u2019re using a zipped model (e.g. model/model.tar.gz), you can use this flag."),Pa=n(),H=o("tr"),_e=o("td"),Bt=o("code"),Aa=s("--local-repo-path"),Ja=s(", "),Ht=o("code"),Ua=s("-l"),ka=n(),Be=o("td"),Ca=s("str / "),Lt=o("code"),Da=s("Path"),Ma=n(),ye=o("td"),xa=s("Local path to the model repository (will be created if it doesn\u2019t exist). Defaults to "),jt=o("code"),Na=s("hub"),Ga=s(" in the current working directory."),Ba=n(),L=o("tr"),Ee=o("td"),St=o("code"),Ha=s("--commit-message"),La=s(", "),Ot=o("code"),ja=s("-c"),Sa=n(),Wt=o("td"),Oa=s("str"),Wa=n(),ge=o("td"),za=s("Commit message to use for update. Defaults to "),zt=o("code"),Ra=s('"update repository"'),Za=s("."),ul=n(),j=o("h3"),F=o("a"),Rt=o("span"),E(we.$$.fragment),Xa=n(),Zt=o("span"),qa=s("From a Python script"),ml=n(),V=o("p"),Ya=s("The "),Xt=o("code"),Fa=s("push_to_hf"),Va=s(" function has the same parameters as the bash script."),vl=n(),E(be.$$.fragment),_l=n(),He=o("p"),Qa=s("In just a minute, you can get your 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!"),yl=n(),S=o("h2"),Q=o("a"),qt=o("span"),E(Te.$$.fragment),Ka=n(),Yt=o("span"),er=s("Additional resources"),El=n(),K=o("ul"),$e=o("li"),tr=s("AllenNLP "),Ie=o("a"),lr=s("website"),or=s("."),ar=n(),Pe=o("li"),rr=s("AllenNLP "),Ae=o("a"),sr=s("repository"),ir=s("."),this.h()},l(t){const d=Hs('[data-svelte="svelte-1phssyn"]',document.head);I=a(d,"META",{name:!0,content:!0}),d.forEach(l),Ft=h(t),P=a(t,"H1",{class:!0});var wl=r(P);O=a(wl,"A",{id:!0,class:!0,href:!0});var Er=r(O);Xe=a(Er,"SPAN",{});var gr=r(Xe);g(oe.$$.fragment,gr),gr.forEach(l),Er.forEach(l),Zl=h(wl),qe=a(wl,"SPAN",{});var wr=r(qe);Xl=i(wr,"Using AllenNLP at Hugging Face"),wr.forEach(l),wl.forEach(l),Vt=h(t),ae=a(t,"P",{});var nr=r(ae);Ye=a(nr,"CODE",{});var br=r(Ye);ql=i(br,"allennlp"),br.forEach(l),Yl=i(nr," is a NLP library for developing state-of-the-art models on different linguistic tasks. It provides high-level abstractions and APIs for common components and models in modern NLP. It also provides an extensible framework that makes it easy to run and manage NLP experiments."),nr.forEach(l),Qt=h(t),A=a(t,"H2",{class:!0});var bl=r(A);W=a(bl,"A",{id:!0,class:!0,href:!0});var Tr=r(W);Fe=a(Tr,"SPAN",{});var $r=r(Fe);g(re.$$.fragment,$r),$r.forEach(l),Tr.forEach(l),Fl=h(bl),Ve=a(bl,"SPAN",{});var Ir=r(Ve);Vl=i(Ir,"Exploring allennlp in the Hub"),Ir.forEach(l),bl.forEach(l),Kt=h(t),y=a(t,"P",{});var Le=r(y);Ql=i(Le,"You can find "),Qe=a(Le,"CODE",{});var Pr=r(Qe);Kl=i(Pr,"allennlp"),Pr.forEach(l),eo=i(Le," models on the Hub by filtering at the left of the "),se=a(Le,"A",{href:!0,rel:!0});var Ar=r(se);to=i(Ar,"models page"),Ar.forEach(l),lo=i(Le,"."),Le.forEach(l),el=h(t),Ue=a(t,"P",{});var Jr=r(Ue);oo=i(Jr,"All models on the Hub come up with useful features"),Jr.forEach(l),tl=h(t),u=a(t,"OL",{});var ee=r(u);Ke=a(ee,"LI",{});var Ur=r(Ke);ao=i(Ur,"A training metrics tab with automatically hosted TensorBoard traces."),Ur.forEach(l),ro=h(ee),et=a(ee,"LI",{});var kr=r(et);so=i(kr,"Metadata tags that help for discoverability."),kr.forEach(l),io=h(ee),tt=a(ee,"LI",{});var Cr=r(tt);no=i(Cr,"An interactive widget you can use to play out with the model directly in the browser."),Cr.forEach(l),ho=h(ee),lt=a(ee,"LI",{});var Dr=r(lt);co=i(Dr,"An Inference API that allows to make inference requests."),Dr.forEach(l),ee.forEach(l),ll=h(t),J=a(t,"DIV",{class:!0});var Tl=r(J);ke=a(Tl,"IMG",{class:!0,src:!0}),po=h(Tl),Ce=a(Tl,"IMG",{class:!0,src:!0}),Tl.forEach(l),ol=h(t),U=a(t,"H2",{class:!0});var $l=r(U);z=a($l,"A",{id:!0,class:!0,href:!0});var Mr=r(z);ot=a(Mr,"SPAN",{});var xr=r(ot);g(ie.$$.fragment,xr),xr.forEach(l),Mr.forEach(l),fo=h($l),at=a($l,"SPAN",{});var Nr=r(at);uo=i(Nr,"Using existing models"),Nr.forEach(l),$l.forEach(l),al=h(t),m=a(t,"P",{});var te=r(m);mo=i(te,"You can use the "),rt=a(te,"CODE",{});var Gr=r(rt);vo=i(Gr,"Predictor"),Gr.forEach(l),_o=i(te," class to load existing models on the Hub. To achieve this, use the "),st=a(te,"CODE",{});var Br=r(st);yo=i(Br,"from_path"),Br.forEach(l),Eo=i(te," method and use the "),it=a(te,"CODE",{});var Hr=r(it);go=i(Hr,'"hf://"'),Hr.forEach(l),wo=i(te," prefix with the repository id. Here is an end-to-end example."),te.forEach(l),rl=h(t),g(ne.$$.fragment,t),sl=h(t),R=a(t,"P",{});var Il=r(R);bo=i(Il,"To get a snippet such as this, you can click "),nt=a(Il,"CODE",{});var Lr=r(nt);To=i(Lr,"Use in AllenNLP"),Lr.forEach(l),$o=i(Il," at the top right,"),Il.forEach(l),il=h(t),k=a(t,"DIV",{class:!0});var Pl=r(k);De=a(Pl,"IMG",{class:!0,src:!0}),Io=h(Pl),Me=a(Pl,"IMG",{class:!0,src:!0}),Pl.forEach(l),nl=h(t),C=a(t,"H2",{class:!0});var Al=r(C);Z=a(Al,"A",{id:!0,class:!0,href:!0});var jr=r(Z);ht=a(jr,"SPAN",{});var Sr=r(ht);g(he.$$.fragment,Sr),Sr.forEach(l),jr.forEach(l),Po=h(Al),dt=a(Al,"SPAN",{});var Or=r(dt);Ao=i(Or,"Sharing your models"),Or.forEach(l),Al.forEach(l),hl=h(t),v=a(t,"P",{});var le=r(v);Jo=i(le,"The first step is to save the model locally. For example, you can use the "),de=a(le,"A",{href:!0,rel:!0});var Wr=r(de);ct=a(Wr,"CODE",{});var zr=r(ct);Uo=i(zr,"archive_model"),zr.forEach(l),Wr.forEach(l),ko=i(le," method to save the model as a "),pt=a(le,"CODE",{});var Rr=r(pt);Co=i(Rr,"model.tar.gz"),Rr.forEach(l),Do=i(le," file. You can then push the zipped model to the Hub. When you train a model with "),ft=a(le,"CODE",{});var Zr=r(ft);Mo=i(Zr,"allennlp"),Zr.forEach(l),xo=i(le,", the model is automatically serialized so you can use that as a preferred option."),le.forEach(l),dl=h(t),D=a(t,"H3",{class:!0});var Jl=r(D);X=a(Jl,"A",{id:!0,class:!0,href:!0});var Xr=r(X);ut=a(Xr,"SPAN",{});var qr=r(ut);g(ce.$$.fragment,qr),qr.forEach(l),Xr.forEach(l),No=h(Jl),mt=a(Jl,"SPAN",{});var Yr=r(mt);Go=i(Yr,"Using the AllenNLP CLI"),Yr.forEach(l),Jl.forEach(l),cl=h(t),q=a(t,"P",{});var Ul=r(q);Bo=i(Ul,"To push with the CLI, you can use the "),vt=a(Ul,"CODE",{});var Fr=r(vt);Ho=i(Fr,"allennlp push_to_hf"),Fr.forEach(l),Lo=i(Ul," command as seen below."),Ul.forEach(l),pl=h(t),g(pe.$$.fragment,t),fl=h(t),Y=a(t,"TABLE",{});var kl=r(Y);_t=a(kl,"THEAD",{});var Vr=r(_t);M=a(Vr,"TR",{});var je=r(M);yt=a(je,"TH",{});var Qr=r(yt);jo=i(Qr,"Argument"),Qr.forEach(l),So=h(je),Et=a(je,"TH",{});var Kr=r(Et);Oo=i(Kr,"Type"),Kr.forEach(l),Wo=h(je),gt=a(je,"TH",{});var es=r(gt);zo=i(es,"Description"),es.forEach(l),je.forEach(l),Vr.forEach(l),Ro=h(kl),f=a(kl,"TBODY",{});var _=r(f);x=a(_,"TR",{});var Se=r(x);fe=a(Se,"TD",{});var Cl=r(fe);wt=a(Cl,"CODE",{});var ts=r(wt);Zo=i(ts,"--repo_name"),ts.forEach(l),Xo=i(Cl,", "),bt=a(Cl,"CODE",{});var ls=r(bt);qo=i(ls,"-n"),ls.forEach(l),Cl.forEach(l),Yo=h(Se),xe=a(Se,"TD",{});var hr=r(xe);Fo=i(hr,"str / "),Tt=a(hr,"CODE",{});var os=r(Tt);Vo=i(os,"Path"),os.forEach(l),hr.forEach(l),Qo=h(Se),$t=a(Se,"TD",{});var as=r($t);Ko=i(as,"Name of the repository on the Hub."),as.forEach(l),Se.forEach(l),ea=h(_),N=a(_,"TR",{});var Oe=r(N);ue=a(Oe,"TD",{});var Dl=r(ue);It=a(Dl,"CODE",{});var rs=r(It);ta=i(rs,"--organization"),rs.forEach(l),la=i(Dl,", "),Pt=a(Dl,"CODE",{});var ss=r(Pt);oa=i(ss,"-o"),ss.forEach(l),Dl.forEach(l),aa=h(Oe),At=a(Oe,"TD",{});var is=r(At);ra=i(is,"str"),is.forEach(l),sa=h(Oe),Jt=a(Oe,"TD",{});var ns=r(Jt);ia=i(ns,"Optional name of organization to which the pipeline should be uploaded."),ns.forEach(l),Oe.forEach(l),na=h(_),G=a(_,"TR",{});var We=r(G);me=a(We,"TD",{});var Ml=r(me);Ut=a(Ml,"CODE",{});var hs=r(Ut);ha=i(hs,"--serialization-dir"),hs.forEach(l),da=i(Ml,", "),kt=a(Ml,"CODE",{});var ds=r(kt);ca=i(ds,"-s"),ds.forEach(l),Ml.forEach(l),pa=h(We),Ne=a(We,"TD",{});var dr=r(Ne);fa=i(dr,"str / "),Ct=a(dr,"CODE",{});var cs=r(Ct);ua=i(cs,"Path"),cs.forEach(l),dr.forEach(l),ma=h(We),Dt=a(We,"TD",{});var ps=r(Dt);va=i(ps,"Path to directory with the serialized model."),ps.forEach(l),We.forEach(l),_a=h(_),B=a(_,"TR",{});var ze=r(B);ve=a(ze,"TD",{});var xl=r(ve);Mt=a(xl,"CODE",{});var fs=r(Mt);ya=i(fs,"--archive-path"),fs.forEach(l),Ea=i(xl,", "),xt=a(xl,"CODE",{});var us=r(xt);ga=i(us,"-a"),us.forEach(l),xl.forEach(l),wa=h(ze),Ge=a(ze,"TD",{});var cr=r(Ge);ba=i(cr,"str / "),Nt=a(cr,"CODE",{});var ms=r(Nt);Ta=i(ms,"Path"),ms.forEach(l),cr.forEach(l),$a=h(ze),Gt=a(ze,"TD",{});var vs=r(Gt);Ia=i(vs,"If instead of a serialization path you\u2019re using a zipped model (e.g. model/model.tar.gz), you can use this flag."),vs.forEach(l),ze.forEach(l),Pa=h(_),H=a(_,"TR",{});var Re=r(H);_e=a(Re,"TD",{});var Nl=r(_e);Bt=a(Nl,"CODE",{});var _s=r(Bt);Aa=i(_s,"--local-repo-path"),_s.forEach(l),Ja=i(Nl,", "),Ht=a(Nl,"CODE",{});var ys=r(Ht);Ua=i(ys,"-l"),ys.forEach(l),Nl.forEach(l),ka=h(Re),Be=a(Re,"TD",{});var pr=r(Be);Ca=i(pr,"str / "),Lt=a(pr,"CODE",{});var Es=r(Lt);Da=i(Es,"Path"),Es.forEach(l),pr.forEach(l),Ma=h(Re),ye=a(Re,"TD",{});var Gl=r(ye);xa=i(Gl,"Local path to the model repository (will be created if it doesn\u2019t exist). Defaults to "),jt=a(Gl,"CODE",{});var gs=r(jt);Na=i(gs,"hub"),gs.forEach(l),Ga=i(Gl," in the current working directory."),Gl.forEach(l),Re.forEach(l),Ba=h(_),L=a(_,"TR",{});var Ze=r(L);Ee=a(Ze,"TD",{});var Bl=r(Ee);St=a(Bl,"CODE",{});var ws=r(St);Ha=i(ws,"--commit-message"),ws.forEach(l),La=i(Bl,", "),Ot=a(Bl,"CODE",{});var bs=r(Ot);ja=i(bs,"-c"),bs.forEach(l),Bl.forEach(l),Sa=h(Ze),Wt=a(Ze,"TD",{});var Ts=r(Wt);Oa=i(Ts,"str"),Ts.forEach(l),Wa=h(Ze),ge=a(Ze,"TD",{});var Hl=r(ge);za=i(Hl,"Commit message to use for update. Defaults to "),zt=a(Hl,"CODE",{});var $s=r(zt);Ra=i($s,'"update repository"'),$s.forEach(l),Za=i(Hl,"."),Hl.forEach(l),Ze.forEach(l),_.forEach(l),kl.forEach(l),ul=h(t),j=a(t,"H3",{class:!0});var Ll=r(j);F=a(Ll,"A",{id:!0,class:!0,href:!0});var Is=r(F);Rt=a(Is,"SPAN",{});var Ps=r(Rt);g(we.$$.fragment,Ps),Ps.forEach(l),Is.forEach(l),Xa=h(Ll),Zt=a(Ll,"SPAN",{});var As=r(Zt);qa=i(As,"From a Python script"),As.forEach(l),Ll.forEach(l),ml=h(t),V=a(t,"P",{});var jl=r(V);Ya=i(jl,"The "),Xt=a(jl,"CODE",{});var Js=r(Xt);Fa=i(Js,"push_to_hf"),Js.forEach(l),Va=i(jl," function has the same parameters as the bash script."),jl.forEach(l),vl=h(t),g(be.$$.fragment,t),_l=h(t),He=a(t,"P",{});var Us=r(He);Qa=i(Us,"In just a minute, you can get your 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!"),Us.forEach(l),yl=h(t),S=a(t,"H2",{class:!0});var Sl=r(S);Q=a(Sl,"A",{id:!0,class:!0,href:!0});var ks=r(Q);qt=a(ks,"SPAN",{});var Cs=r(qt);g(Te.$$.fragment,Cs),Cs.forEach(l),ks.forEach(l),Ka=h(Sl),Yt=a(Sl,"SPAN",{});var Ds=r(Yt);er=i(Ds,"Additional resources"),Ds.forEach(l),Sl.forEach(l),El=h(t),K=a(t,"UL",{});var Ol=r(K);$e=a(Ol,"LI",{});var Wl=r($e);tr=i(Wl,"AllenNLP "),Ie=a(Wl,"A",{href:!0,rel:!0});var Ms=r(Ie);lr=i(Ms,"website"),Ms.forEach(l),or=i(Wl,"."),Wl.forEach(l),ar=h(Ol),Pe=a(Ol,"LI",{});var zl=r(Pe);rr=i(zl,"AllenNLP "),Ae=a(zl,"A",{href:!0,rel:!0});var xs=r(Ae);sr=i(xs,"repository"),xs.forEach(l),ir=i(zl,"."),zl.forEach(l),Ol.forEach(l),this.h()},h(){c(I,"name","hf:doc:metadata"),c(I,"content",JSON.stringify(Os)),c(O,"id","using-allennlp-at-hugging-face"),c(O,"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"),c(O,"href","#using-allennlp-at-hugging-face"),c(P,"class","relative group"),c(W,"id","exploring-allennlp-in-the-hub"),c(W,"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"),c(W,"href","#exploring-allennlp-in-the-hub"),c(A,"class","relative group"),c(se,"href","https://huggingface.co/models?library=allennlp"),c(se,"rel","nofollow"),c(ke,"class","block dark:hidden"),Rl(ke.src,mr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-allennlp_widget.png")||c(ke,"src",mr),c(Ce,"class","hidden dark:block"),Rl(Ce.src,vr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-allennlp_widget-dark.png")||c(Ce,"src",vr),c(J,"class","flex justify-center"),c(z,"id","using-existing-models"),c(z,"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"),c(z,"href","#using-existing-models"),c(U,"class","relative group"),c(De,"class","block dark:hidden"),Rl(De.src,_r="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-allennlp_snippet.png")||c(De,"src",_r),c(Me,"class","hidden dark:block"),Rl(Me.src,yr="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-allennlp_snippet-dark.png")||c(Me,"src",yr),c(k,"class","flex justify-center"),c(Z,"id","sharing-your-models"),c(Z,"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"),c(Z,"href","#sharing-your-models"),c(C,"class","relative group"),c(de,"href","https://docs.allennlp.org/main/api/models/archival/#archive_model"),c(de,"rel","nofollow"),c(X,"id","using-the-allennlp-cli"),c(X,"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"),c(X,"href","#using-the-allennlp-cli"),c(D,"class","relative group"),c(F,"id","from-a-python-script"),c(F,"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"),c(F,"href","#from-a-python-script"),c(j,"class","relative group"),c(Q,"id","additional-resources"),c(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"),c(Q,"href","#additional-resources"),c(S,"class","relative group"),c(Ie,"href","https://allenai.org/allennlp"),c(Ie,"rel","nofollow"),c(Ae,"href","https://github.com/allenai/allennlp"),c(Ae,"rel","nofollow")},m(t,d){e(document.head,I),p(t,Ft,d),p(t,P,d),e(P,O),e(O,Xe),w(oe,Xe,null),e(P,Zl),e(P,qe),e(qe,Xl),p(t,Vt,d),p(t,ae,d),e(ae,Ye),e(Ye,ql),e(ae,Yl),p(t,Qt,d),p(t,A,d),e(A,W),e(W,Fe),w(re,Fe,null),e(A,Fl),e(A,Ve),e(Ve,Vl),p(t,Kt,d),p(t,y,d),e(y,Ql),e(y,Qe),e(Qe,Kl),e(y,eo),e(y,se),e(se,to),e(y,lo),p(t,el,d),p(t,Ue,d),e(Ue,oo),p(t,tl,d),p(t,u,d),e(u,Ke),e(Ke,ao),e(u,ro),e(u,et),e(et,so),e(u,io),e(u,tt),e(tt,no),e(u,ho),e(u,lt),e(lt,co),p(t,ll,d),p(t,J,d),e(J,ke),e(J,po),e(J,Ce),p(t,ol,d),p(t,U,d),e(U,z),e(z,ot),w(ie,ot,null),e(U,fo),e(U,at),e(at,uo),p(t,al,d),p(t,m,d),e(m,mo),e(m,rt),e(rt,vo),e(m,_o),e(m,st),e(st,yo),e(m,Eo),e(m,it),e(it,go),e(m,wo),p(t,rl,d),w(ne,t,d),p(t,sl,d),p(t,R,d),e(R,bo),e(R,nt),e(nt,To),e(R,$o),p(t,il,d),p(t,k,d),e(k,De),e(k,Io),e(k,Me),p(t,nl,d),p(t,C,d),e(C,Z),e(Z,ht),w(he,ht,null),e(C,Po),e(C,dt),e(dt,Ao),p(t,hl,d),p(t,v,d),e(v,Jo),e(v,de),e(de,ct),e(ct,Uo),e(v,ko),e(v,pt),e(pt,Co),e(v,Do),e(v,ft),e(ft,Mo),e(v,xo),p(t,dl,d),p(t,D,d),e(D,X),e(X,ut),w(ce,ut,null),e(D,No),e(D,mt),e(mt,Go),p(t,cl,d),p(t,q,d),e(q,Bo),e(q,vt),e(vt,Ho),e(q,Lo),p(t,pl,d),w(pe,t,d),p(t,fl,d),p(t,Y,d),e(Y,_t),e(_t,M),e(M,yt),e(yt,jo),e(M,So),e(M,Et),e(Et,Oo),e(M,Wo),e(M,gt),e(gt,zo),e(Y,Ro),e(Y,f),e(f,x),e(x,fe),e(fe,wt),e(wt,Zo),e(fe,Xo),e(fe,bt),e(bt,qo),e(x,Yo),e(x,xe),e(xe,Fo),e(xe,Tt),e(Tt,Vo),e(x,Qo),e(x,$t),e($t,Ko),e(f,ea),e(f,N),e(N,ue),e(ue,It),e(It,ta),e(ue,la),e(ue,Pt),e(Pt,oa),e(N,aa),e(N,At),e(At,ra),e(N,sa),e(N,Jt),e(Jt,ia),e(f,na),e(f,G),e(G,me),e(me,Ut),e(Ut,ha),e(me,da),e(me,kt),e(kt,ca),e(G,pa),e(G,Ne),e(Ne,fa),e(Ne,Ct),e(Ct,ua),e(G,ma),e(G,Dt),e(Dt,va),e(f,_a),e(f,B),e(B,ve),e(ve,Mt),e(Mt,ya),e(ve,Ea),e(ve,xt),e(xt,ga),e(B,wa),e(B,Ge),e(Ge,ba),e(Ge,Nt),e(Nt,Ta),e(B,$a),e(B,Gt),e(Gt,Ia),e(f,Pa),e(f,H),e(H,_e),e(_e,Bt),e(Bt,Aa),e(_e,Ja),e(_e,Ht),e(Ht,Ua),e(H,ka),e(H,Be),e(Be,Ca),e(Be,Lt),e(Lt,Da),e(H,Ma),e(H,ye),e(ye,xa),e(ye,jt),e(jt,Na),e(ye,Ga),e(f,Ba),e(f,L),e(L,Ee),e(Ee,St),e(St,Ha),e(Ee,La),e(Ee,Ot),e(Ot,ja),e(L,Sa),e(L,Wt),e(Wt,Oa),e(L,Wa),e(L,ge),e(ge,za),e(ge,zt),e(zt,Ra),e(ge,Za),p(t,ul,d),p(t,j,d),e(j,F),e(F,Rt),w(we,Rt,null),e(j,Xa),e(j,Zt),e(Zt,qa),p(t,ml,d),p(t,V,d),e(V,Ya),e(V,Xt),e(Xt,Fa),e(V,Va),p(t,vl,d),w(be,t,d),p(t,_l,d),p(t,He,d),e(He,Qa),p(t,yl,d),p(t,S,d),e(S,Q),e(Q,qt),w(Te,qt,null),e(S,Ka),e(S,Yt),e(Yt,er),p(t,El,d),p(t,K,d),e(K,$e),e($e,tr),e($e,Ie),e(Ie,lr),e($e,or),e(K,ar),e(K,Pe),e(Pe,rr),e(Pe,Ae),e(Ae,sr),e(Pe,ir),gl=!0},p:Ls,i(t){gl||(b(oe.$$.fragment,t),b(re.$$.fragment,t),b(ie.$$.fragment,t),b(ne.$$.fragment,t),b(he.$$.fragment,t),b(ce.$$.fragment,t),b(pe.$$.fragment,t),b(we.$$.fragment,t),b(be.$$.fragment,t),b(Te.$$.fragment,t),gl=!0)},o(t){T(oe.$$.fragment,t),T(re.$$.fragment,t),T(ie.$$.fragment,t),T(ne.$$.fragment,t),T(he.$$.fragment,t),T(ce.$$.fragment,t),T(pe.$$.fragment,t),T(we.$$.fragment,t),T(be.$$.fragment,t),T(Te.$$.fragment,t),gl=!1},d(t){l(I),t&&l(Ft),t&&l(P),$(oe),t&&l(Vt),t&&l(ae),t&&l(Qt),t&&l(A),$(re),t&&l(Kt),t&&l(y),t&&l(el),t&&l(Ue),t&&l(tl),t&&l(u),t&&l(ll),t&&l(J),t&&l(ol),t&&l(U),$(ie),t&&l(al),t&&l(m),t&&l(rl),$(ne,t),t&&l(sl),t&&l(R),t&&l(il),t&&l(k),t&&l(nl),t&&l(C),$(he),t&&l(hl),t&&l(v),t&&l(dl),t&&l(D),$(ce),t&&l(cl),t&&l(q),t&&l(pl),$(pe,t),t&&l(fl),t&&l(Y),t&&l(ul),t&&l(j),$(we),t&&l(ml),t&&l(V),t&&l(vl),$(be,t),t&&l(_l),t&&l(He),t&&l(yl),t&&l(S),$(Te),t&&l(El),t&&l(K)}}}const Os={local:"using-allennlp-at-hugging-face",sections:[{local:"exploring-allennlp-in-the-hub",title:"Exploring allennlp in the Hub"},{local:"using-existing-models",title:"Using existing models"},{local:"sharing-your-models",sections:[{local:"using-the-allennlp-cli",title:"Using the AllenNLP CLI"},{local:"from-a-python-script",title:"From a Python script"}],title:"Sharing your models"},{local:"additional-resources",title:"Additional resources"}],title:"Using AllenNLP at Hugging Face"};function Ws(ur){return js(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xs extends Ns{constructor(I){super();Gs(this,I,Ws,Ss,Bs,{})}}export{Xs as default,Os as metadata};
