import{s as Ce,n as Le,o as Se}from"../chunks/scheduler.d6170356.js";import{S as Ue,i as Je,g as a,s as i,r as U,A as Pe,h as o,f as n,c as s,j as He,u as J,x as r,k as ce,y as je,a as l,v as P,d as j,t as Z,w as V}from"../chunks/index.fcd4cc08.js";import{C as ke}from"../chunks/CodeBlock.7b16bdef.js";import{H as B}from"../chunks/Heading.8660bd0e.js";function Ze(de){let p,W,I,q,m,z,u,me="<code>espnet</code> is an end-to-end toolkit for speech processing, including automatic speech recognition, text to speech, speech enhancement, dirarization and other tasks.",A,f,F,g,ue='You can find hundreds of <code>espnet</code> models by filtering at the left of the <a href="https://huggingface.co/models?library=espnet&amp;sort=downloads" rel="nofollow">models page</a>.',G,h,fe="All models on the Hub come up with useful features:",N,w,ge="<li>An automatically generated model card with a description, a training configuration, licenses and more.</li> <li>Metadata tags that help for discoverability and contain information such as license, language and datasets.</li> <li>An interactive widget you can use to play out with the model directly in the browser.</li> <li>An Inference API that allows to make inference requests.</li>",Y,c,he='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-espnet_widget.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-espnet_widget-dark.png"/>',R,$,X,b,we='For a full guide on loading pre-trained models, we recommend checking out the <a href="https://github.com/espnet/espnet_model_zoo" rel="nofollow">official guide</a>).',Q,v,$e="If you’re interested in doing inference, different classes for different tasks have a <code>from_pretrained</code> method that allows loading models from the Hub. For example:",D,x,be="<li><code>Speech2Text</code> for Automatic Speech Recognition.</li> <li><code>Text2Speech</code> for Text to Speech.</li> <li><code>SeparateSpeech</code> for Audio Source Separation.</li>",K,y,ve="Here is an inference example:",O,T,ee,_,xe="If you want to see how to load a specific model, you can click <code>Use in ESPnet</code> and you will be given a working snippet that you can load it!",te,d,ye='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-espnet_snippet.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-espnet_snippet-dark.png"/>',ne,M,le,H,Te='<code>ESPnet</code> outputs a <code>zip</code> file that can be uploaded to Hugging Face easily. For a full guide on sharing  models, we recommend checking out the <a href="https://github.com/espnet/espnet_model_zoo#register-your-model" rel="nofollow">official guide</a>).',ie,k,_e="The <code>run.sh</code> script allows to upload a given model to a Hugging Face repository.",se,C,ae,L,oe,S,Me='<li>ESPnet <a href="https://espnet.github.io/espnet/index.html" rel="nofollow">docs</a>.</li> <li>ESPnet model zoo <a href="https://github.com/espnet/espnet_model_zoo" rel="nofollow">repository</a>.</li> <li>Integration <a href="https://github.com/asteroid-team/asteroid/blob/master/docs/source/readmes/pretrained_models.md" rel="nofollow">docs</a>.</li>',re,E,pe;return m=new B({props:{title:"Using ESPnet at Hugging Face",local:"using-espnet-at-hugging-face",headingTag:"h1"}}),f=new B({props:{title:"Exploring ESPnet in the Hub",local:"exploring-espnet-in-the-hub",headingTag:"h2"}}),$=new B({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),T=new ke({props:{code:"aW1wb3J0JTIwc291bmRmaWxlJTBBZnJvbSUyMGVzcG5ldDIuYmluLnR0c19pbmZlcmVuY2UlMjBpbXBvcnQlMjBUZXh0MlNwZWVjaCUwQSUwQXRleHQyc3BlZWNoJTIwJTNEJTIwVGV4dDJTcGVlY2guZnJvbV9wcmV0cmFpbmVkKCUyMm1vZGVsX25hbWUlMjIpJTBBc3BlZWNoJTIwJTNEJTIwdGV4dDJzcGVlY2goJTIyZm9vYmFyJTIyKSU1QiUyMndhdiUyMiU1RCUwQXNvdW5kZmlsZS53cml0ZSglMjJvdXQud2F2JTIyJTJDJTIwc3BlZWNoLm51bXB5KCklMkMlMjB0ZXh0MnNwZWVjaC5mcyUyQyUyMCUyMlBDTV8xNiUyMik=",highlighted:`<span class="hljs-keyword">import</span> soundfile
<span class="hljs-keyword">from</span> espnet2.<span class="hljs-built_in">bin</span>.tts_inference <span class="hljs-keyword">import</span> Text2Speech

text2speech = Text2Speech.from_pretrained(<span class="hljs-string">&quot;model_name&quot;</span>)
speech = text2speech(<span class="hljs-string">&quot;foobar&quot;</span>)[<span class="hljs-string">&quot;wav&quot;</span>]
soundfile.write(<span class="hljs-string">&quot;out.wav&quot;</span>, speech.numpy(), text2speech.fs, <span class="hljs-string">&quot;PCM_16&quot;</span>)`,wrap:!1}}),M=new B({props:{title:"Sharing your models",local:"sharing-your-models",headingTag:"h2"}}),C=new ke({props:{code:"LiUyRnJ1bi5zaCUyMC0tc3RhZ2UlMjAxNSUyMC0tc2tpcF91cGxvYWRfaGYlMjBmYWxzZSUyMC0taGZfcmVwbyUyMHVzZXJuYW1lJTJGbW9kZWxfcmVwbw==",highlighted:'./run.sh --stage 15 --skip_upload_hf <span class="hljs-literal">false</span> --hf_repo username/model_repo',wrap:!1}}),L=new B({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),{c(){p=a("meta"),W=i(),I=a("p"),q=i(),U(m.$$.fragment),z=i(),u=a("p"),u.innerHTML=me,A=i(),U(f.$$.fragment),F=i(),g=a("p"),g.innerHTML=ue,G=i(),h=a("p"),h.textContent=fe,N=i(),w=a("ol"),w.innerHTML=ge,Y=i(),c=a("div"),c.innerHTML=he,R=i(),U($.$$.fragment),X=i(),b=a("p"),b.innerHTML=we,Q=i(),v=a("p"),v.innerHTML=$e,D=i(),x=a("ul"),x.innerHTML=be,K=i(),y=a("p"),y.textContent=ve,O=i(),U(T.$$.fragment),ee=i(),_=a("p"),_.innerHTML=xe,te=i(),d=a("div"),d.innerHTML=ye,ne=i(),U(M.$$.fragment),le=i(),H=a("p"),H.innerHTML=Te,ie=i(),k=a("p"),k.innerHTML=_e,se=i(),U(C.$$.fragment),ae=i(),U(L.$$.fragment),oe=i(),S=a("ul"),S.innerHTML=Me,re=i(),E=a("p"),this.h()},l(e){const t=Pe("svelte-u9bgzb",document.head);p=o(t,"META",{name:!0,content:!0}),t.forEach(n),W=s(e),I=o(e,"P",{}),He(I).forEach(n),q=s(e),J(m.$$.fragment,e),z=s(e),u=o(e,"P",{"data-svelte-h":!0}),r(u)!=="svelte-dhgpy4"&&(u.innerHTML=me),A=s(e),J(f.$$.fragment,e),F=s(e),g=o(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-1gni2e4"&&(g.innerHTML=ue),G=s(e),h=o(e,"P",{"data-svelte-h":!0}),r(h)!=="svelte-1krwbts"&&(h.textContent=fe),N=s(e),w=o(e,"OL",{"data-svelte-h":!0}),r(w)!=="svelte-1e2s8eu"&&(w.innerHTML=ge),Y=s(e),c=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(c)!=="svelte-1ja4287"&&(c.innerHTML=he),R=s(e),J($.$$.fragment,e),X=s(e),b=o(e,"P",{"data-svelte-h":!0}),r(b)!=="svelte-18rmgqx"&&(b.innerHTML=we),Q=s(e),v=o(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1c24m67"&&(v.innerHTML=$e),D=s(e),x=o(e,"UL",{"data-svelte-h":!0}),r(x)!=="svelte-1e4b3hz"&&(x.innerHTML=be),K=s(e),y=o(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-kl7f6i"&&(y.textContent=ve),O=s(e),J(T.$$.fragment,e),ee=s(e),_=o(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-1hf1llf"&&(_.innerHTML=xe),te=s(e),d=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(d)!=="svelte-9bg64f"&&(d.innerHTML=ye),ne=s(e),J(M.$$.fragment,e),le=s(e),H=o(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-xblji1"&&(H.innerHTML=Te),ie=s(e),k=o(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-xdwl2m"&&(k.innerHTML=_e),se=s(e),J(C.$$.fragment,e),ae=s(e),J(L.$$.fragment,e),oe=s(e),S=o(e,"UL",{"data-svelte-h":!0}),r(S)!=="svelte-7kyxdd"&&(S.innerHTML=Me),re=s(e),E=o(e,"P",{}),He(E).forEach(n),this.h()},h(){ce(p,"name","hf:doc:metadata"),ce(p,"content",Ve),ce(c,"class","flex justify-center"),ce(d,"class","flex justify-center")},m(e,t){je(document.head,p),l(e,W,t),l(e,I,t),l(e,q,t),P(m,e,t),l(e,z,t),l(e,u,t),l(e,A,t),P(f,e,t),l(e,F,t),l(e,g,t),l(e,G,t),l(e,h,t),l(e,N,t),l(e,w,t),l(e,Y,t),l(e,c,t),l(e,R,t),P($,e,t),l(e,X,t),l(e,b,t),l(e,Q,t),l(e,v,t),l(e,D,t),l(e,x,t),l(e,K,t),l(e,y,t),l(e,O,t),P(T,e,t),l(e,ee,t),l(e,_,t),l(e,te,t),l(e,d,t),l(e,ne,t),P(M,e,t),l(e,le,t),l(e,H,t),l(e,ie,t),l(e,k,t),l(e,se,t),P(C,e,t),l(e,ae,t),P(L,e,t),l(e,oe,t),l(e,S,t),l(e,re,t),l(e,E,t),pe=!0},p:Le,i(e){pe||(j(m.$$.fragment,e),j(f.$$.fragment,e),j($.$$.fragment,e),j(T.$$.fragment,e),j(M.$$.fragment,e),j(C.$$.fragment,e),j(L.$$.fragment,e),pe=!0)},o(e){Z(m.$$.fragment,e),Z(f.$$.fragment,e),Z($.$$.fragment,e),Z(T.$$.fragment,e),Z(M.$$.fragment,e),Z(C.$$.fragment,e),Z(L.$$.fragment,e),pe=!1},d(e){e&&(n(W),n(I),n(q),n(z),n(u),n(A),n(F),n(g),n(G),n(h),n(N),n(w),n(Y),n(c),n(R),n(X),n(b),n(Q),n(v),n(D),n(x),n(K),n(y),n(O),n(ee),n(_),n(te),n(d),n(ne),n(le),n(H),n(ie),n(k),n(se),n(ae),n(oe),n(S),n(re),n(E)),n(p),V(m,e),V(f,e),V($,e),V(T,e),V(M,e),V(C,e),V(L,e)}}}const Ve='{"title":"Using ESPnet at Hugging Face","local":"using-espnet-at-hugging-face","sections":[{"title":"Exploring ESPnet in the Hub","local":"exploring-espnet-in-the-hub","sections":[],"depth":2},{"title":"Using existing models","local":"using-existing-models","sections":[],"depth":2},{"title":"Sharing your models","local":"sharing-your-models","sections":[],"depth":2},{"title":"Additional resources","local":"additional-resources","sections":[],"depth":2}],"depth":1}';function Ie(de){return Se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ze extends Ue{constructor(p){super(),Je(this,p,Ie,Ze,Ce,{})}}export{ze as component};
