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