import{s as Se,n as Ue,o as Je}from"../chunks/scheduler.d6170356.js";import{S as Pe,i as je,g as a,s as l,r as c,A as Ze,h as o,f as n,c as s,j as Ce,u,x as r,k as ce,y as Ve,a as i,v as f,d as g,t as h,w as $}from"../chunks/index.fcd4cc08.js";import{C as Le}from"../chunks/CodeBlock.7b16bdef.js";import{H as W,E as Ee}from"../chunks/EditOnGithub.da2b595c.js";function Ie(ue){let p,q,I,z,b,A,w,fe="<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.",G,v,F,x,ge='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>.',N,y,he="All models on the Hub come up with useful features:",Y,T,$e="<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>",R,m,be='<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"/>',X,_,Q,M,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>).',D,H,ve="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:",K,k,xe="<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>",O,C,ye="Here is an inference example:",ee,L,te,S,Te="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!",ne,d,_e='<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"/>',ie,U,le,J,Me='<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>).',se,P,He="The <code>run.sh</code> script allows to upload a given model to a Hugging Face repository.",ae,j,oe,Z,re,V,ke='<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>',pe,E,me,B,de;return b=new W({props:{title:"Using ESPnet at Hugging Face",local:"using-espnet-at-hugging-face",headingTag:"h1"}}),v=new W({props:{title:"Exploring ESPnet in the Hub",local:"exploring-espnet-in-the-hub",headingTag:"h2"}}),_=new W({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),L=new Le({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}}),U=new W({props:{title:"Sharing your models",local:"sharing-your-models",headingTag:"h2"}}),j=new Le({props:{code:"LiUyRnJ1bi5zaCUyMC0tc3RhZ2UlMjAxNSUyMC0tc2tpcF91cGxvYWRfaGYlMjBmYWxzZSUyMC0taGZfcmVwbyUyMHVzZXJuYW1lJTJGbW9kZWxfcmVwbw==",highlighted:'./run.sh --stage 15 --skip_upload_hf <span class="hljs-literal">false</span> --hf_repo username/model_repo',wrap:!1}}),Z=new W({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),E=new Ee({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/espnet.md"}}),{c(){p=a("meta"),q=l(),I=a("p"),z=l(),c(b.$$.fragment),A=l(),w=a("p"),w.innerHTML=fe,G=l(),c(v.$$.fragment),F=l(),x=a("p"),x.innerHTML=ge,N=l(),y=a("p"),y.textContent=he,Y=l(),T=a("ol"),T.innerHTML=$e,R=l(),m=a("div"),m.innerHTML=be,X=l(),c(_.$$.fragment),Q=l(),M=a("p"),M.innerHTML=we,D=l(),H=a("p"),H.innerHTML=ve,K=l(),k=a("ul"),k.innerHTML=xe,O=l(),C=a("p"),C.textContent=ye,ee=l(),c(L.$$.fragment),te=l(),S=a("p"),S.innerHTML=Te,ne=l(),d=a("div"),d.innerHTML=_e,ie=l(),c(U.$$.fragment),le=l(),J=a("p"),J.innerHTML=Me,se=l(),P=a("p"),P.innerHTML=He,ae=l(),c(j.$$.fragment),oe=l(),c(Z.$$.fragment),re=l(),V=a("ul"),V.innerHTML=ke,pe=l(),c(E.$$.fragment),me=l(),B=a("p"),this.h()},l(e){const t=Ze("svelte-u9bgzb",document.head);p=o(t,"META",{name:!0,content:!0}),t.forEach(n),q=s(e),I=o(e,"P",{}),Ce(I).forEach(n),z=s(e),u(b.$$.fragment,e),A=s(e),w=o(e,"P",{"data-svelte-h":!0}),r(w)!=="svelte-dhgpy4"&&(w.innerHTML=fe),G=s(e),u(v.$$.fragment,e),F=s(e),x=o(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1gni2e4"&&(x.innerHTML=ge),N=s(e),y=o(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-1krwbts"&&(y.textContent=he),Y=s(e),T=o(e,"OL",{"data-svelte-h":!0}),r(T)!=="svelte-1e2s8eu"&&(T.innerHTML=$e),R=s(e),m=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(m)!=="svelte-1ja4287"&&(m.innerHTML=be),X=s(e),u(_.$$.fragment,e),Q=s(e),M=o(e,"P",{"data-svelte-h":!0}),r(M)!=="svelte-18rmgqx"&&(M.innerHTML=we),D=s(e),H=o(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-1c24m67"&&(H.innerHTML=ve),K=s(e),k=o(e,"UL",{"data-svelte-h":!0}),r(k)!=="svelte-1e4b3hz"&&(k.innerHTML=xe),O=s(e),C=o(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-kl7f6i"&&(C.textContent=ye),ee=s(e),u(L.$$.fragment,e),te=s(e),S=o(e,"P",{"data-svelte-h":!0}),r(S)!=="svelte-1hf1llf"&&(S.innerHTML=Te),ne=s(e),d=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(d)!=="svelte-9bg64f"&&(d.innerHTML=_e),ie=s(e),u(U.$$.fragment,e),le=s(e),J=o(e,"P",{"data-svelte-h":!0}),r(J)!=="svelte-xblji1"&&(J.innerHTML=Me),se=s(e),P=o(e,"P",{"data-svelte-h":!0}),r(P)!=="svelte-xdwl2m"&&(P.innerHTML=He),ae=s(e),u(j.$$.fragment,e),oe=s(e),u(Z.$$.fragment,e),re=s(e),V=o(e,"UL",{"data-svelte-h":!0}),r(V)!=="svelte-7kyxdd"&&(V.innerHTML=ke),pe=s(e),u(E.$$.fragment,e),me=s(e),B=o(e,"P",{}),Ce(B).forEach(n),this.h()},h(){ce(p,"name","hf:doc:metadata"),ce(p,"content",Be),ce(m,"class","flex justify-center"),ce(d,"class","flex justify-center")},m(e,t){Ve(document.head,p),i(e,q,t),i(e,I,t),i(e,z,t),f(b,e,t),i(e,A,t),i(e,w,t),i(e,G,t),f(v,e,t),i(e,F,t),i(e,x,t),i(e,N,t),i(e,y,t),i(e,Y,t),i(e,T,t),i(e,R,t),i(e,m,t),i(e,X,t),f(_,e,t),i(e,Q,t),i(e,M,t),i(e,D,t),i(e,H,t),i(e,K,t),i(e,k,t),i(e,O,t),i(e,C,t),i(e,ee,t),f(L,e,t),i(e,te,t),i(e,S,t),i(e,ne,t),i(e,d,t),i(e,ie,t),f(U,e,t),i(e,le,t),i(e,J,t),i(e,se,t),i(e,P,t),i(e,ae,t),f(j,e,t),i(e,oe,t),f(Z,e,t),i(e,re,t),i(e,V,t),i(e,pe,t),f(E,e,t),i(e,me,t),i(e,B,t),de=!0},p:Ue,i(e){de||(g(b.$$.fragment,e),g(v.$$.fragment,e),g(_.$$.fragment,e),g(L.$$.fragment,e),g(U.$$.fragment,e),g(j.$$.fragment,e),g(Z.$$.fragment,e),g(E.$$.fragment,e),de=!0)},o(e){h(b.$$.fragment,e),h(v.$$.fragment,e),h(_.$$.fragment,e),h(L.$$.fragment,e),h(U.$$.fragment,e),h(j.$$.fragment,e),h(Z.$$.fragment,e),h(E.$$.fragment,e),de=!1},d(e){e&&(n(q),n(I),n(z),n(A),n(w),n(G),n(F),n(x),n(N),n(y),n(Y),n(T),n(R),n(m),n(X),n(Q),n(M),n(D),n(H),n(K),n(k),n(O),n(C),n(ee),n(te),n(S),n(ne),n(d),n(ie),n(le),n(J),n(se),n(P),n(ae),n(oe),n(re),n(V),n(pe),n(me),n(B)),n(p),$(b,e),$(v,e),$(_,e),$(L,e),$(U,e),$(j,e),$(Z,e),$(E,e)}}}const Be='{"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 We(ue){return Je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fe extends Pe{constructor(p){super(),je(this,p,We,Ie,Se,{})}}export{Fe as component};
