import{s as de,n as he,o as me}from"../chunks/scheduler.d6170356.js";import{S as ue,i as fe,g as l,s as n,r as C,A as ge,h as o,f as i,c as s,j as pe,u as H,x as r,k as D,y as be,a,v as J,d as U,t as L,w as j}from"../chunks/index.fcd4cc08.js";import{C as we}from"../chunks/CodeBlock.7b16bdef.js";import{H as K}from"../chunks/Heading.8660bd0e.js";function ye(O){let c,E,M,I,h,S,m,ee="<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.",W,u,Y,f,te='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>.',F,g,ie="All models on the Hub come up with the following features:",P,b,ae="<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>",R,w,V,y,ne="<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",B,v,se="Here is an example to run inference for sound recognition in urban sounds.",z,$,Z,x,le="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,oe='<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,re='<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"/>',G,_,X,T,ce='<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,k,Q;return h=new K({props:{title:"Using SpeechBrain at Hugging Face",local:"using-speechbrain-at-hugging-face",headingTag:"h1"}}),u=new K({props:{title:"Exploring SpeechBrain in the Hub",local:"exploring-speechbrain-in-the-hub",headingTag:"h2"}}),w=new K({props:{title:"Using existing models",local:"using-existing-models",headingTag:"h2"}}),$=new we({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 K({props:{title:"Additional resources",local:"additional-resources",headingTag:"h2"}}),{c(){c=l("meta"),E=n(),M=l("p"),I=n(),C(h.$$.fragment),S=n(),m=l("p"),m.innerHTML=ee,W=n(),C(u.$$.fragment),Y=n(),f=l("p"),f.innerHTML=te,F=n(),g=l("p"),g.textContent=ie,P=n(),b=l("ol"),b.innerHTML=ae,R=n(),C(w.$$.fragment),V=n(),y=l("p"),y.innerHTML=ne,B=n(),v=l("p"),v.textContent=se,z=n(),C($.$$.fragment),Z=n(),x=l("p"),x.innerHTML=le,N=n(),p=l("div"),p.innerHTML=oe,A=n(),d=l("div"),d.innerHTML=re,G=n(),C(_.$$.fragment),X=n(),T=l("ul"),T.innerHTML=ce,q=n(),k=l("p"),this.h()},l(e){const t=ge("svelte-u9bgzb",document.head);c=o(t,"META",{name:!0,content:!0}),t.forEach(i),E=s(e),M=o(e,"P",{}),pe(M).forEach(i),I=s(e),H(h.$$.fragment,e),S=s(e),m=o(e,"P",{"data-svelte-h":!0}),r(m)!=="svelte-1oej94s"&&(m.innerHTML=ee),W=s(e),H(u.$$.fragment,e),Y=s(e),f=o(e,"P",{"data-svelte-h":!0}),r(f)!=="svelte-10eebia"&&(f.innerHTML=te),F=s(e),g=o(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-t2majo"&&(g.textContent=ie),P=s(e),b=o(e,"OL",{"data-svelte-h":!0}),r(b)!=="svelte-108cmqx"&&(b.innerHTML=ae),R=s(e),H(w.$$.fragment,e),V=s(e),y=o(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-5z5are"&&(y.innerHTML=ne),B=s(e),v=o(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1xn3sya"&&(v.textContent=se),z=s(e),H($.$$.fragment,e),Z=s(e),x=o(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1vs5lfu"&&(x.innerHTML=le),N=s(e),p=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(p)!=="svelte-1y0ca43"&&(p.innerHTML=oe),A=s(e),d=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(d)!=="svelte-c7e0td"&&(d.innerHTML=re),G=s(e),H(_.$$.fragment,e),X=s(e),T=o(e,"UL",{"data-svelte-h":!0}),r(T)!=="svelte-11ga5qs"&&(T.innerHTML=ce),q=s(e),k=o(e,"P",{}),pe(k).forEach(i),this.h()},h(){D(c,"name","hf:doc:metadata"),D(c,"content",ve),D(p,"class","flex justify-center"),D(d,"class","flex justify-center")},m(e,t){be(document.head,c),a(e,E,t),a(e,M,t),a(e,I,t),J(h,e,t),a(e,S,t),a(e,m,t),a(e,W,t),J(u,e,t),a(e,Y,t),a(e,f,t),a(e,F,t),a(e,g,t),a(e,P,t),a(e,b,t),a(e,R,t),J(w,e,t),a(e,V,t),a(e,y,t),a(e,B,t),a(e,v,t),a(e,z,t),J($,e,t),a(e,Z,t),a(e,x,t),a(e,N,t),a(e,p,t),a(e,A,t),a(e,d,t),a(e,G,t),J(_,e,t),a(e,X,t),a(e,T,t),a(e,q,t),a(e,k,t),Q=!0},p:he,i(e){Q||(U(h.$$.fragment,e),U(u.$$.fragment,e),U(w.$$.fragment,e),U($.$$.fragment,e),U(_.$$.fragment,e),Q=!0)},o(e){L(h.$$.fragment,e),L(u.$$.fragment,e),L(w.$$.fragment,e),L($.$$.fragment,e),L(_.$$.fragment,e),Q=!1},d(e){e&&(i(E),i(M),i(I),i(S),i(m),i(W),i(Y),i(f),i(F),i(g),i(P),i(b),i(R),i(V),i(y),i(B),i(v),i(z),i(Z),i(x),i(N),i(p),i(A),i(d),i(G),i(X),i(T),i(q),i(k)),i(c),j(h,e),j(u,e),j(w,e),j($,e),j(_,e)}}}const ve='{"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 $e(O){return me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ke extends ue{constructor(c){super(),fe(this,c,$e,ye,de,{})}}export{ke as component};
