import{s as me,n as ue,o as fe}from"../chunks/scheduler.d6170356.js";import{S as ge,i as be,g as l,s as a,r as k,A as $e,h as o,f as i,c as s,j as he,u as C,x as r,k as O,y as we,a as n,v as H,d as J,t as U,w as L}from"../chunks/index.fcd4cc08.js";import{C as ye}from"../chunks/CodeBlock.7b16bdef.js";import{H as ee,E as ve}from"../chunks/EditOnGithub.da2b595c.js";function xe(te){let c,I,j,S,h,W,m,ie="<code>speechbrain</code> is an open-source and all-in-one conversational toolkit for audio/speech. The goal is to create a single, flexible, and user-friendly toolkit that can be used to easily develop state-of-the-art speech technologies, including systems for speech recognition, speaker recognition, speech enhancement, speech separation, language identification, multi-microphone signal processing, and many others.",Y,u,F,f,ne='You can find <code>speechbrain</code> models by filtering at the left of the <a href="https://huggingface.co/models?library=speechbrain" rel="nofollow">models page</a>.',P,g,ae="All models on the Hub come up with the following features:",R,b,se="<li>An automatically generated model card with a brief description.</li> <li>Metadata tags that help for discoverability with information such as the language, license, paper, and more.</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>",V,$,B,w,le="<code>speechbrain</code> offers different interfaces to manage pretrained models for different tasks, such as <code>EncoderClassifier</code>, <code>EncoderClassifier</code>, <code>SepformerSeperation</code>, and <code>SpectralMaskEnhancement</code>. These classes have a <code>from_hparams</code> method you can use to load a model from the Hub",z,y,oe="Here is an example to run inference for sound recognition in urban sounds.",Z,v,G,x,re="If you want to see how to load a specific model, you can click <code>Use in speechbrain</code> and you will be given a working snippet that you can load it!",N,p,ce='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-speechbrain_snippet1.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-speechbrain_snippet1-dark.png"/>',A,d,pe='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-speechbrain_snippet2.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/libraries-speechbrain_snippet2-dark.png"/>',X,_,q,T,de='<li>SpeechBrain <a href="https://speechbrain.github.io/" rel="nofollow">website</a>.</li> <li>SpeechBrain <a href="https://speechbrain.readthedocs.io/en/latest/index.html" rel="nofollow">docs</a>.</li>',Q,M,D,E,K;return h=new ee({props:{title:"Using SpeechBrain at Hugging Face",local:"using-speechbrain-at-hugging-face",headingTag:"h1"}}),u=new ee({props:{title:"Exploring SpeechBrain in the Hub",local:"exploring-speechbrain-in-the-hub",headingTag:"h2"}}),$=new ee({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),v=new ye({props:{code:"aW1wb3J0JTIwdG9yY2hhdWRpbyUwQWZyb20lMjBzcGVlY2hicmFpbi5wcmV0cmFpbmVkJTIwaW1wb3J0JTIwRW5jb2RlckNsYXNzaWZpZXIlMEElMEFjbGFzc2lmaWVyJTIwJTNEJTIwRW5jb2RlckNsYXNzaWZpZXIuZnJvbV9ocGFyYW1zKCUwQSUyMCUyMCUyMCUyMHNvdXJjZSUzRCUyMnNwZWVjaGJyYWluJTJGdXJiYW5zb3VuZDhrX2VjYXBhJTIyJTBBKSUwQW91dF9wcm9iJTJDJTIwc2NvcmUlMkMlMjBpbmRleCUyQyUyMHRleHRfbGFiJTIwJTNEJTIwY2xhc3NpZmllci5jbGFzc2lmeV9maWxlKCdzcGVlY2hicmFpbiUyRnVyYmFuc291bmQ4a19lY2FwYSUyRmRvZ19iYXJrLndhdicp",highlighted:`<span class="hljs-keyword">import</span> torchaudio
<span class="hljs-keyword">from</span> speechbrain.pretrained <span class="hljs-keyword">import</span> EncoderClassifier

classifier = EncoderClassifier.from_hparams(
    source=<span class="hljs-string">&quot;speechbrain/urbansound8k_ecapa&quot;</span>
)
out_prob, score, index, text_lab = classifier.classify_file(<span class="hljs-string">&#x27;speechbrain/urbansound8k_ecapa/dog_bark.wav&#x27;</span>)`,wrap:!1}}),_=new ee({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),M=new ve({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/speechbrain.md"}}),{c(){c=l("meta"),I=a(),j=l("p"),S=a(),k(h.$$.fragment),W=a(),m=l("p"),m.innerHTML=ie,Y=a(),k(u.$$.fragment),F=a(),f=l("p"),f.innerHTML=ne,P=a(),g=l("p"),g.textContent=ae,R=a(),b=l("ol"),b.innerHTML=se,V=a(),k($.$$.fragment),B=a(),w=l("p"),w.innerHTML=le,z=a(),y=l("p"),y.textContent=oe,Z=a(),k(v.$$.fragment),G=a(),x=l("p"),x.innerHTML=re,N=a(),p=l("div"),p.innerHTML=ce,A=a(),d=l("div"),d.innerHTML=pe,X=a(),k(_.$$.fragment),q=a(),T=l("ul"),T.innerHTML=de,Q=a(),k(M.$$.fragment),D=a(),E=l("p"),this.h()},l(e){const t=$e("svelte-u9bgzb",document.head);c=o(t,"META",{name:!0,content:!0}),t.forEach(i),I=s(e),j=o(e,"P",{}),he(j).forEach(i),S=s(e),C(h.$$.fragment,e),W=s(e),m=o(e,"P",{"data-svelte-h":!0}),r(m)!=="svelte-1oej94s"&&(m.innerHTML=ie),Y=s(e),C(u.$$.fragment,e),F=s(e),f=o(e,"P",{"data-svelte-h":!0}),r(f)!=="svelte-10eebia"&&(f.innerHTML=ne),P=s(e),g=o(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-t2majo"&&(g.textContent=ae),R=s(e),b=o(e,"OL",{"data-svelte-h":!0}),r(b)!=="svelte-108cmqx"&&(b.innerHTML=se),V=s(e),C($.$$.fragment,e),B=s(e),w=o(e,"P",{"data-svelte-h":!0}),r(w)!=="svelte-5z5are"&&(w.innerHTML=le),z=s(e),y=o(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-1xn3sya"&&(y.textContent=oe),Z=s(e),C(v.$$.fragment,e),G=s(e),x=o(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1vs5lfu"&&(x.innerHTML=re),N=s(e),p=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(p)!=="svelte-1y0ca43"&&(p.innerHTML=ce),A=s(e),d=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(d)!=="svelte-c7e0td"&&(d.innerHTML=pe),X=s(e),C(_.$$.fragment,e),q=s(e),T=o(e,"UL",{"data-svelte-h":!0}),r(T)!=="svelte-11ga5qs"&&(T.innerHTML=de),Q=s(e),C(M.$$.fragment,e),D=s(e),E=o(e,"P",{}),he(E).forEach(i),this.h()},h(){O(c,"name","hf:doc:metadata"),O(c,"content",_e),O(p,"class","flex justify-center"),O(d,"class","flex justify-center")},m(e,t){we(document.head,c),n(e,I,t),n(e,j,t),n(e,S,t),H(h,e,t),n(e,W,t),n(e,m,t),n(e,Y,t),H(u,e,t),n(e,F,t),n(e,f,t),n(e,P,t),n(e,g,t),n(e,R,t),n(e,b,t),n(e,V,t),H($,e,t),n(e,B,t),n(e,w,t),n(e,z,t),n(e,y,t),n(e,Z,t),H(v,e,t),n(e,G,t),n(e,x,t),n(e,N,t),n(e,p,t),n(e,A,t),n(e,d,t),n(e,X,t),H(_,e,t),n(e,q,t),n(e,T,t),n(e,Q,t),H(M,e,t),n(e,D,t),n(e,E,t),K=!0},p:ue,i(e){K||(J(h.$$.fragment,e),J(u.$$.fragment,e),J($.$$.fragment,e),J(v.$$.fragment,e),J(_.$$.fragment,e),J(M.$$.fragment,e),K=!0)},o(e){U(h.$$.fragment,e),U(u.$$.fragment,e),U($.$$.fragment,e),U(v.$$.fragment,e),U(_.$$.fragment,e),U(M.$$.fragment,e),K=!1},d(e){e&&(i(I),i(j),i(S),i(W),i(m),i(Y),i(F),i(f),i(P),i(g),i(R),i(b),i(V),i(B),i(w),i(z),i(y),i(Z),i(G),i(x),i(N),i(p),i(A),i(d),i(X),i(q),i(T),i(Q),i(D),i(E)),i(c),L(h,e),L(u,e),L($,e),L(v,e),L(_,e),L(M,e)}}}const _e='{"title":"Using SpeechBrain at Hugging Face","local":"using-speechbrain-at-hugging-face","sections":[{"title":"Exploring SpeechBrain in the Hub","local":"exploring-speechbrain-in-the-hub","sections":[],"depth":2},{"title":"Using existing models","local":"using-existing-models","sections":[],"depth":2},{"title":"Additional resources","local":"additional-resources","sections":[],"depth":2}],"depth":1}';function Te(te){return fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Je extends ge{constructor(c){super(),be(this,c,Te,xe,me,{})}}export{Je as component};
