import{s as Hr,o as Lr,n as he}from"../chunks/scheduler.9bc65507.js";import{S as Vr,i as Sr,g as i,s as n,r as p,A as Yr,h as l,f as o,c as a,j as w,u as f,x as c,k as T,l as Xr,y as s,a as r,v as h,d as u,t as g,w as _}from"../chunks/index.707bf1b6.js";import{T as Hn}from"../chunks/Tip.c2ecdbf4.js";import{D as C}from"../chunks/Docstring.17db21ae.js";import{C as U}from"../chunks/CodeBlock.54a9f38d.js";import{E as Ln}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as $}from"../chunks/Heading.342b1fa6.js";function qr(J){let d,y="Example:",b,k,v;return k=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBCYXJrTW9kZWwlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzdW5vJTJGYmFyay1zbWFsbCUyMiklMEFtb2RlbCUyMCUzRCUyMEJhcmtNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmstc21hbGwlMjIpJTBBJTBBJTIzJTIwVG8lMjBhZGQlMjBhJTIwdm9pY2UlMjBwcmVzZXQlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwdm9pY2VfcHJlc2V0JTYwJTIwdG8lMjAlNjBCYXJrUHJvY2Vzc29yLl9fY2FsbF9fKC4uLiklNjAlMEF2b2ljZV9wcmVzZXQlMjAlM0QlMjAlMjJ2MiUyRmVuX3NwZWFrZXJfNiUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTJDJTIwSSUyMG5lZWQlMjBoaW0lMjBpbiUyMG15JTIwbGlmZSUyMiUyQyUyMHZvaWNlX3ByZXNldCUzRHZvaWNlX3ByZXNldCklMEElMEFhdWRpb19hcnJheSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwc2VtYW50aWNfbWF4X25ld190b2tlbnMlM0QxMDApJTBBYXVkaW9fYXJyYXklMjAlM0QlMjBhdWRpb19hcnJheS5jcHUoKS5udW1weSgpLnNxdWVlemUoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BarkModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To add a voice preset, you can pass \`voice_preset\` to \`BarkProcessor.__call__(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>voice_preset = <span class="hljs-string">&quot;v2/en_speaker_6&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Hello, my dog is cute, I need him in my life&quot;</span>, voice_preset=voice_preset)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs, semantic_max_new_tokens=<span class="hljs-number">100</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`,wrap:!1}}),{c(){d=i("p"),d.textContent=y,b=n(),p(k.$$.fragment)},l(m){d=l(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-11lpom8"&&(d.textContent=y),b=a(m),f(k.$$.fragment,m)},m(m,M){r(m,d,M),r(m,b,M),h(k,m,M),v=!0},p:he,i(m){v||(u(k.$$.fragment,m),v=!0)},o(m){g(k.$$.fragment,m),v=!1},d(m){m&&(o(d),o(b)),_(k,m)}}}function Er(J){let d,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=i("p"),d.innerHTML=y},l(b){d=l(b,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=y)},m(b,k){r(b,d,k)},p:he,d(b){b&&o(d)}}}function Rr(J){let d,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=i("p"),d.innerHTML=y},l(b){d=l(b,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=y)},m(b,k){r(b,d,k)},p:he,d(b){b&&o(d)}}}function Dr(J){let d,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=i("p"),d.innerHTML=y},l(b){d=l(b,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=y)},m(b,k){r(b,d,k)},p:he,d(b){b&&o(d)}}}function Qr(J){let d,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=i("p"),d.innerHTML=y},l(b){d=l(b,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=y)},m(b,k){r(b,d,k)},p:he,d(b){b&&o(d)}}}function Or(J){let d,y="Example:",b,k,v;return k=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtDb2Fyc2VDb25maWclMkMlMjBCYXJrQ29hcnNlTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQmFyayUyMHN1Yi1tb2R1bGUlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQmFya0NvYXJzZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdW5vJTJGYmFyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmFya0NvYXJzZU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkCoarseConfig, BarkCoarseModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Bark sub-module style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BarkCoarseConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the suno/bark style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkCoarseModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){d=i("p"),d.textContent=y,b=n(),p(k.$$.fragment)},l(m){d=l(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-11lpom8"&&(d.textContent=y),b=a(m),f(k.$$.fragment,m)},m(m,M){r(m,d,M),r(m,b,M),h(k,m,M),v=!0},p:he,i(m){v||(u(k.$$.fragment,m),v=!0)},o(m){g(k.$$.fragment,m),v=!1},d(m){m&&(o(d),o(b)),_(k,m)}}}function Ar(J){let d,y="Example:",b,k,v;return k=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtGaW5lQ29uZmlnJTJDJTIwQmFya0ZpbmVNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBCYXJrJTIwc3ViLW1vZHVsZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBCYXJrRmluZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdW5vJTJGYmFyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmFya0ZpbmVNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkFineConfig, BarkFineModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Bark sub-module style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BarkFineConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the suno/bark style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkFineModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){d=i("p"),d.textContent=y,b=n(),p(k.$$.fragment)},l(m){d=l(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-11lpom8"&&(d.textContent=y),b=a(m),f(k.$$.fragment,m)},m(m,M){r(m,d,M),r(m,b,M),h(k,m,M),v=!0},p:he,i(m){v||(u(k.$$.fragment,m),v=!0)},o(m){g(k.$$.fragment,m),v=!1},d(m){m&&(o(d),o(b)),_(k,m)}}}function Kr(J){let d,y="Example:",b,k,v;return k=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtTZW1hbnRpY0NvbmZpZyUyQyUyMEJhcmtTZW1hbnRpY01vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEJhcmslMjBzdWItbW9kdWxlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEJhcmtTZW1hbnRpY0NvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBzdW5vJTJGYmFyayUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQmFya1NlbWFudGljTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkSemanticConfig, BarkSemanticModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Bark sub-module style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BarkSemanticConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the suno/bark style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkSemanticModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){d=i("p"),d.textContent=y,b=n(),p(k.$$.fragment)},l(m){d=l(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-11lpom8"&&(d.textContent=y),b=a(m),f(k.$$.fragment,m)},m(m,M){r(m,d,M),r(m,b,M),h(k,m,M),v=!0},p:he,i(m){v||(u(k.$$.fragment,m),v=!0)},o(m){g(k.$$.fragment,m),v=!1},d(m){m&&(o(d),o(b)),_(k,m)}}}function es(J){let d,y,b,k,v,m,M,wo,ue,Fa='Bark is a transformer-based text-to-speech model proposed by Suno AI in <a href="https://github.com/suno-ai/bark" rel="nofollow">suno-ai/bark</a>.',To,ge,Pa="Bark is made of 4 main models:",$o,_e,Ga='<li><a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a> (also referred to as the ‘text’ model): a causal auto-regressive transformer model that takes as input tokenized text, and predicts semantic text tokens that capture the meaning of the text.</li> <li><a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCoarseModel">BarkCoarseModel</a> (also referred to as the ‘coarse acoustics’ model): a causal autoregressive transformer, that takes as input the results of the <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a> model. It aims at predicting the first two audio codebooks necessary for EnCodec.</li> <li><a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a> (the ‘fine acoustics’ model), this time a non-causal autoencoder transformer, which iteratively predicts the last codebooks based on the sum of the previous codebooks embeddings.</li> <li>having predicted all the codebook channels from the <a href="/docs/transformers/v4.36.1/en/model_doc/encodec#transformers.EncodecModel">EncodecModel</a>, Bark uses it to decode the output audio array.</li>',Bo,be,Ha="It should be noted that each of the first three modules can support conditional speaker embeddings to condition the output sound according to specific predefined voice.",Co,ke,La=`This model was contributed by <a href="https://huggingface.co/ylacombe" rel="nofollow">Yoach Lacombe (ylacombe)</a> and <a href="https://github.com/sanchit-gandhi" rel="nofollow">Sanchit Gandhi (sanchit-gandhi)</a>.
The original code can be found <a href="https://github.com/suno-ai/bark" rel="nofollow">here</a>.`,xo,ye,Jo,ve,Va="Bark can be optimized with just a few extra lines of code, which <strong>significantly reduces its memory footprint</strong> and <strong>accelerates inference</strong>.",zo,Me,jo,we,Sa="You can speed up inference and reduce memory footprint by 50% simply by loading the model in half-precision.",Uo,Te,Io,$e,Wo,Be,Ya="As mentioned above, Bark is made up of 4 sub-models, which are called up sequentially during audio generation. In other words, while one sub-model is in use, the other sub-models are idle.",Zo,Ce,Xa="If you’re using a CUDA device, a simple solution to benefit from an 80% reduction in memory footprint is to offload the submodels from GPU to CPU when they’re idle. This operation is called <em>CPU offloading</em>. You can use it with one line of code as follows:",No,xe,Fo,Je,qa='Note that 🤗 Accelerate must be installed before using this feature. <a href="https://huggingface.co/docs/accelerate/basic_tutorials/install" rel="nofollow">Here’s how to install it.</a>',Po,ze,Go,je,Ea="Better Transformer is an 🤗 Optimum feature that performs kernel fusion under the hood. You can gain 20% to 30% in speed with zero performance degradation. It only requires one line of code to export the model to 🤗 Better Transformer:",Ho,Ue,Lo,Ie,Ra='Note that 🤗 Optimum must be installed before using this feature. <a href="https://huggingface.co/docs/optimum/installation" rel="nofollow">Here’s how to install it.</a>',Vo,We,So,Ze,Da="Flash Attention 2 is an even faster, optimized version of the previous optimization.",Yo,Ne,Xo,Fe,Qa='First, check whether your hardware is compatible with Flash Attention 2. The latest list of compatible hardware can be found in the <a href="https://github.com/Dao-AILab/flash-attention#installation-and-features" rel="nofollow">official documentation</a>. If your hardware is not compatible with Flash Attention 2, you can still benefit from attention kernel optimisations through Better Transformer support covered <a href="https://huggingface.co/docs/transformers/main/en/model_doc/bark#using-better-transformer" rel="nofollow">above</a>.',qo,Pe,Oa='Next, <a href="https://github.com/Dao-AILab/flash-attention#installation-and-features" rel="nofollow">install</a> the latest version of Flash Attention 2:',Eo,Ge,Ro,He,Do,Le,Aa='To load a model using Flash Attention 2, we can pass the <code>attn_implementation=&quot;flash_attention_2&quot;</code> flag to <a href="https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained" rel="nofollow"><code>.from_pretrained</code></a>. We’ll also load the model in half-precision (e.g. <code>torch.float16</code>), since it results in almost no degradation to audio quality but significantly lower memory usage and faster inference:',Qo,Ve,Oo,Se,Ao,Ye,Ka="The following diagram shows the latency for the native attention implementation (no optimisation) against Better Transformer and Flash Attention 2. In all cases, we generate 400 semantic tokens on a 40GB A100 GPU with PyTorch 2.1. Flash Attention 2 is also consistently faster than Better Transformer, and its performance improves even more as batch sizes increase:",Ko,R,er='<img src="https://huggingface.co/datasets/ylacombe/benchmark-comparison/resolve/main/Bark%20Optimization%20Benchmark.png"/>',en,Xe,tr='To put this into perspective, on an NVIDIA A100 and when generating 400 semantic tokens with a batch size of 16, you can get 17 times the <a href="https://huggingface.co/blog/optimizing-bark#throughput" rel="nofollow">throughput</a> and still be 2 seconds faster than generating sentences one by one with the native model implementation. In other words, all the samples will be generated 17 times faster.',tn,qe,or="At batch size 8, on an NVIDIA A100, Flash Attention 2 is also 10% faster than Better Transformer, and at batch size 16, 25%.",on,Ee,nn,Re,nr="You can combine optimization techniques, and use CPU offload, half-precision and Flash Attention 2 (or 🤗 Better Transformer) all at once.",an,De,rn,Qe,ar='Find out more on inference optimization techniques <a href="https://huggingface.co/docs/transformers/perf_infer_gpu_one" rel="nofollow">here</a>.',sn,Oe,ln,Ae,rr=`Suno offers a library of voice presets in a number of languages <a href="https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c" rel="nofollow">here</a>.
These presets are also uploaded in the hub <a href="https://huggingface.co/suno/bark-small/tree/main/speaker_embeddings" rel="nofollow">here</a> or <a href="https://huggingface.co/suno/bark/tree/main/speaker_embeddings" rel="nofollow">here</a>.`,dn,Ke,cn,et,sr="Bark can generate highly realistic, <strong>multilingual</strong> speech as well as other audio - including music, background noise and simple sound effects.",mn,tt,pn,ot,ir="The model can also produce <strong>nonverbal communications</strong> like laughing, sighing and crying.",fn,nt,hn,at,lr="To save the audio, simply take the sample rate from the model config and some scipy utility:",un,rt,gn,st,_n,z,it,Vn,Ht,dr=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkModel">BarkModel</a>. It is used to instantiate a Bark
model according to the specified sub-models configurations, defining the model architecture.`,Sn,Lt,cr=`Instantiating a configuration with the defaults will yield a similar configuration to that of the Bark
<a href="https://huggingface.co/suno/bark" rel="nofollow">suno/bark</a> architecture.`,Yn,Vt,mr=`Configuration objects inherit from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Xn,D,lt,qn,St,pr='Instantiate a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkConfig">BarkConfig</a> (or a derived class) from bark sub-models configuration.',bn,dt,kn,j,ct,En,Yt,fr="Constructs a Bark processor which wraps a text tokenizer and optional Bark voice presets into a single processor.",Rn,Q,mt,Dn,Xt,hr=`Main method to prepare for the model one or several sequences(s). This method forwards the <code>text</code> and <code>kwargs</code>
arguments to the AutoTokenizer’s <code>__call__()</code> to encode the text. The method also proposes a
voice preset which is a dictionary of arrays that conditions <code>Bark</code>’s output. <code>kwargs</code> arguments are forwarded
to the tokenizer and to <code>cached_file</code> method if <code>voice_preset</code> is a valid filename.`,Qn,O,pt,On,qt,ur="Instantiate a Bark processor associated with a pretrained model.",An,A,ft,Kn,Et,gr=`Saves the attributes of this processor (tokenizer…) in the specified directory so that it can be reloaded
using the <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkProcessor.from_pretrained">from_pretrained()</a> method.`,yn,ht,vn,B,ut,ea,Rt,_r="The full Bark model, a text-to-speech model composed of 4 sub-models:",ta,Dt,br=`<li><a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a> (also referred to as the ‘text’ model): a causal auto-regressive transformer model that
takes
as input tokenized text, and predicts semantic text tokens that capture the meaning of the text.</li> <li><a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCoarseModel">BarkCoarseModel</a> (also refered to as the ‘coarse acoustics’ model), also a causal autoregressive transformer,
that takes into input the results of the last model. It aims at regressing the first two audio codebooks necessary
to <code>encodec</code>.</li> <li><a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a> (the ‘fine acoustics’ model), this time a non-causal autoencoder transformer, which iteratively
predicts the last codebooks based on the sum of the previous codebooks embeddings.</li> <li>having predicted all the codebook channels from the <a href="/docs/transformers/v4.36.1/en/model_doc/encodec#transformers.EncodecModel">EncodecModel</a>, Bark uses it to decode the output audio
array.</li>`,oa,Qt,kr=`It should be noted that each of the first three modules can support conditional speaker embeddings to condition the
output sound according to specific predefined voice.`,na,Ot,yr=`This model inherits from <a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,aa,At,vr=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,ra,L,gt,sa,Kt,Mr="Generates audio from an input prompt and an additional optional <code>Bark</code> speaker prompt.",ia,K,la,ee,_t,da,eo,wr=`Offloads all sub-models to CPU using accelerate, reducing memory usage with a low impact on performance. This
method moves one whole sub-model at a time to the GPU when it is used, and the sub-model remains in GPU until
the next sub-model runs.`,Mn,bt,wn,I,kt,ca,to,Tr=`Bark semantic (or text) model. It shares the same architecture as the coarse model.
It is a GPT-2 like autoregressive model with a language modeling head on top.
This model inherits from <a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ma,oo,$r=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,pa,V,yt,fa,no,Br='The <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCausalModel">BarkCausalModel</a> forward method, overrides the <code>__call__</code> special method.',ha,te,Tn,vt,$n,W,Mt,ua,ao,Cr=`Bark coarse acoustics model.
It shares the same architecture as the semantic (or text) model. It is a GPT-2 like autoregressive model with a
language modeling head on top.
This model inherits from <a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ga,ro,xr=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,_a,S,wt,ba,so,Jr='The <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCausalModel">BarkCausalModel</a> forward method, overrides the <code>__call__</code> special method.',ka,oe,Bn,Tt,Cn,Z,$t,ya,io,zr=`Bark fine acoustics model. It is a non-causal GPT-like model with <code>config.n_codes_total</code> embedding layers and
language modeling heads, one for each codebook.
This model inherits from <a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,va,lo,jr=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ma,Y,Bt,wa,co,Ur='The <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a> forward method, overrides the <code>__call__</code> special method.',Ta,ne,xn,Ct,Jn,q,xt,$a,X,Jt,Ba,mo,Ir='The <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCausalModel">BarkCausalModel</a> forward method, overrides the <code>__call__</code> special method.',Ca,ae,zn,zt,jn,N,jt,xa,po,Wr=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCoarseModel">BarkCoarseModel</a>. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark <a href="https://huggingface.co/suno/bark" rel="nofollow">suno/bark</a>
architecture.`,Ja,fo,Zr=`Configuration objects inherit from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,za,re,Un,Ut,In,F,It,ja,ho,Nr=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a>. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark <a href="https://huggingface.co/suno/bark" rel="nofollow">suno/bark</a>
architecture.`,Ua,uo,Fr=`Configuration objects inherit from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ia,se,Wn,Wt,Zn,P,Zt,Wa,go,Pr=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a>. It is used to instantiate the model
according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the Bark <a href="https://huggingface.co/suno/bark" rel="nofollow">suno/bark</a>
architecture.`,Za,_o,Gr=`Configuration objects inherit from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.36.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Na,ie,Nn,Mo,Fn;return v=new $({props:{title:"Bark",local:"bark",headingTag:"h1"}}),M=new $({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ye=new $({props:{title:"Optimizing Bark",local:"optimizing-bark",headingTag:"h3"}}),Me=new $({props:{title:"Using half-precision",local:"using-half-precision",headingTag:"h4"}}),Te=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEFtb2RlbCUyMCUzRCUyMEJhcmtNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmstc21hbGwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKGRldmljZSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkModel
<span class="hljs-keyword">import</span> torch

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>, torch_dtype=torch.float16).to(device)`,wrap:!1}}),$e=new $({props:{title:"Using CPU offload",local:"using-cpu-offload",headingTag:"h4"}}),xe=new U({props:{code:"bW9kZWwuZW5hYmxlX2NwdV9vZmZsb2FkKCk=",highlighted:"model.enable_cpu_offload()",wrap:!1}}),ze=new $({props:{title:"Using Better Transformer",local:"using-better-transformer",headingTag:"h4"}}),Ue=new U({props:{code:"bW9kZWwlMjAlM0QlMjAlMjBtb2RlbC50b19iZXR0ZXJ0cmFuc2Zvcm1lcigp",highlighted:"model =  model.to_bettertransformer()",wrap:!1}}),We=new $({props:{title:"Using Flash Attention 2",local:"using-flash-attention-2",headingTag:"h4"}}),Ne=new $({props:{title:"Installation",local:"installation",headingTag:"h5"}}),Ge=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1VJTIwZmxhc2gtYXR0biUyMC0tbm8tYnVpbGQtaXNvbGF0aW9u",highlighted:"pip install -U flash-attn --no-build-isolation",wrap:!1}}),He=new $({props:{title:"Usage",local:"usage",headingTag:"h5"}}),Ve=new U({props:{code:"bW9kZWwlMjAlM0QlMjBCYXJrTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnN1bm8lMkZiYXJrLXNtYWxsJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMmZsYXNoX2F0dGVudGlvbl8yJTIyKS50byhkZXZpY2Up",highlighted:'model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>, torch_dtype=torch.float16, attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>).to(device)',wrap:!1}}),Se=new $({props:{title:"Performance comparison",local:"performance-comparison",headingTag:"h5"}}),Ee=new $({props:{title:"Combining optimization techniques",local:"combining-optimization-techniques",headingTag:"h4"}}),De=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEElMEElMjMlMjBsb2FkJTIwaW4lMjBmcDE2JTIwYW5kJTIwdXNlJTIwRmxhc2glMjBBdHRlbnRpb24lMjAyJTBBbW9kZWwlMjAlM0QlMjBCYXJrTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnN1bm8lMkZiYXJrLXNtYWxsJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMmZsYXNoX2F0dGVudGlvbl8yJTIyKS50byhkZXZpY2UpJTBBJTBBJTIzJTIwZW5hYmxlJTIwQ1BVJTIwb2ZmbG9hZCUwQW1vZGVsLmVuYWJsZV9jcHVfb2ZmbG9hZCgp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkModel
<span class="hljs-keyword">import</span> torch

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>

<span class="hljs-comment"># load in fp16 and use Flash Attention 2</span>
model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>, torch_dtype=torch.float16, attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>).to(device)

<span class="hljs-comment"># enable CPU offload</span>
model.enable_cpu_offload()`,wrap:!1}}),Oe=new $({props:{title:"Usage tips",local:"usage-tips",headingTag:"h3"}}),Ke=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBCYXJrTW9kZWwlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzdW5vJTJGYmFyayUyMiklMEFtb2RlbCUyMCUzRCUyMEJhcmtNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmslMjIpJTBBJTBBdm9pY2VfcHJlc2V0JTIwJTNEJTIwJTIydjIlMkZlbl9zcGVha2VyXzYlMjIlMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHZvaWNlX3ByZXNldCUzRHZvaWNlX3ByZXNldCklMEElMEFhdWRpb19hcnJheSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKSUwQWF1ZGlvX2FycmF5JTIwJTNEJTIwYXVkaW9fYXJyYXkuY3B1KCkubnVtcHkoKS5zcXVlZXplKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, BarkModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;suno/bark&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>voice_preset = <span class="hljs-string">&quot;v2/en_speaker_6&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, voice_preset=voice_preset)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`,wrap:!1}}),tt=new U({props:{code:"JTIzJTIwTXVsdGlsaW5ndWFsJTIwc3BlZWNoJTIwLSUyMHNpbXBsaWZpZWQlMjBDaGluZXNlJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKCUyMiVFNiU4MyU4QSVFNCVCQSVCQSVFNyU5QSU4NCVFRiVCQyU4MSVFNiU4OCU5MSVFNCVCQyU5QSVFOCVBRiVCNCVFNCVCOCVBRCVFNiU5NiU4NyUyMiklMEElMEElMjMlMjBNdWx0aWxpbmd1YWwlMjBzcGVlY2glMjAtJTIwRnJlbmNoJTIwLSUyMGxldCdzJTIwdXNlJTIwYSUyMHZvaWNlX3ByZXNldCUyMGFzJTIwd2VsbCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjJJbmNyb3lhYmxlISUyMEplJTIwcGV1eCUyMGclQzMlQTluJUMzJUE5cmVyJTIwZHUlMjBzb24uJTIyJTJDJTIwdm9pY2VfcHJlc2V0JTNEJTIyZnJfc3BlYWtlcl81JTIyKSUwQSUwQSUyMyUyMEJhcmslMjBjYW4lMjBhbHNvJTIwZ2VuZXJhdGUlMjBtdXNpYy4lMjBZb3UlMjBjYW4lMjBoZWxwJTIwaXQlMjBvdXQlMjBieSUyMGFkZGluZyUyMG11c2ljJTIwbm90ZXMlMjBhcm91bmQlMjB5b3VyJTIwbHlyaWNzLiUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjIlRTIlOTklQUElMjBIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIwJUUyJTk5JUFBJTIyKSUwQSUwQWF1ZGlvX2FycmF5JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMpJTBBYXVkaW9fYXJyYXklMjAlM0QlMjBhdWRpb19hcnJheS5jcHUoKS5udW1weSgpLnNxdWVlemUoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multilingual speech - simplified Chinese</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;惊人的！我会说中文&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multilingual speech - French - let&#x27;s use a voice_preset as well</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Incroyable! Je peux générer du son.&quot;</span>, voice_preset=<span class="hljs-string">&quot;fr_speaker_5&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Bark can also generate music. You can help it out by adding music notes around your lyrics.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;♪ Hello, my dog is cute ♪&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`,wrap:!1}}),nt=new U({props:{code:"JTIzJTIwQWRkaW5nJTIwbm9uLXNwZWVjaCUyMGN1ZXMlMjB0byUyMHRoZSUyMGlucHV0JTIwdGV4dCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMjJIZWxsbyUyMHVoJTIwLi4uJTIwJTVCY2xlYXJzJTIwdGhyb2F0JTVEJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjAlNUJsYXVnaHRlciU1RCUyMiklMEElMEFhdWRpb19hcnJheSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKSUwQWF1ZGlvX2FycmF5JTIwJTNEJTIwYXVkaW9fYXJyYXkuY3B1KCkubnVtcHkoKS5zcXVlZXplKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Adding non-speech cues to the input text</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(<span class="hljs-string">&quot;Hello uh ... [clears throat], my dog is cute [laughter]&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = model.generate(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_array = audio_array.cpu().numpy().squeeze()`,wrap:!1}}),rt=new U({props:{code:"ZnJvbSUyMHNjaXB5LmlvLndhdmZpbGUlMjBpbXBvcnQlMjB3cml0ZSUyMGFzJTIwd3JpdGVfd2F2JTBBJTBBJTIzJTIwc2F2ZSUyMGF1ZGlvJTIwdG8lMjBkaXNrJTJDJTIwYnV0JTIwZmlyc3QlMjB0YWtlJTIwdGhlJTIwc2FtcGxlJTIwcmF0ZSUyMGZyb20lMjB0aGUlMjBtb2RlbCUyMGNvbmZpZyUwQXNhbXBsZV9yYXRlJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGlvbl9jb25maWcuc2FtcGxlX3JhdGUlMEF3cml0ZV93YXYoJTIyYmFya19nZW5lcmF0aW9uLndhdiUyMiUyQyUyMHNhbXBsZV9yYXRlJTJDJTIwYXVkaW9fYXJyYXkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> scipy.io.wavfile <span class="hljs-keyword">import</span> write <span class="hljs-keyword">as</span> write_wav

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># save audio to disk, but first take the sample rate from the model config</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>sample_rate = model.generation_config.sample_rate
<span class="hljs-meta">&gt;&gt;&gt; </span>write_wav(<span class="hljs-string">&quot;bark_generation.wav&quot;</span>, sample_rate, audio_array)`,wrap:!1}}),st=new $({props:{title:"BarkConfig",local:"transformers.BarkConfig",headingTag:"h2"}}),it=new C({props:{name:"class transformers.BarkConfig",anchor:"transformers.BarkConfig",parameters:[{name:"semantic_config",val:": typing.Dict = None"},{name:"coarse_acoustics_config",val:": typing.Dict = None"},{name:"fine_acoustics_config",val:": typing.Dict = None"},{name:"codec_config",val:": typing.Dict = None"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkConfig.semantic_config",description:`<strong>semantic_config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticConfig">BarkSemanticConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying semantic sub-model.`,name:"semantic_config"},{anchor:"transformers.BarkConfig.coarse_acoustics_config",description:`<strong>coarse_acoustics_config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCoarseConfig">BarkCoarseConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying coarse acoustics sub-model.`,name:"coarse_acoustics_config"},{anchor:"transformers.BarkConfig.fine_acoustics_config",description:`<strong>fine_acoustics_config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineConfig">BarkFineConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying fine acoustics sub-model.`,name:"fine_acoustics_config"},{anchor:"transformers.BarkConfig.codec_config",description:`<strong>codec_config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/auto#transformers.AutoConfig">AutoConfig</a>, <em>optional</em>) &#x2014;
Configuration of the underlying codec sub-model.</p>
<p>Example &#x2014;`,name:"codec_config"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/configuration_bark.py#L219"}}),lt=new C({props:{name:"from_sub_model_configs",anchor:"transformers.BarkConfig.from_sub_model_configs",parameters:[{name:"semantic_config",val:": BarkSemanticConfig"},{name:"coarse_acoustics_config",val:": BarkCoarseConfig"},{name:"fine_acoustics_config",val:": BarkFineConfig"},{name:"codec_config",val:": PretrainedConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/configuration_bark.py#L309",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>An instance of a configuration object</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkConfig"
>BarkConfig</a></p>
`}}),dt=new $({props:{title:"BarkProcessor",local:"transformers.BarkProcessor",headingTag:"h2"}}),ct=new C({props:{name:"class transformers.BarkProcessor",anchor:"transformers.BarkProcessor",parameters:[{name:"tokenizer",val:""},{name:"speaker_embeddings",val:" = None"}],parametersDescription:[{anchor:"transformers.BarkProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
An instance of <a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>.`,name:"tokenizer"},{anchor:"transformers.BarkProcessor.speaker_embeddings",description:`<strong>speaker_embeddings</strong> (<code>Dict[Dict[str]]</code>, <em>optional</em>) &#x2014;
Optional nested speaker embeddings dictionary. The first level contains voice preset names (e.g
<code>&quot;en_speaker_4&quot;</code>). The second level contains <code>&quot;semantic_prompt&quot;</code>, <code>&quot;coarse_prompt&quot;</code> and <code>&quot;fine_prompt&quot;</code>
embeddings. The values correspond to the path of the corresponding <code>np.ndarray</code>. See
<a href="https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c" rel="nofollow">here</a> for
a list of <code>voice_preset_names</code>.`,name:"speaker_embeddings"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/processing_bark.py#L34"}}),mt=new C({props:{name:"__call__",anchor:"transformers.BarkProcessor.__call__",parameters:[{name:"text",val:" = None"},{name:"voice_preset",val:" = None"},{name:"return_tensors",val:" = 'pt'"},{name:"max_length",val:" = 256"},{name:"add_special_tokens",val:" = False"},{name:"return_attention_mask",val:" = True"},{name:"return_token_type_ids",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkProcessor.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.BarkProcessor.__call__.voice_preset",description:`<strong>voice_preset</strong> (<code>str</code>, <code>Dict[np.ndarray]</code>) &#x2014;
The voice preset, i.e the speaker embeddings. It can either be a valid voice_preset name, e.g
<code>&quot;en_speaker_1&quot;</code>, or directly a dictionnary of <code>np.ndarray</code> embeddings for each submodel of <code>Bark</code>. Or
it can be a valid file name of a local <code>.npz</code> single voice preset.`,name:"voice_preset"},{anchor:"transformers.BarkProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.36.1/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/processing_bark.py#L219",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A tuple composed of a <a
  href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a>, i.e the output of the
<code>tokenizer</code> and a <a
  href="/docs/transformers/v4.36.1/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a>, i.e the voice preset with the right tensors type.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Tuple(<a
  href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a>, <a
  href="/docs/transformers/v4.36.1/en/main_classes/image_processor#transformers.BatchFeature"
>BatchFeature</a>)</p>
`}}),pt=new C({props:{name:"from_pretrained",anchor:"transformers.BarkProcessor.from_pretrained",parameters:[{name:"pretrained_processor_name_or_path",val:""},{name:"speaker_embeddings_dict_path",val:" = 'speaker_embeddings_path.json'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkProcessor.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkProcessor">BarkProcessor</a> hosted inside a model repo on
huggingface.co. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or
namespaced under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>a path to a <em>directory</em> containing a processor saved using the <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkProcessor.save_pretrained">save_pretrained()</a>
method, e.g., <code>./my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.BarkProcessor.from_pretrained.speaker_embeddings_dict_path",description:`<strong>speaker_embeddings_dict_path</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;speaker_embeddings_path.json&quot;</code>) &#x2014;
The name of the <code>.json</code> file containing the speaker_embeddings dictionnary located in
<code>pretrained_model_name_or_path</code>. If <code>None</code>, no speaker_embeddings is loaded.
**kwargs &#x2014;
Additional keyword arguments passed along to both
<code>~tokenization_utils_base.PreTrainedTokenizer.from_pretrained</code>.`,name:"speaker_embeddings_dict_path"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/processing_bark.py#L64"}}),ft=new C({props:{name:"save_pretrained",anchor:"transformers.BarkProcessor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"speaker_embeddings_dict_path",val:" = 'speaker_embeddings_path.json'"},{name:"speaker_embeddings_directory",val:" = 'speaker_embeddings'"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkProcessor.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the tokenizer files and the speaker embeddings will be saved (directory will be created
if it does not exist).`,name:"save_directory"},{anchor:"transformers.BarkProcessor.save_pretrained.speaker_embeddings_dict_path",description:`<strong>speaker_embeddings_dict_path</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;speaker_embeddings_path.json&quot;</code>) &#x2014;
The name of the <code>.json</code> file that will contains the speaker_embeddings nested path dictionnary, if it
exists, and that will be located in <code>pretrained_model_name_or_path/speaker_embeddings_directory</code>.`,name:"speaker_embeddings_dict_path"},{anchor:"transformers.BarkProcessor.save_pretrained.speaker_embeddings_directory",description:`<strong>speaker_embeddings_directory</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;speaker_embeddings/&quot;</code>) &#x2014;
The name of the folder in which the speaker_embeddings arrays will be saved.`,name:"speaker_embeddings_directory"},{anchor:"transformers.BarkProcessor.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).
kwargs &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/v4.36.1/en/main_classes/processors#transformers.ProcessorMixin.push_to_hub">push_to_hub()</a> method.`,name:"push_to_hub"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/processing_bark.py#L118"}}),ht=new $({props:{title:"BarkModel",local:"transformers.BarkModel",headingTag:"h2"}}),ut=new C({props:{name:"class transformers.BarkModel",anchor:"transformers.BarkModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkConfig">BarkConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L1648"}}),gt=new C({props:{name:"generate",anchor:"transformers.BarkModel.generate",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"history_prompt",val:": typing.Union[typing.Dict[str, torch.Tensor], NoneType] = None"},{name:"return_output_lengths",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkModel.generate.input_ids",description:`<strong>input_ids</strong> (<code>Optional[torch.Tensor]</code> of shape (batch_size, seq_len), <em>optional</em>) &#x2014;
Input ids. Will be truncated up to 256 tokens. Note that the output audios will be as long as the
longest generation among the batch.`,name:"input_ids"},{anchor:"transformers.BarkModel.generate.history_prompt",description:`<strong>history_prompt</strong> (<code>Optional[Dict[str,torch.Tensor]]</code>, <em>optional</em>) &#x2014;
Optional <code>Bark</code> speaker prompt. Note that for now, this model takes only one speaker prompt per batch.`,name:"history_prompt"},{anchor:"transformers.BarkModel.generate.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014; Remaining dictionary of keyword arguments. Keyword arguments are of two types:</p>
<ul>
<li>Without a prefix, they will be entered as <code>**kwargs</code> for the <code>generate</code> method of each sub-model.</li>
<li>With a <em>semantic_</em>, <em>coarse_</em>, <em>fine_</em> prefix, they will be input for the <code>generate</code> method of the
semantic, coarse and fine respectively. It has the priority over the keywords without a prefix.</li>
</ul>
<p>This means you can, for example, specify a generation strategy for all sub-models except one.`,name:"kwargs"},{anchor:"transformers.BarkModel.generate.return_output_lengths",description:`<strong>return_output_lengths</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the waveform lengths. Useful when batching.`,name:"return_output_lengths"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L1737",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><strong>audio_waveform</strong> (<code>torch.Tensor</code> of shape (batch_size, seq_len)): Generated audio waveform.
When <code>return_output_lengths=True</code>:
Returns a tuple made of:</li>
<li><strong>audio_waveform</strong> (<code>torch.Tensor</code> of shape (batch_size, seq_len)): Generated audio waveform.</li>
<li><strong>output_lengths</strong> (<code>torch.Tensor</code> of shape (batch_size)): The length of each waveform in the batch</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>By default</p>
`}}),K=new Ln({props:{anchor:"transformers.BarkModel.generate.example",$$slots:{default:[qr]},$$scope:{ctx:J}}}),_t=new C({props:{name:"enable_cpu_offload",anchor:"transformers.BarkModel.enable_cpu_offload",parameters:[{name:"gpu_id",val:": typing.Optional[int] = 0"}],parametersDescription:[{anchor:"transformers.BarkModel.enable_cpu_offload.gpu_id",description:`<strong>gpu_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
GPU id on which the sub-models will be loaded and offloaded.`,name:"gpu_id"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L1680"}}),bt=new $({props:{title:"BarkSemanticModel",local:"transformers.BarkSemanticModel",headingTag:"h2"}}),kt=new C({props:{name:"class transformers.BarkSemanticModel",anchor:"transformers.BarkSemanticModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkSemanticModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticConfig">BarkSemanticConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L918"}}),yt=new C({props:{name:"forward",anchor:"transformers.BarkSemanticModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkSemanticModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Indices can be obtained using <a href="/docs/transformers/v4.36.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BarkSemanticModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BarkSemanticModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkSemanticModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkSemanticModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkSemanticModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.
Here, due to <code>Bark</code> particularities, if <code>past_key_values</code> is used, <code>input_embeds</code> will be ignored and you
have to use <code>input_ids</code>. If <code>past_key_values</code> is not used and <code>use_cache</code> is set to <code>True</code>, <code>input_embeds</code>
is used in priority instead of <code>input_ids</code>.`,name:"input_embeds"},{anchor:"transformers.BarkSemanticModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BarkSemanticModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkSemanticModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkSemanticModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.36.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L749"}}),te=new Hn({props:{$$slots:{default:[Er]},$$scope:{ctx:J}}}),vt=new $({props:{title:"BarkCoarseModel",local:"transformers.BarkCoarseModel",headingTag:"h2"}}),Mt=new C({props:{name:"class transformers.BarkCoarseModel",anchor:"transformers.BarkCoarseModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkCoarseModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCoarseConfig">BarkCoarseConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L1028"}}),wt=new C({props:{name:"forward",anchor:"transformers.BarkCoarseModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkCoarseModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Indices can be obtained using <a href="/docs/transformers/v4.36.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BarkCoarseModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BarkCoarseModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkCoarseModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkCoarseModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkCoarseModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.
Here, due to <code>Bark</code> particularities, if <code>past_key_values</code> is used, <code>input_embeds</code> will be ignored and you
have to use <code>input_ids</code>. If <code>past_key_values</code> is not used and <code>use_cache</code> is set to <code>True</code>, <code>input_embeds</code>
is used in priority instead of <code>input_ids</code>.`,name:"input_embeds"},{anchor:"transformers.BarkCoarseModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BarkCoarseModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkCoarseModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkCoarseModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.36.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L749"}}),oe=new Hn({props:{$$slots:{default:[Rr]},$$scope:{ctx:J}}}),Tt=new $({props:{title:"BarkFineModel",local:"transformers.BarkFineModel",headingTag:"h2"}}),$t=new C({props:{name:"class transformers.BarkFineModel",anchor:"transformers.BarkFineModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BarkFineModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineConfig">BarkFineConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.36.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L1248"}}),Bt=new C({props:{name:"forward",anchor:"transformers.BarkFineModel.forward",parameters:[{name:"codebook_idx",val:": int"},{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkFineModel.forward.codebook_idx",description:`<strong>codebook_idx</strong> (<code>int</code>) &#x2014;
Index of the codebook that will be predicted.`,name:"codebook_idx"},{anchor:"transformers.BarkFineModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, number_of_codebooks)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Initially, indices of the first two codebooks are obtained from the <code>coarse</code> sub-model. The rest is
predicted recursively by attending the previously predicted channels. The model predicts on windows of
length 1024.`,name:"input_ids"},{anchor:"transformers.BarkFineModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkFineModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkFineModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkFineModel.forward.labels",description:"<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014; NOT IMPLEMENTED YET.",name:"labels"},{anchor:"transformers.BarkFineModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. If
<code>past_key_values</code> is used, optionally only the last <code>input_embeds</code> have to be input (see
<code>past_key_values</code>). This is useful if you want more control over how to convert <code>input_ids</code> indices into
associated vectors than the model&#x2019;s internal embedding lookup matrix.`,name:"input_embeds"},{anchor:"transformers.BarkFineModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkFineModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkFineModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.36.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L1381"}}),ne=new Hn({props:{$$slots:{default:[Dr]},$$scope:{ctx:J}}}),Ct=new $({props:{title:"BarkCausalModel",local:"transformers.BarkCausalModel",headingTag:"h2"}}),xt=new C({props:{name:"class transformers.BarkCausalModel",anchor:"transformers.BarkCausalModel",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L658"}}),Jt=new C({props:{name:"forward",anchor:"transformers.BarkCausalModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"input_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.BarkCausalModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it. Indices can be obtained using <a href="/docs/transformers/v4.36.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.36.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details. <a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.BarkCausalModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BarkCausalModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.BarkCausalModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BarkCausalModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</code> of shape <code>(encoder_layers, encoder_attention_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the attention modules in the encoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.BarkCausalModel.forward.input_embeds",description:`<strong>input_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, input_sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation.
Here, due to <code>Bark</code> particularities, if <code>past_key_values</code> is used, <code>input_embeds</code> will be ignored and you
have to use <code>input_ids</code>. If <code>past_key_values</code> is not used and <code>use_cache</code> is set to <code>True</code>, <code>input_embeds</code>
is used in priority instead of <code>input_ids</code>.`,name:"input_embeds"},{anchor:"transformers.BarkCausalModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.BarkCausalModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.BarkCausalModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.BarkCausalModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.36.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/modeling_bark.py#L749"}}),ae=new Hn({props:{$$slots:{default:[Qr]},$$scope:{ctx:J}}}),zt=new $({props:{title:"BarkCoarseConfig",local:"transformers.BarkCoarseConfig",headingTag:"h2"}}),jt=new C({props:{name:"class transformers.BarkCoarseConfig",anchor:"transformers.BarkCoarseConfig",parameters:[{name:"block_size",val:" = 1024"},{name:"input_vocab_size",val:" = 10048"},{name:"output_vocab_size",val:" = 10048"},{name:"num_layers",val:" = 12"},{name:"num_heads",val:" = 12"},{name:"hidden_size",val:" = 768"},{name:"dropout",val:" = 0.0"},{name:"bias",val:" = True"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkCoarseConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"block_size"},{anchor:"transformers.BarkCoarseConfig.input_vocab_size",description:`<strong>input_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCoarseModel">BarkCoarseModel</a>. Defaults to 10_048 but should be carefully thought with
regards to the chosen sub-model.`,name:"input_vocab_size"},{anchor:"transformers.BarkCoarseConfig.output_vocab_size",description:`<strong>output_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
by the: <code>output_ids</code> when passing forward a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkCoarseModel">BarkCoarseModel</a>. Defaults to 10_048 but should be carefully thought
with regards to the chosen sub-model.`,name:"output_vocab_size"},{anchor:"transformers.BarkCoarseConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the given sub-model.`,name:"num_layers"},{anchor:"transformers.BarkCoarseConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer architecture.`,name:"num_heads"},{anchor:"transformers.BarkCoarseConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the architecture.`,name:"hidden_size"},{anchor:"transformers.BarkCoarseConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BarkCoarseConfig.bias",description:`<strong>bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use bias in the linear layers and layer norm layers.`,name:"bias"},{anchor:"transformers.BarkCoarseConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BarkCoarseConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/configuration_bark.py#L182"}}),re=new Ln({props:{anchor:"transformers.BarkCoarseConfig.example",$$slots:{default:[Or]},$$scope:{ctx:J}}}),Ut=new $({props:{title:"BarkFineConfig",local:"transformers.BarkFineConfig",headingTag:"h2"}}),It=new C({props:{name:"class transformers.BarkFineConfig",anchor:"transformers.BarkFineConfig",parameters:[{name:"tie_word_embeddings",val:" = True"},{name:"n_codes_total",val:" = 8"},{name:"n_codes_given",val:" = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkFineConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"block_size"},{anchor:"transformers.BarkFineConfig.input_vocab_size",description:`<strong>input_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a>. Defaults to 10_048 but should be carefully thought with
regards to the chosen sub-model.`,name:"input_vocab_size"},{anchor:"transformers.BarkFineConfig.output_vocab_size",description:`<strong>output_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
by the: <code>output_ids</code> when passing forward a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkFineModel">BarkFineModel</a>. Defaults to 10_048 but should be carefully thought
with regards to the chosen sub-model.`,name:"output_vocab_size"},{anchor:"transformers.BarkFineConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the given sub-model.`,name:"num_layers"},{anchor:"transformers.BarkFineConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer architecture.`,name:"num_heads"},{anchor:"transformers.BarkFineConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the architecture.`,name:"hidden_size"},{anchor:"transformers.BarkFineConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BarkFineConfig.bias",description:`<strong>bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use bias in the linear layers and layer norm layers.`,name:"bias"},{anchor:"transformers.BarkFineConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BarkFineConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"},{anchor:"transformers.BarkFineConfig.n_codes_total",description:`<strong>n_codes_total</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The total number of audio codebooks predicted. Used in the fine acoustics sub-model.`,name:"n_codes_total"},{anchor:"transformers.BarkFineConfig.n_codes_given",description:`<strong>n_codes_given</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of audio codebooks predicted in the coarse acoustics sub-model. Used in the acoustics
sub-models.`,name:"n_codes_given"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/configuration_bark.py#L209"}}),se=new Ln({props:{anchor:"transformers.BarkFineConfig.example",$$slots:{default:[Ar]},$$scope:{ctx:J}}}),Wt=new $({props:{title:"BarkSemanticConfig",local:"transformers.BarkSemanticConfig",headingTag:"h2"}}),Zt=new C({props:{name:"class transformers.BarkSemanticConfig",anchor:"transformers.BarkSemanticConfig",parameters:[{name:"block_size",val:" = 1024"},{name:"input_vocab_size",val:" = 10048"},{name:"output_vocab_size",val:" = 10048"},{name:"num_layers",val:" = 12"},{name:"num_heads",val:" = 12"},{name:"hidden_size",val:" = 768"},{name:"dropout",val:" = 0.0"},{name:"bias",val:" = True"},{name:"initializer_range",val:" = 0.02"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BarkSemanticConfig.block_size",description:`<strong>block_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"block_size"},{anchor:"transformers.BarkSemanticConfig.input_vocab_size",description:`<strong>input_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a>. Defaults to 10_048 but should be carefully thought with
regards to the chosen sub-model.`,name:"input_vocab_size"},{anchor:"transformers.BarkSemanticConfig.output_vocab_size",description:`<strong>output_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 10_048) &#x2014;
Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
by the: <code>output_ids</code> when passing forward a <a href="/docs/transformers/v4.36.1/en/model_doc/bark#transformers.BarkSemanticModel">BarkSemanticModel</a>. Defaults to 10_048 but should be carefully thought
with regards to the chosen sub-model.`,name:"output_vocab_size"},{anchor:"transformers.BarkSemanticConfig.num_layers",description:`<strong>num_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the given sub-model.`,name:"num_layers"},{anchor:"transformers.BarkSemanticConfig.num_heads",description:`<strong>num_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer architecture.`,name:"num_heads"},{anchor:"transformers.BarkSemanticConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the architecture.`,name:"hidden_size"},{anchor:"transformers.BarkSemanticConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.BarkSemanticConfig.bias",description:`<strong>bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use bias in the linear layers and layer norm layers.`,name:"bias"},{anchor:"transformers.BarkSemanticConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.BarkSemanticConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.36.1/src/transformers/models/bark/configuration_bark.py#L160"}}),ie=new Ln({props:{anchor:"transformers.BarkSemanticConfig.example",$$slots:{default:[Kr]},$$scope:{ctx:J}}}),{c(){d=i("meta"),y=n(),b=i("p"),k=n(),p(v.$$.fragment),m=n(),p(M.$$.fragment),wo=n(),ue=i("p"),ue.innerHTML=Fa,To=n(),ge=i("p"),ge.textContent=Pa,$o=n(),_e=i("ul"),_e.innerHTML=Ga,Bo=n(),be=i("p"),be.textContent=Ha,Co=n(),ke=i("p"),ke.innerHTML=La,xo=n(),p(ye.$$.fragment),Jo=n(),ve=i("p"),ve.innerHTML=Va,zo=n(),p(Me.$$.fragment),jo=n(),we=i("p"),we.textContent=Sa,Uo=n(),p(Te.$$.fragment),Io=n(),p($e.$$.fragment),Wo=n(),Be=i("p"),Be.textContent=Ya,Zo=n(),Ce=i("p"),Ce.innerHTML=Xa,No=n(),p(xe.$$.fragment),Fo=n(),Je=i("p"),Je.innerHTML=qa,Po=n(),p(ze.$$.fragment),Go=n(),je=i("p"),je.textContent=Ea,Ho=n(),p(Ue.$$.fragment),Lo=n(),Ie=i("p"),Ie.innerHTML=Ra,Vo=n(),p(We.$$.fragment),So=n(),Ze=i("p"),Ze.textContent=Da,Yo=n(),p(Ne.$$.fragment),Xo=n(),Fe=i("p"),Fe.innerHTML=Qa,qo=n(),Pe=i("p"),Pe.innerHTML=Oa,Eo=n(),p(Ge.$$.fragment),Ro=n(),p(He.$$.fragment),Do=n(),Le=i("p"),Le.innerHTML=Aa,Qo=n(),p(Ve.$$.fragment),Oo=n(),p(Se.$$.fragment),Ao=n(),Ye=i("p"),Ye.textContent=Ka,Ko=n(),R=i("div"),R.innerHTML=er,en=n(),Xe=i("p"),Xe.innerHTML=tr,tn=n(),qe=i("p"),qe.textContent=or,on=n(),p(Ee.$$.fragment),nn=n(),Re=i("p"),Re.textContent=nr,an=n(),p(De.$$.fragment),rn=n(),Qe=i("p"),Qe.innerHTML=ar,sn=n(),p(Oe.$$.fragment),ln=n(),Ae=i("p"),Ae.innerHTML=rr,dn=n(),p(Ke.$$.fragment),cn=n(),et=i("p"),et.innerHTML=sr,mn=n(),p(tt.$$.fragment),pn=n(),ot=i("p"),ot.innerHTML=ir,fn=n(),p(nt.$$.fragment),hn=n(),at=i("p"),at.textContent=lr,un=n(),p(rt.$$.fragment),gn=n(),p(st.$$.fragment),_n=n(),z=i("div"),p(it.$$.fragment),Vn=n(),Ht=i("p"),Ht.innerHTML=dr,Sn=n(),Lt=i("p"),Lt.innerHTML=cr,Yn=n(),Vt=i("p"),Vt.innerHTML=mr,Xn=n(),D=i("div"),p(lt.$$.fragment),qn=n(),St=i("p"),St.innerHTML=pr,bn=n(),p(dt.$$.fragment),kn=n(),j=i("div"),p(ct.$$.fragment),En=n(),Yt=i("p"),Yt.textContent=fr,Rn=n(),Q=i("div"),p(mt.$$.fragment),Dn=n(),Xt=i("p"),Xt.innerHTML=hr,Qn=n(),O=i("div"),p(pt.$$.fragment),On=n(),qt=i("p"),qt.textContent=ur,An=n(),A=i("div"),p(ft.$$.fragment),Kn=n(),Et=i("p"),Et.innerHTML=gr,yn=n(),p(ht.$$.fragment),vn=n(),B=i("div"),p(ut.$$.fragment),ea=n(),Rt=i("p"),Rt.textContent=_r,ta=n(),Dt=i("ul"),Dt.innerHTML=br,oa=n(),Qt=i("p"),Qt.textContent=kr,na=n(),Ot=i("p"),Ot.innerHTML=yr,aa=n(),At=i("p"),At.innerHTML=vr,ra=n(),L=i("div"),p(gt.$$.fragment),sa=n(),Kt=i("p"),Kt.innerHTML=Mr,ia=n(),p(K.$$.fragment),la=n(),ee=i("div"),p(_t.$$.fragment),da=n(),eo=i("p"),eo.textContent=wr,Mn=n(),p(bt.$$.fragment),wn=n(),I=i("div"),p(kt.$$.fragment),ca=n(),to=i("p"),to.innerHTML=Tr,ma=n(),oo=i("p"),oo.innerHTML=$r,pa=n(),V=i("div"),p(yt.$$.fragment),fa=n(),no=i("p"),no.innerHTML=Br,ha=n(),p(te.$$.fragment),Tn=n(),p(vt.$$.fragment),$n=n(),W=i("div"),p(Mt.$$.fragment),ua=n(),ao=i("p"),ao.innerHTML=Cr,ga=n(),ro=i("p"),ro.innerHTML=xr,_a=n(),S=i("div"),p(wt.$$.fragment),ba=n(),so=i("p"),so.innerHTML=Jr,ka=n(),p(oe.$$.fragment),Bn=n(),p(Tt.$$.fragment),Cn=n(),Z=i("div"),p($t.$$.fragment),ya=n(),io=i("p"),io.innerHTML=zr,va=n(),lo=i("p"),lo.innerHTML=jr,Ma=n(),Y=i("div"),p(Bt.$$.fragment),wa=n(),co=i("p"),co.innerHTML=Ur,Ta=n(),p(ne.$$.fragment),xn=n(),p(Ct.$$.fragment),Jn=n(),q=i("div"),p(xt.$$.fragment),$a=n(),X=i("div"),p(Jt.$$.fragment),Ba=n(),mo=i("p"),mo.innerHTML=Ir,Ca=n(),p(ae.$$.fragment),zn=n(),p(zt.$$.fragment),jn=n(),N=i("div"),p(jt.$$.fragment),xa=n(),po=i("p"),po.innerHTML=Wr,Ja=n(),fo=i("p"),fo.innerHTML=Zr,za=n(),p(re.$$.fragment),Un=n(),p(Ut.$$.fragment),In=n(),F=i("div"),p(It.$$.fragment),ja=n(),ho=i("p"),ho.innerHTML=Nr,Ua=n(),uo=i("p"),uo.innerHTML=Fr,Ia=n(),p(se.$$.fragment),Wn=n(),p(Wt.$$.fragment),Zn=n(),P=i("div"),p(Zt.$$.fragment),Wa=n(),go=i("p"),go.innerHTML=Pr,Za=n(),_o=i("p"),_o.innerHTML=Gr,Na=n(),p(ie.$$.fragment),Nn=n(),Mo=i("p"),this.h()},l(e){const t=Yr("svelte-u9bgzb",document.head);d=l(t,"META",{name:!0,content:!0}),t.forEach(o),y=a(e),b=l(e,"P",{}),w(b).forEach(o),k=a(e),f(v.$$.fragment,e),m=a(e),f(M.$$.fragment,e),wo=a(e),ue=l(e,"P",{"data-svelte-h":!0}),c(ue)!=="svelte-luezb9"&&(ue.innerHTML=Fa),To=a(e),ge=l(e,"P",{"data-svelte-h":!0}),c(ge)!=="svelte-x1eizn"&&(ge.textContent=Pa),$o=a(e),_e=l(e,"UL",{"data-svelte-h":!0}),c(_e)!=="svelte-mzjtwc"&&(_e.innerHTML=Ga),Bo=a(e),be=l(e,"P",{"data-svelte-h":!0}),c(be)!=="svelte-birews"&&(be.textContent=Ha),Co=a(e),ke=l(e,"P",{"data-svelte-h":!0}),c(ke)!=="svelte-1m4odbp"&&(ke.innerHTML=La),xo=a(e),f(ye.$$.fragment,e),Jo=a(e),ve=l(e,"P",{"data-svelte-h":!0}),c(ve)!=="svelte-d9f63q"&&(ve.innerHTML=Va),zo=a(e),f(Me.$$.fragment,e),jo=a(e),we=l(e,"P",{"data-svelte-h":!0}),c(we)!=="svelte-1c57ze6"&&(we.textContent=Sa),Uo=a(e),f(Te.$$.fragment,e),Io=a(e),f($e.$$.fragment,e),Wo=a(e),Be=l(e,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-1gm6phf"&&(Be.textContent=Ya),Zo=a(e),Ce=l(e,"P",{"data-svelte-h":!0}),c(Ce)!=="svelte-kat9bd"&&(Ce.innerHTML=Xa),No=a(e),f(xe.$$.fragment,e),Fo=a(e),Je=l(e,"P",{"data-svelte-h":!0}),c(Je)!=="svelte-jn1vz4"&&(Je.innerHTML=qa),Po=a(e),f(ze.$$.fragment,e),Go=a(e),je=l(e,"P",{"data-svelte-h":!0}),c(je)!=="svelte-1r0gpm4"&&(je.textContent=Ea),Ho=a(e),f(Ue.$$.fragment,e),Lo=a(e),Ie=l(e,"P",{"data-svelte-h":!0}),c(Ie)!=="svelte-bu0gze"&&(Ie.innerHTML=Ra),Vo=a(e),f(We.$$.fragment,e),So=a(e),Ze=l(e,"P",{"data-svelte-h":!0}),c(Ze)!=="svelte-ud6z0l"&&(Ze.textContent=Da),Yo=a(e),f(Ne.$$.fragment,e),Xo=a(e),Fe=l(e,"P",{"data-svelte-h":!0}),c(Fe)!=="svelte-ib5l43"&&(Fe.innerHTML=Qa),qo=a(e),Pe=l(e,"P",{"data-svelte-h":!0}),c(Pe)!=="svelte-1pp3dkd"&&(Pe.innerHTML=Oa),Eo=a(e),f(Ge.$$.fragment,e),Ro=a(e),f(He.$$.fragment,e),Do=a(e),Le=l(e,"P",{"data-svelte-h":!0}),c(Le)!=="svelte-1qm2lzz"&&(Le.innerHTML=Aa),Qo=a(e),f(Ve.$$.fragment,e),Oo=a(e),f(Se.$$.fragment,e),Ao=a(e),Ye=l(e,"P",{"data-svelte-h":!0}),c(Ye)!=="svelte-19fzd9"&&(Ye.textContent=Ka),Ko=a(e),R=l(e,"DIV",{style:!0,"data-svelte-h":!0}),c(R)!=="svelte-odbvi5"&&(R.innerHTML=er),en=a(e),Xe=l(e,"P",{"data-svelte-h":!0}),c(Xe)!=="svelte-1uahz5n"&&(Xe.innerHTML=tr),tn=a(e),qe=l(e,"P",{"data-svelte-h":!0}),c(qe)!=="svelte-106f51x"&&(qe.textContent=or),on=a(e),f(Ee.$$.fragment,e),nn=a(e),Re=l(e,"P",{"data-svelte-h":!0}),c(Re)!=="svelte-rwb7y1"&&(Re.textContent=nr),an=a(e),f(De.$$.fragment,e),rn=a(e),Qe=l(e,"P",{"data-svelte-h":!0}),c(Qe)!=="svelte-1xrlue6"&&(Qe.innerHTML=ar),sn=a(e),f(Oe.$$.fragment,e),ln=a(e),Ae=l(e,"P",{"data-svelte-h":!0}),c(Ae)!=="svelte-llmun5"&&(Ae.innerHTML=rr),dn=a(e),f(Ke.$$.fragment,e),cn=a(e),et=l(e,"P",{"data-svelte-h":!0}),c(et)!=="svelte-ff55s5"&&(et.innerHTML=sr),mn=a(e),f(tt.$$.fragment,e),pn=a(e),ot=l(e,"P",{"data-svelte-h":!0}),c(ot)!=="svelte-sc737i"&&(ot.innerHTML=ir),fn=a(e),f(nt.$$.fragment,e),hn=a(e),at=l(e,"P",{"data-svelte-h":!0}),c(at)!=="svelte-1bkdry6"&&(at.textContent=lr),un=a(e),f(rt.$$.fragment,e),gn=a(e),f(st.$$.fragment,e),_n=a(e),z=l(e,"DIV",{class:!0});var G=w(z);f(it.$$.fragment,G),Vn=a(G),Ht=l(G,"P",{"data-svelte-h":!0}),c(Ht)!=="svelte-bgvvvw"&&(Ht.innerHTML=dr),Sn=a(G),Lt=l(G,"P",{"data-svelte-h":!0}),c(Lt)!=="svelte-c6ui3q"&&(Lt.innerHTML=cr),Yn=a(G),Vt=l(G,"P",{"data-svelte-h":!0}),c(Vt)!=="svelte-yi2sf3"&&(Vt.innerHTML=mr),Xn=a(G),D=l(G,"DIV",{class:!0});var Nt=w(D);f(lt.$$.fragment,Nt),qn=a(Nt),St=l(Nt,"P",{"data-svelte-h":!0}),c(St)!=="svelte-1xngq5e"&&(St.innerHTML=pr),Nt.forEach(o),G.forEach(o),bn=a(e),f(dt.$$.fragment,e),kn=a(e),j=l(e,"DIV",{class:!0});var H=w(j);f(ct.$$.fragment,H),En=a(H),Yt=l(H,"P",{"data-svelte-h":!0}),c(Yt)!=="svelte-1xfrjvw"&&(Yt.textContent=fr),Rn=a(H),Q=l(H,"DIV",{class:!0});var Ft=w(Q);f(mt.$$.fragment,Ft),Dn=a(Ft),Xt=l(Ft,"P",{"data-svelte-h":!0}),c(Xt)!=="svelte-1hlbbl8"&&(Xt.innerHTML=hr),Ft.forEach(o),Qn=a(H),O=l(H,"DIV",{class:!0});var Pt=w(O);f(pt.$$.fragment,Pt),On=a(Pt),qt=l(Pt,"P",{"data-svelte-h":!0}),c(qt)!=="svelte-1xt1aup"&&(qt.textContent=ur),Pt.forEach(o),An=a(H),A=l(H,"DIV",{class:!0});var Gt=w(A);f(ft.$$.fragment,Gt),Kn=a(Gt),Et=l(Gt,"P",{"data-svelte-h":!0}),c(Et)!=="svelte-352k6q"&&(Et.innerHTML=gr),Gt.forEach(o),H.forEach(o),yn=a(e),f(ht.$$.fragment,e),vn=a(e),B=l(e,"DIV",{class:!0});var x=w(B);f(ut.$$.fragment,x),ea=a(x),Rt=l(x,"P",{"data-svelte-h":!0}),c(Rt)!=="svelte-xp33tl"&&(Rt.textContent=_r),ta=a(x),Dt=l(x,"UL",{"data-svelte-h":!0}),c(Dt)!=="svelte-ymlj2a"&&(Dt.innerHTML=br),oa=a(x),Qt=l(x,"P",{"data-svelte-h":!0}),c(Qt)!=="svelte-beeiv6"&&(Qt.textContent=kr),na=a(x),Ot=l(x,"P",{"data-svelte-h":!0}),c(Ot)!=="svelte-1x44m3f"&&(Ot.innerHTML=yr),aa=a(x),At=l(x,"P",{"data-svelte-h":!0}),c(At)!=="svelte-hswkmf"&&(At.innerHTML=vr),ra=a(x),L=l(x,"DIV",{class:!0});var E=w(L);f(gt.$$.fragment,E),sa=a(E),Kt=l(E,"P",{"data-svelte-h":!0}),c(Kt)!=="svelte-4azpa"&&(Kt.innerHTML=Mr),ia=a(E),f(K.$$.fragment,E),E.forEach(o),la=a(x),ee=l(x,"DIV",{class:!0});var Pn=w(ee);f(_t.$$.fragment,Pn),da=a(Pn),eo=l(Pn,"P",{"data-svelte-h":!0}),c(eo)!=="svelte-19e6niw"&&(eo.textContent=wr),Pn.forEach(o),x.forEach(o),Mn=a(e),f(bt.$$.fragment,e),wn=a(e),I=l(e,"DIV",{class:!0});var le=w(I);f(kt.$$.fragment,le),ca=a(le),to=l(le,"P",{"data-svelte-h":!0}),c(to)!=="svelte-gz2cxz"&&(to.innerHTML=Tr),ma=a(le),oo=l(le,"P",{"data-svelte-h":!0}),c(oo)!=="svelte-hswkmf"&&(oo.innerHTML=$r),pa=a(le),V=l(le,"DIV",{class:!0});var bo=w(V);f(yt.$$.fragment,bo),fa=a(bo),no=l(bo,"P",{"data-svelte-h":!0}),c(no)!=="svelte-lorx7a"&&(no.innerHTML=Br),ha=a(bo),f(te.$$.fragment,bo),bo.forEach(o),le.forEach(o),Tn=a(e),f(vt.$$.fragment,e),$n=a(e),W=l(e,"DIV",{class:!0});var de=w(W);f(Mt.$$.fragment,de),ua=a(de),ao=l(de,"P",{"data-svelte-h":!0}),c(ao)!=="svelte-innrl9"&&(ao.innerHTML=Cr),ga=a(de),ro=l(de,"P",{"data-svelte-h":!0}),c(ro)!=="svelte-hswkmf"&&(ro.innerHTML=xr),_a=a(de),S=l(de,"DIV",{class:!0});var ko=w(S);f(wt.$$.fragment,ko),ba=a(ko),so=l(ko,"P",{"data-svelte-h":!0}),c(so)!=="svelte-lorx7a"&&(so.innerHTML=Jr),ka=a(ko),f(oe.$$.fragment,ko),ko.forEach(o),de.forEach(o),Bn=a(e),f(Tt.$$.fragment,e),Cn=a(e),Z=l(e,"DIV",{class:!0});var ce=w(Z);f($t.$$.fragment,ce),ya=a(ce),io=l(ce,"P",{"data-svelte-h":!0}),c(io)!=="svelte-1vx55om"&&(io.innerHTML=zr),va=a(ce),lo=l(ce,"P",{"data-svelte-h":!0}),c(lo)!=="svelte-hswkmf"&&(lo.innerHTML=jr),Ma=a(ce),Y=l(ce,"DIV",{class:!0});var yo=w(Y);f(Bt.$$.fragment,yo),wa=a(yo),co=l(yo,"P",{"data-svelte-h":!0}),c(co)!=="svelte-1k5cbty"&&(co.innerHTML=Ur),Ta=a(yo),f(ne.$$.fragment,yo),yo.forEach(o),ce.forEach(o),xn=a(e),f(Ct.$$.fragment,e),Jn=a(e),q=l(e,"DIV",{class:!0});var Gn=w(q);f(xt.$$.fragment,Gn),$a=a(Gn),X=l(Gn,"DIV",{class:!0});var vo=w(X);f(Jt.$$.fragment,vo),Ba=a(vo),mo=l(vo,"P",{"data-svelte-h":!0}),c(mo)!=="svelte-lorx7a"&&(mo.innerHTML=Ir),Ca=a(vo),f(ae.$$.fragment,vo),vo.forEach(o),Gn.forEach(o),zn=a(e),f(zt.$$.fragment,e),jn=a(e),N=l(e,"DIV",{class:!0});var me=w(N);f(jt.$$.fragment,me),xa=a(me),po=l(me,"P",{"data-svelte-h":!0}),c(po)!=="svelte-1o5ef18"&&(po.innerHTML=Wr),Ja=a(me),fo=l(me,"P",{"data-svelte-h":!0}),c(fo)!=="svelte-yi2sf3"&&(fo.innerHTML=Zr),za=a(me),f(re.$$.fragment,me),me.forEach(o),Un=a(e),f(Ut.$$.fragment,e),In=a(e),F=l(e,"DIV",{class:!0});var pe=w(F);f(It.$$.fragment,pe),ja=a(pe),ho=l(pe,"P",{"data-svelte-h":!0}),c(ho)!=="svelte-ng0524"&&(ho.innerHTML=Nr),Ua=a(pe),uo=l(pe,"P",{"data-svelte-h":!0}),c(uo)!=="svelte-yi2sf3"&&(uo.innerHTML=Fr),Ia=a(pe),f(se.$$.fragment,pe),pe.forEach(o),Wn=a(e),f(Wt.$$.fragment,e),Zn=a(e),P=l(e,"DIV",{class:!0});var fe=w(P);f(Zt.$$.fragment,fe),Wa=a(fe),go=l(fe,"P",{"data-svelte-h":!0}),c(go)!=="svelte-zbmcuw"&&(go.innerHTML=Pr),Za=a(fe),_o=l(fe,"P",{"data-svelte-h":!0}),c(_o)!=="svelte-yi2sf3"&&(_o.innerHTML=Gr),Na=a(fe),f(ie.$$.fragment,fe),fe.forEach(o),Nn=a(e),Mo=l(e,"P",{}),w(Mo).forEach(o),this.h()},h(){T(d,"name","hf:doc:metadata"),T(d,"content",ts),Xr(R,"text-align","center"),T(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){s(document.head,d),r(e,y,t),r(e,b,t),r(e,k,t),h(v,e,t),r(e,m,t),h(M,e,t),r(e,wo,t),r(e,ue,t),r(e,To,t),r(e,ge,t),r(e,$o,t),r(e,_e,t),r(e,Bo,t),r(e,be,t),r(e,Co,t),r(e,ke,t),r(e,xo,t),h(ye,e,t),r(e,Jo,t),r(e,ve,t),r(e,zo,t),h(Me,e,t),r(e,jo,t),r(e,we,t),r(e,Uo,t),h(Te,e,t),r(e,Io,t),h($e,e,t),r(e,Wo,t),r(e,Be,t),r(e,Zo,t),r(e,Ce,t),r(e,No,t),h(xe,e,t),r(e,Fo,t),r(e,Je,t),r(e,Po,t),h(ze,e,t),r(e,Go,t),r(e,je,t),r(e,Ho,t),h(Ue,e,t),r(e,Lo,t),r(e,Ie,t),r(e,Vo,t),h(We,e,t),r(e,So,t),r(e,Ze,t),r(e,Yo,t),h(Ne,e,t),r(e,Xo,t),r(e,Fe,t),r(e,qo,t),r(e,Pe,t),r(e,Eo,t),h(Ge,e,t),r(e,Ro,t),h(He,e,t),r(e,Do,t),r(e,Le,t),r(e,Qo,t),h(Ve,e,t),r(e,Oo,t),h(Se,e,t),r(e,Ao,t),r(e,Ye,t),r(e,Ko,t),r(e,R,t),r(e,en,t),r(e,Xe,t),r(e,tn,t),r(e,qe,t),r(e,on,t),h(Ee,e,t),r(e,nn,t),r(e,Re,t),r(e,an,t),h(De,e,t),r(e,rn,t),r(e,Qe,t),r(e,sn,t),h(Oe,e,t),r(e,ln,t),r(e,Ae,t),r(e,dn,t),h(Ke,e,t),r(e,cn,t),r(e,et,t),r(e,mn,t),h(tt,e,t),r(e,pn,t),r(e,ot,t),r(e,fn,t),h(nt,e,t),r(e,hn,t),r(e,at,t),r(e,un,t),h(rt,e,t),r(e,gn,t),h(st,e,t),r(e,_n,t),r(e,z,t),h(it,z,null),s(z,Vn),s(z,Ht),s(z,Sn),s(z,Lt),s(z,Yn),s(z,Vt),s(z,Xn),s(z,D),h(lt,D,null),s(D,qn),s(D,St),r(e,bn,t),h(dt,e,t),r(e,kn,t),r(e,j,t),h(ct,j,null),s(j,En),s(j,Yt),s(j,Rn),s(j,Q),h(mt,Q,null),s(Q,Dn),s(Q,Xt),s(j,Qn),s(j,O),h(pt,O,null),s(O,On),s(O,qt),s(j,An),s(j,A),h(ft,A,null),s(A,Kn),s(A,Et),r(e,yn,t),h(ht,e,t),r(e,vn,t),r(e,B,t),h(ut,B,null),s(B,ea),s(B,Rt),s(B,ta),s(B,Dt),s(B,oa),s(B,Qt),s(B,na),s(B,Ot),s(B,aa),s(B,At),s(B,ra),s(B,L),h(gt,L,null),s(L,sa),s(L,Kt),s(L,ia),h(K,L,null),s(B,la),s(B,ee),h(_t,ee,null),s(ee,da),s(ee,eo),r(e,Mn,t),h(bt,e,t),r(e,wn,t),r(e,I,t),h(kt,I,null),s(I,ca),s(I,to),s(I,ma),s(I,oo),s(I,pa),s(I,V),h(yt,V,null),s(V,fa),s(V,no),s(V,ha),h(te,V,null),r(e,Tn,t),h(vt,e,t),r(e,$n,t),r(e,W,t),h(Mt,W,null),s(W,ua),s(W,ao),s(W,ga),s(W,ro),s(W,_a),s(W,S),h(wt,S,null),s(S,ba),s(S,so),s(S,ka),h(oe,S,null),r(e,Bn,t),h(Tt,e,t),r(e,Cn,t),r(e,Z,t),h($t,Z,null),s(Z,ya),s(Z,io),s(Z,va),s(Z,lo),s(Z,Ma),s(Z,Y),h(Bt,Y,null),s(Y,wa),s(Y,co),s(Y,Ta),h(ne,Y,null),r(e,xn,t),h(Ct,e,t),r(e,Jn,t),r(e,q,t),h(xt,q,null),s(q,$a),s(q,X),h(Jt,X,null),s(X,Ba),s(X,mo),s(X,Ca),h(ae,X,null),r(e,zn,t),h(zt,e,t),r(e,jn,t),r(e,N,t),h(jt,N,null),s(N,xa),s(N,po),s(N,Ja),s(N,fo),s(N,za),h(re,N,null),r(e,Un,t),h(Ut,e,t),r(e,In,t),r(e,F,t),h(It,F,null),s(F,ja),s(F,ho),s(F,Ua),s(F,uo),s(F,Ia),h(se,F,null),r(e,Wn,t),h(Wt,e,t),r(e,Zn,t),r(e,P,t),h(Zt,P,null),s(P,Wa),s(P,go),s(P,Za),s(P,_o),s(P,Na),h(ie,P,null),r(e,Nn,t),r(e,Mo,t),Fn=!0},p(e,[t]){const G={};t&2&&(G.$$scope={dirty:t,ctx:e}),K.$set(G);const Nt={};t&2&&(Nt.$$scope={dirty:t,ctx:e}),te.$set(Nt);const H={};t&2&&(H.$$scope={dirty:t,ctx:e}),oe.$set(H);const Ft={};t&2&&(Ft.$$scope={dirty:t,ctx:e}),ne.$set(Ft);const Pt={};t&2&&(Pt.$$scope={dirty:t,ctx:e}),ae.$set(Pt);const Gt={};t&2&&(Gt.$$scope={dirty:t,ctx:e}),re.$set(Gt);const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),se.$set(x);const E={};t&2&&(E.$$scope={dirty:t,ctx:e}),ie.$set(E)},i(e){Fn||(u(v.$$.fragment,e),u(M.$$.fragment,e),u(ye.$$.fragment,e),u(Me.$$.fragment,e),u(Te.$$.fragment,e),u($e.$$.fragment,e),u(xe.$$.fragment,e),u(ze.$$.fragment,e),u(Ue.$$.fragment,e),u(We.$$.fragment,e),u(Ne.$$.fragment,e),u(Ge.$$.fragment,e),u(He.$$.fragment,e),u(Ve.$$.fragment,e),u(Se.$$.fragment,e),u(Ee.$$.fragment,e),u(De.$$.fragment,e),u(Oe.$$.fragment,e),u(Ke.$$.fragment,e),u(tt.$$.fragment,e),u(nt.$$.fragment,e),u(rt.$$.fragment,e),u(st.$$.fragment,e),u(it.$$.fragment,e),u(lt.$$.fragment,e),u(dt.$$.fragment,e),u(ct.$$.fragment,e),u(mt.$$.fragment,e),u(pt.$$.fragment,e),u(ft.$$.fragment,e),u(ht.$$.fragment,e),u(ut.$$.fragment,e),u(gt.$$.fragment,e),u(K.$$.fragment,e),u(_t.$$.fragment,e),u(bt.$$.fragment,e),u(kt.$$.fragment,e),u(yt.$$.fragment,e),u(te.$$.fragment,e),u(vt.$$.fragment,e),u(Mt.$$.fragment,e),u(wt.$$.fragment,e),u(oe.$$.fragment,e),u(Tt.$$.fragment,e),u($t.$$.fragment,e),u(Bt.$$.fragment,e),u(ne.$$.fragment,e),u(Ct.$$.fragment,e),u(xt.$$.fragment,e),u(Jt.$$.fragment,e),u(ae.$$.fragment,e),u(zt.$$.fragment,e),u(jt.$$.fragment,e),u(re.$$.fragment,e),u(Ut.$$.fragment,e),u(It.$$.fragment,e),u(se.$$.fragment,e),u(Wt.$$.fragment,e),u(Zt.$$.fragment,e),u(ie.$$.fragment,e),Fn=!0)},o(e){g(v.$$.fragment,e),g(M.$$.fragment,e),g(ye.$$.fragment,e),g(Me.$$.fragment,e),g(Te.$$.fragment,e),g($e.$$.fragment,e),g(xe.$$.fragment,e),g(ze.$$.fragment,e),g(Ue.$$.fragment,e),g(We.$$.fragment,e),g(Ne.$$.fragment,e),g(Ge.$$.fragment,e),g(He.$$.fragment,e),g(Ve.$$.fragment,e),g(Se.$$.fragment,e),g(Ee.$$.fragment,e),g(De.$$.fragment,e),g(Oe.$$.fragment,e),g(Ke.$$.fragment,e),g(tt.$$.fragment,e),g(nt.$$.fragment,e),g(rt.$$.fragment,e),g(st.$$.fragment,e),g(it.$$.fragment,e),g(lt.$$.fragment,e),g(dt.$$.fragment,e),g(ct.$$.fragment,e),g(mt.$$.fragment,e),g(pt.$$.fragment,e),g(ft.$$.fragment,e),g(ht.$$.fragment,e),g(ut.$$.fragment,e),g(gt.$$.fragment,e),g(K.$$.fragment,e),g(_t.$$.fragment,e),g(bt.$$.fragment,e),g(kt.$$.fragment,e),g(yt.$$.fragment,e),g(te.$$.fragment,e),g(vt.$$.fragment,e),g(Mt.$$.fragment,e),g(wt.$$.fragment,e),g(oe.$$.fragment,e),g(Tt.$$.fragment,e),g($t.$$.fragment,e),g(Bt.$$.fragment,e),g(ne.$$.fragment,e),g(Ct.$$.fragment,e),g(xt.$$.fragment,e),g(Jt.$$.fragment,e),g(ae.$$.fragment,e),g(zt.$$.fragment,e),g(jt.$$.fragment,e),g(re.$$.fragment,e),g(Ut.$$.fragment,e),g(It.$$.fragment,e),g(se.$$.fragment,e),g(Wt.$$.fragment,e),g(Zt.$$.fragment,e),g(ie.$$.fragment,e),Fn=!1},d(e){e&&(o(y),o(b),o(k),o(m),o(wo),o(ue),o(To),o(ge),o($o),o(_e),o(Bo),o(be),o(Co),o(ke),o(xo),o(Jo),o(ve),o(zo),o(jo),o(we),o(Uo),o(Io),o(Wo),o(Be),o(Zo),o(Ce),o(No),o(Fo),o(Je),o(Po),o(Go),o(je),o(Ho),o(Lo),o(Ie),o(Vo),o(So),o(Ze),o(Yo),o(Xo),o(Fe),o(qo),o(Pe),o(Eo),o(Ro),o(Do),o(Le),o(Qo),o(Oo),o(Ao),o(Ye),o(Ko),o(R),o(en),o(Xe),o(tn),o(qe),o(on),o(nn),o(Re),o(an),o(rn),o(Qe),o(sn),o(ln),o(Ae),o(dn),o(cn),o(et),o(mn),o(pn),o(ot),o(fn),o(hn),o(at),o(un),o(gn),o(_n),o(z),o(bn),o(kn),o(j),o(yn),o(vn),o(B),o(Mn),o(wn),o(I),o(Tn),o($n),o(W),o(Bn),o(Cn),o(Z),o(xn),o(Jn),o(q),o(zn),o(jn),o(N),o(Un),o(In),o(F),o(Wn),o(Zn),o(P),o(Nn),o(Mo)),o(d),_(v,e),_(M,e),_(ye,e),_(Me,e),_(Te,e),_($e,e),_(xe,e),_(ze,e),_(Ue,e),_(We,e),_(Ne,e),_(Ge,e),_(He,e),_(Ve,e),_(Se,e),_(Ee,e),_(De,e),_(Oe,e),_(Ke,e),_(tt,e),_(nt,e),_(rt,e),_(st,e),_(it),_(lt),_(dt,e),_(ct),_(mt),_(pt),_(ft),_(ht,e),_(ut),_(gt),_(K),_(_t),_(bt,e),_(kt),_(yt),_(te),_(vt,e),_(Mt),_(wt),_(oe),_(Tt,e),_($t),_(Bt),_(ne),_(Ct,e),_(xt),_(Jt),_(ae),_(zt,e),_(jt),_(re),_(Ut,e),_(It),_(se),_(Wt,e),_(Zt),_(ie)}}}const ts='{"title":"Bark","local":"bark","sections":[{"title":"Overview","local":"overview","sections":[{"title":"Optimizing Bark","local":"optimizing-bark","sections":[{"title":"Using half-precision","local":"using-half-precision","sections":[],"depth":4},{"title":"Using CPU offload","local":"using-cpu-offload","sections":[],"depth":4},{"title":"Using Better Transformer","local":"using-better-transformer","sections":[],"depth":4},{"title":"Using Flash Attention 2","local":"using-flash-attention-2","sections":[{"title":"Installation","local":"installation","sections":[],"depth":5},{"title":"Usage","local":"usage","sections":[],"depth":5},{"title":"Performance comparison","local":"performance-comparison","sections":[],"depth":5}],"depth":4},{"title":"Combining optimization techniques","local":"combining-optimization-techniques","sections":[],"depth":4}],"depth":3},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":3}],"depth":2},{"title":"BarkConfig","local":"transformers.BarkConfig","sections":[],"depth":2},{"title":"BarkProcessor","local":"transformers.BarkProcessor","sections":[],"depth":2},{"title":"BarkModel","local":"transformers.BarkModel","sections":[],"depth":2},{"title":"BarkSemanticModel","local":"transformers.BarkSemanticModel","sections":[],"depth":2},{"title":"BarkCoarseModel","local":"transformers.BarkCoarseModel","sections":[],"depth":2},{"title":"BarkFineModel","local":"transformers.BarkFineModel","sections":[],"depth":2},{"title":"BarkCausalModel","local":"transformers.BarkCausalModel","sections":[],"depth":2},{"title":"BarkCoarseConfig","local":"transformers.BarkCoarseConfig","sections":[],"depth":2},{"title":"BarkFineConfig","local":"transformers.BarkFineConfig","sections":[],"depth":2},{"title":"BarkSemanticConfig","local":"transformers.BarkSemanticConfig","sections":[],"depth":2}],"depth":1}';function os(J){return Lr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class cs extends Vr{constructor(d){super(),Sr(this,d,os,es,Hr,{})}}export{cs as component};
