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