import{s as Rt,o as Yt,n as $e}from"../chunks/scheduler.25b97de1.js";import{S as Ht,i as Et,g as i,s as r,r as h,A as Nt,h as d,f as a,c as l,j as me,u as f,x as u,k as ce,y as p,a as n,v as g,d as b,t as M,w as _}from"../chunks/index.d9030fc9.js";import{T as Gt}from"../chunks/Tip.baa67368.js";import{D as je}from"../chunks/Docstring.ffac8efa.js";import{C as pe}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ft}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as we,E as Xt}from"../chunks/EditOnGithub.91d95064.js";function qt(C){let o,v="Example:",m,c,y;return c=new pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZhbGNvbk1hbWJhQ29uZmlnJTJDJTIwRmFsY29uTWFtYmFNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBGYWxjb25NYW1iYSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwRmFsY29uTWFtYmFDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwRmFsY29uTWFtYmFNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FalconMambaConfig, FalconMambaModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a FalconMamba configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = FalconMambaConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FalconMambaModel(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(){o=i("p"),o.textContent=v,m=r(),h(c.$$.fragment)},l(s){o=d(s,"P",{"data-svelte-h":!0}),u(o)!=="svelte-11lpom8"&&(o.textContent=v),m=l(s),f(c.$$.fragment,s)},m(s,T){n(s,o,T),n(s,m,T),g(c,s,T),y=!0},p:$e,i(s){y||(b(c.$$.fragment,s),y=!0)},o(s){M(c.$$.fragment,s),y=!1},d(s){s&&(a(o),a(m)),_(c,s)}}}function Lt(C){let o,v=`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(){o=i("p"),o.innerHTML=v},l(m){o=d(m,"P",{"data-svelte-h":!0}),u(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(m,c){n(m,o,c)},p:$e,d(m){m&&a(o)}}}function Vt(C){let o,v="Example:",m,c,y;return c=new pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGYWxjb25NYW1iYU1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBGYWxjb25NYW1iYU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FalconMambaModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FalconMambaModel.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){o=i("p"),o.textContent=v,m=r(),h(c.$$.fragment)},l(s){o=d(s,"P",{"data-svelte-h":!0}),u(o)!=="svelte-11lpom8"&&(o.textContent=v),m=l(s),f(c.$$.fragment,s)},m(s,T){n(s,o,T),n(s,m,T),g(c,s,T),y=!0},p:$e,i(s){y||(b(c.$$.fragment,s),y=!0)},o(s){M(c.$$.fragment,s),y=!1},d(s){s&&(a(o),a(m)),_(c,s)}}}function Qt(C){let o,v=`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(){o=i("p"),o.innerHTML=v},l(m){o=d(m,"P",{"data-svelte-h":!0}),u(o)!=="svelte-fincs2"&&(o.innerHTML=v)},m(m,c){n(m,o,c)},p:$e,d(m){m&&a(o)}}}function At(C){let o,v="Example:",m,c,y;return c=new pe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEZhbGNvbk1hbWJhRm9yQ2F1c2FsTE0lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBGYWxjb25NYW1iYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCklMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FalconMambaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FalconMambaForCausalLM.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`,wrap:!1}}),{c(){o=i("p"),o.textContent=v,m=r(),h(c.$$.fragment)},l(s){o=d(s,"P",{"data-svelte-h":!0}),u(o)!=="svelte-11lpom8"&&(o.textContent=v),m=l(s),f(c.$$.fragment,s)},m(s,T){n(s,o,T),n(s,m,T),g(c,s,T),y=!0},p:$e,i(s){y||(b(c.$$.fragment,s),y=!0)},o(s){M(c.$$.fragment,s),y=!1},d(s){s&&(a(o),a(m)),_(c,s)}}}function St(C){let o,v,m,c,y,s,T,ke,Y,gt="The FalconMamba model was proposed by TII UAE (Technology Innovation Institute) in their release.",Ce,H,bt="The abstract from the paper is the following:",Je,E,Mt=`<em>We present FalconMamba, a new base large language model based on the novel Mamba architecture. FalconMamba is trained on 5.8 trillion tokens with carefully selected data mixtures. As a pure Mamba-based model, FalconMamba surpasses leading open-weight models based on Transformers, such as Mistral 7B, Llama3 8B, and Falcon2 11B. It is on par with Gemma 7B and outperforms models with different architecture designs, such as RecurrentGemma 9B. Currently, FalconMamba is the best-performing Mamba model in the literature at this scale, surpassing both existing Mamba and hybrid Mamba-Transformer models.
Due to its architecture, FalconMamba is significantly faster at inference and requires substantially less memory for long sequence generation. Despite recent studies suggesting that hybrid Mamba-Transformer models outperform pure architecture designs, we argue and demonstrate that the pure Mamba design can achieve similar, even superior results compared to the hybrid design. We make the weights of our implementation of FalconMamba publicly available under a permissive license.</em>`,We,N,_t="Tips:",xe,X,yt='<li>FalconMamba is mostly based on Mamba architecture, the same <a href="./mamba">tips and best practices</a> would be relevant here.</li>',Ue,q,vt="The model has been trained on approximtely 6T tokens consisting a mixture of many data sources such as RefineWeb, Cosmopedia and Math data.",Ze,L,Tt='For more details about the training procedure and the architecture, have a look at <a href="">the technical paper of FalconMamba</a> (coming soon).',ze,V,Be,Q,wt="Below we demonstrate how to use the model:",Ie,A,Ge,S,Ft="The architecture is also compatible with <code>torch.compile</code> for faster generation:",Re,P,Ye,D,jt="If you have access to a GPU that is compatible with <code>bitsandbytes</code>, you can also quantize the model in 4-bit precision:",He,O,Ee,K,$t="You can also play with the instruction fine-tuned model:",Ne,ee,Xe,te,qe,j,ae,Oe,ue,kt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaModel">FalconMambaModel</a>. It is used to instantiate a FALCON_MAMBA
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 FALCON_MAMBA
<a href="https://huggingface.co/tiiuae/falcon-mamba-7b" rel="nofollow">tiiuae/falcon-mamba-7b</a> architecture.`,Ke,he,Ct=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,et,z,Le,ne,Ve,w,oe,tt,fe,Jt="The bare FALCONMAMBA Model transformer outputting raw hidden-states without any specific head on top.",at,ge,Wt=`This model inherits from <a href="/docs/transformers/main/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.)`,nt,be,xt=`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.`,ot,J,se,st,Me,Ut='The <a href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaModel">FalconMambaModel</a> forward method, overrides the <code>__call__</code> special method.',rt,B,lt,I,Qe,re,Ae,F,le,it,_e,Zt=`The FALCONMAMBA Model transformer with a language modeling head on top (linear layer with weights tied to the input
embeddings).`,dt,ye,zt=`This model inherits from <a href="/docs/transformers/main/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.)`,mt,ve,Bt=`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.`,ct,W,ie,pt,Te,It='The <a href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaForCausalLM">FalconMambaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',ut,G,ht,R,Se,de,Pe,Fe,De;return y=new we({props:{title:"FalconMamba",local:"falconmamba",headingTag:"h1"}}),T=new we({props:{title:"Overview",local:"overview",headingTag:"h2"}}),V=new we({props:{title:"Usage",local:"usage",headingTag:"h1"}}),A=new pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZhbGNvbk1hbWJhRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBGYWxjb25NYW1iYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhleSUyMGhvdyUyMGFyZSUyMHlvdSUyMGRvaW5nJTNGJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjAlMjJwdCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEFvdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dF9pZHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDEwKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0KSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FalconMambaForCausalLM, AutoTokenizer
<span class="hljs-keyword">import</span> torch

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)
model = FalconMambaForCausalLM.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)

input_ids = tokenizer(<span class="hljs-string">&quot;Hey how are you doing?&quot;</span>, return_tensors= <span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

out = model.generate(input_ids, max_new_tokens=<span class="hljs-number">10</span>)
<span class="hljs-built_in">print</span>(tokenizer.batch_decode(out))`,wrap:!1}}),P=new pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZhbGNvbk1hbWJhRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBbW9kZWwlMjAlM0QlMjBGYWxjb25NYW1iYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KS50bygwKSUwQW1vZGVsJTIwJTNEJTIwdG9yY2guY29tcGlsZShtb2RlbCklMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGV5JTIwaG93JTIwYXJlJTIweW91JTIwZG9pbmclM0YlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUwQW91dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0X2lkcyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTApJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXQpKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FalconMambaForCausalLM, AutoTokenizer
<span class="hljs-keyword">import</span> torch

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)
model = FalconMambaForCausalLM.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>, torch_dtype=torch.bfloat16).to(<span class="hljs-number">0</span>)
model = torch.<span class="hljs-built_in">compile</span>(model)

input_ids = tokenizer(<span class="hljs-string">&quot;Hey how are you doing?&quot;</span>, return_tensors= <span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

out = model.generate(input_ids, max_new_tokens=<span class="hljs-number">10</span>)
<span class="hljs-built_in">print</span>(tokenizer.batch_decode(out))`,wrap:!1}}),O=new pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZhbGNvbk1hbWJhRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2IlMjIpJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyhsb2FkX2luXzRiaXQlM0RUcnVlKSUwQW1vZGVsJTIwJTNEJTIwRmFsY29uTWFtYmFGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIydGlpdWFlJTJGZmFsY29uLW1hbWJhLTdiJTIyJTJDJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRHF1YW50aXphdGlvbl9jb25maWcpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhleSUyMGhvdyUyMGFyZSUyMHlvdSUyMGRvaW5nJTNGJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjAlMjJwdCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEFvdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dF9pZHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDEwKSUwQXByaW50KHRva2VuaXplci5iYXRjaF9kZWNvZGUob3V0KSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FalconMambaForCausalLM, AutoTokenizer, BitsAndBytesConfig
<span class="hljs-keyword">import</span> torch

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>)
quantization_config = BitsAndBytesConfig(load_in_4bit=<span class="hljs-literal">True</span>)
model = FalconMambaForCausalLM.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b&quot;</span>, quantization_config=quantization_config)

input_ids = tokenizer(<span class="hljs-string">&quot;Hey how are you doing?&quot;</span>, return_tensors= <span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]

out = model.generate(input_ids, max_new_tokens=<span class="hljs-number">10</span>)
<span class="hljs-built_in">print</span>(tokenizer.batch_decode(out))`,wrap:!1}}),ee=new pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEZhbGNvbk1hbWJhRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2ItaW5zdHJ1Y3QlMjIpJTBBbW9kZWwlMjAlM0QlMjBGYWxjb25NYW1iYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJ0aWl1YWUlMkZmYWxjb24tbWFtYmEtN2ItaW5zdHJ1Y3QlMjIpJTBBJTBBJTIzJTIwV2UlMjB1c2UlMjB0aGUlMjB0b2tlbml6ZXIncyUyMGNoYXQlMjB0ZW1wbGF0ZSUyMHRvJTIwZm9ybWF0JTIwZWFjaCUyMG1lc3NhZ2UlMjAtJTIwc2VlJTIwaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRvY3MlMkZ0cmFuc2Zvcm1lcnMlMkZtYWluJTJGZW4lMkZjaGF0X3RlbXBsYXRpbmclMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkhvdyUyMG1hbnklMjBoZWxpY29wdGVycyUyMGNhbiUyMGElMjBodW1hbiUyMGVhdCUyMGluJTIwb25lJTIwc2l0dGluZyUzRiUyMiU3RCUyQyUwQSU1RCUwQWlucHV0X2lkcyUyMCUzRCUyMHRva2VuaXplci5hcHBseV9jaGF0X3RlbXBsYXRlKG1lc3NhZ2VzJTJDJTIwdG9rZW5pemUlM0RGYWxzZSUyQyUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUpLmlucHV0X2lkcyUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dF9pZHMpJTBBcHJpbnQodG9rZW5pemVyLmRlY29kZShvdXRwdXRzJTVCMCU1RCkp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> FalconMambaForCausalLM, AutoTokenizer
<span class="hljs-keyword">import</span> torch

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b-instruct&quot;</span>)
model = FalconMambaForCausalLM.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-mamba-7b-instruct&quot;</span>)

<span class="hljs-comment"># We use the tokenizer&#x27;s chat template to format each message - see https://huggingface.co/docs/transformers/main/en/chat_templating</span>
messages = [
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;How many helicopters can a human eat in one sitting?&quot;</span>},
]
input_ids = tokenizer.apply_chat_template(messages, tokenize=<span class="hljs-literal">False</span>, add_generation_prompt=<span class="hljs-literal">True</span>).input_ids

outputs = model.generate(input_ids)
<span class="hljs-built_in">print</span>(tokenizer.decode(outputs[<span class="hljs-number">0</span>]))`,wrap:!1}}),te=new we({props:{title:"FalconMambaConfig",local:"transformers.FalconMambaConfig",headingTag:"h2"}}),ae=new je({props:{name:"class transformers.FalconMambaConfig",anchor:"transformers.FalconMambaConfig",parameters:[{name:"vocab_size",val:" = 50280"},{name:"hidden_size",val:" = 768"},{name:"state_size",val:" = 16"},{name:"num_hidden_layers",val:" = 32"},{name:"layer_norm_epsilon",val:" = 1e-05"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 0"},{name:"expand",val:" = 2"},{name:"conv_kernel",val:" = 4"},{name:"use_bias",val:" = False"},{name:"use_conv_bias",val:" = True"},{name:"hidden_act",val:" = 'silu'"},{name:"initializer_range",val:" = 0.1"},{name:"residual_in_fp32",val:" = True"},{name:"time_step_rank",val:" = 'auto'"},{name:"time_step_scale",val:" = 1.0"},{name:"time_step_min",val:" = 0.001"},{name:"time_step_max",val:" = 0.1"},{name:"time_step_init_scheme",val:" = 'random'"},{name:"time_step_floor",val:" = 0.0001"},{name:"rescale_prenorm_residual",val:" = False"},{name:"use_cache",val:" = True"},{name:"use_mambapy",val:" = False"},{name:"mixer_rms_eps",val:" = 1e-06"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FalconMambaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50280) &#x2014;
Vocabulary size of the FALCON_MAMBA model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaModel">FalconMambaModel</a>.`,name:"vocab_size"},{anchor:"transformers.FalconMambaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the embeddings and hidden states.`,name:"hidden_size"},{anchor:"transformers.FalconMambaConfig.state_size",description:"<strong>state_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014; shape of the state space latents.",name:"state_size"},{anchor:"transformers.FalconMambaConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the model.`,name:"num_hidden_layers"},{anchor:"transformers.FalconMambaConfig.layer_norm_epsilon",description:`<strong>layer_norm_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon to use in the layer normalization layers.`,name:"layer_norm_epsilon"},{anchor:"transformers.FalconMambaConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.FalconMambaConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The id of the beginning of sentence token in the vocabulary.`,name:"bos_token_id"},{anchor:"transformers.FalconMambaConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The id of the end of sentence token in the vocabulary.`,name:"eos_token_id"},{anchor:"transformers.FalconMambaConfig.expand",description:"<strong>expand</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014; Expanding factor used to determine the intermediate size.",name:"expand"},{anchor:"transformers.FalconMambaConfig.conv_kernel",description:"<strong>conv_kernel</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014; Size of the convolution kernel.",name:"conv_kernel"},{anchor:"transformers.FalconMambaConfig.use_bias",description:`<strong>use_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use bias in [&#x201C;in_proj&#x201D;, &#x201C;out_proj&#x201D;] of the mixer block`,name:"use_bias"},{anchor:"transformers.FalconMambaConfig.use_conv_bias",description:`<strong>use_conv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use bias in the convolution layer of the mixer block.`,name:"use_conv_bias"},{anchor:"transformers.FalconMambaConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.FalconMambaConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.FalconMambaConfig.residual_in_fp32",description:`<strong>residual_in_fp32</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not residuals should be in <code>float32</code>. If set to <code>False</code> residuals will keep the same <code>dtype</code> as the rest of the model`,name:"residual_in_fp32"},{anchor:"transformers.FalconMambaConfig.time_step_rank",description:`<strong>time_step_rank</strong> (<code>Union[int,str]</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
Rank of the discretization projection matrix. <code>&quot;auto&quot;</code> means that it will default to <code>math.ceil(self.hidden_size / 16)</code>`,name:"time_step_rank"},{anchor:"transformers.FalconMambaConfig.time_step_scale",description:`<strong>time_step_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Scale used used to scale <code>dt_proj.bias</code>.`,name:"time_step_scale"},{anchor:"transformers.FalconMambaConfig.time_step_min",description:`<strong>time_step_min</strong> (<code>float</code>, <em>optional</em>, defaults to 0.001) &#x2014;
Minimum <code>time_step</code> used to bound <code>dt_proj.bias</code>.`,name:"time_step_min"},{anchor:"transformers.FalconMambaConfig.time_step_max",description:`<strong>time_step_max</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Maximum <code>time_step</code> used to bound <code>dt_proj.bias</code>.`,name:"time_step_max"},{anchor:"transformers.FalconMambaConfig.time_step_init_scheme",description:`<strong>time_step_init_scheme</strong> (<code>float</code>, <em>optional</em>, defaults to <code>&quot;random&quot;</code>) &#x2014;
Init scheme used for <code>dt_proj.weight</code>. Should be one of <code>[&quot;random&quot;,&quot;uniform&quot;]</code>`,name:"time_step_init_scheme"},{anchor:"transformers.FalconMambaConfig.time_step_floor",description:`<strong>time_step_floor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0001) &#x2014;
Minimum clamping value of the <code>dt_proj.bias</code> layer initialization.`,name:"time_step_floor"},{anchor:"transformers.FalconMambaConfig.rescale_prenorm_residual",description:`<strong>rescale_prenorm_residual</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to rescale <code>out_proj</code> weights when initializing.`,name:"rescale_prenorm_residual"},{anchor:"transformers.FalconMambaConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the cache should be used.`,name:"use_cache"},{anchor:"transformers.FalconMambaConfig.use_mambapy",description:`<strong>use_mambapy</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Determines the fallback strategy during training if the CUDA-based official implementation of FalconMamba is not avaiable. If <code>True</code>, the falcon_mamba.py implementation is used. If <code>False</code>, the naive and slower implementation is used. Consider switching to the naive version if memory is limited.`,name:"use_mambapy"},{anchor:"transformers.FalconMambaConfig.mixer_rms_eps",description:`<strong>mixer_rms_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The RMS norm epsilon value that is used in the Mixer RMS norm for B, C and dt states.`,name:"mixer_rms_eps"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/falcon_mamba/configuration_falcon_mamba.py#L26"}}),z=new ft({props:{anchor:"transformers.FalconMambaConfig.example",$$slots:{default:[qt]},$$scope:{ctx:C}}}),ne=new we({props:{title:"FalconMambaModel",local:"transformers.FalconMambaModel",headingTag:"h2"}}),oe=new je({props:{name:"class transformers.FalconMambaModel",anchor:"transformers.FalconMambaModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FalconMambaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaConfig">FalconMambaConfig</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/main/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/main/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py#L605"}}),se=new je({props:{name:"forward",anchor:"transformers.FalconMambaModel.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"cache_params",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.FalconMambaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>cache_params.seqlen_offset&gt;0</code>, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FalconMambaModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.FalconMambaModel.forward.cache_params",description:`<strong>cache_params</strong> (<code>MambaCache</code>, <em>optional</em>) &#x2014;
If passed along, the model uses the previous state in all the blocks (which will give the output for the
<code>input_ids</code> provided as if the model add <code>state_input_ids + input_ids</code> as context).`,name:"cache_params"},{anchor:"transformers.FalconMambaModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the <code>cache_params</code> is returned and can be used to quickly generate the next logits.`,name:"use_cache"},{anchor:"transformers.FalconMambaModel.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.FalconMambaModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py#L629",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.falcon_mamba.modeling_falcon_mamba.FalconMambaOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaConfig"
>FalconMambaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>cache_params</strong> (<code>MambaCache</code>) — The state of the model at the last time step. Can be used in a forward method with the next <code>input_ids</code> to
avoid providing the old <code>input_ids</code>.</p>
<p>Includes both the State space model state matrices after the selective scan, and the Convolutional states</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.falcon_mamba.modeling_falcon_mamba.FalconMambaOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),B=new Gt({props:{$$slots:{default:[Lt]},$$scope:{ctx:C}}}),I=new ft({props:{anchor:"transformers.FalconMambaModel.forward.example",$$slots:{default:[Vt]},$$scope:{ctx:C}}}),re=new we({props:{title:"FalconMambaLMHeadModel",local:"transformers.FalconMambaForCausalLM",headingTag:"h2"}}),le=new je({props:{name:"class transformers.FalconMambaForCausalLM",anchor:"transformers.FalconMambaForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.FalconMambaForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaConfig">FalconMambaConfig</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/main/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/main/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py#L711"}}),ie=new je({props:{name:"forward",anchor:"transformers.FalconMambaForCausalLM.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"cache_params",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"cache_position",val:": Optional = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FalconMambaForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, input_ids_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>If <code>cache_params.seqlen_offset&gt;0</code>, only <code>input_ids</code> that do not have their past calculated should be passed as
<code>input_ids</code>.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.FalconMambaForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, 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. 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:"inputs_embeds"},{anchor:"transformers.FalconMambaForCausalLM.forward.cache_params",description:`<strong>cache_params</strong> (<code>MambaCache</code>, <em>optional</em>) &#x2014;
If passed along, the model uses the previous state in all the blocks (which will give the output for the
<code>input_ids</code> provided as if the model add <code>state_input_ids + input_ids</code> as context).`,name:"cache_params"},{anchor:"transformers.FalconMambaForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the <code>cache_params</code> is returned and can be used to quickly generate the next logits.`,name:"use_cache"},{anchor:"transformers.FalconMambaForCausalLM.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.FalconMambaForCausalLM.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.FalconMambaForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for language modeling. Note that the labels <strong>are shifted</strong> inside the model, i.e. you can set
<code>labels = input_ids</code> Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code>
are ignored (masked), the loss is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/falcon_mamba/modeling_falcon_mamba.py#L808",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.falcon_mamba.modeling_falcon_mamba.FalconMambaCausalLMOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/falcon_mamba#transformers.FalconMambaConfig"
>FalconMambaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>cache_params</strong> (<code>MambaCache</code>) — The state of the model at the last time step. Can be used in a forward method with the next <code>input_ids</code> to
avoid providing the old <code>input_ids</code>.</p>
<p>Includes both the State space model state matrices after the selective scan, and the Convolutional states</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.falcon_mamba.modeling_falcon_mamba.FalconMambaCausalLMOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),G=new Gt({props:{$$slots:{default:[Qt]},$$scope:{ctx:C}}}),R=new ft({props:{anchor:"transformers.FalconMambaForCausalLM.forward.example",$$slots:{default:[At]},$$scope:{ctx:C}}}),de=new Xt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/falcon_mamba.md"}}),{c(){o=i("meta"),v=r(),m=i("p"),c=r(),h(y.$$.fragment),s=r(),h(T.$$.fragment),ke=r(),Y=i("p"),Y.textContent=gt,Ce=r(),H=i("p"),H.textContent=bt,Je=r(),E=i("p"),E.innerHTML=Mt,We=r(),N=i("p"),N.textContent=_t,xe=r(),X=i("ul"),X.innerHTML=yt,Ue=r(),q=i("p"),q.textContent=vt,Ze=r(),L=i("p"),L.innerHTML=Tt,ze=r(),h(V.$$.fragment),Be=r(),Q=i("p"),Q.textContent=wt,Ie=r(),h(A.$$.fragment),Ge=r(),S=i("p"),S.innerHTML=Ft,Re=r(),h(P.$$.fragment),Ye=r(),D=i("p"),D.innerHTML=jt,He=r(),h(O.$$.fragment),Ee=r(),K=i("p"),K.textContent=$t,Ne=r(),h(ee.$$.fragment),Xe=r(),h(te.$$.fragment),qe=r(),j=i("div"),h(ae.$$.fragment),Oe=r(),ue=i("p"),ue.innerHTML=kt,Ke=r(),he=i("p"),he.innerHTML=Ct,et=r(),h(z.$$.fragment),Le=r(),h(ne.$$.fragment),Ve=r(),w=i("div"),h(oe.$$.fragment),tt=r(),fe=i("p"),fe.textContent=Jt,at=r(),ge=i("p"),ge.innerHTML=Wt,nt=r(),be=i("p"),be.innerHTML=xt,ot=r(),J=i("div"),h(se.$$.fragment),st=r(),Me=i("p"),Me.innerHTML=Ut,rt=r(),h(B.$$.fragment),lt=r(),h(I.$$.fragment),Qe=r(),h(re.$$.fragment),Ae=r(),F=i("div"),h(le.$$.fragment),it=r(),_e=i("p"),_e.textContent=Zt,dt=r(),ye=i("p"),ye.innerHTML=zt,mt=r(),ve=i("p"),ve.innerHTML=Bt,ct=r(),W=i("div"),h(ie.$$.fragment),pt=r(),Te=i("p"),Te.innerHTML=It,ut=r(),h(G.$$.fragment),ht=r(),h(R.$$.fragment),Se=r(),h(de.$$.fragment),Pe=r(),Fe=i("p"),this.h()},l(e){const t=Nt("svelte-u9bgzb",document.head);o=d(t,"META",{name:!0,content:!0}),t.forEach(a),v=l(e),m=d(e,"P",{}),me(m).forEach(a),c=l(e),f(y.$$.fragment,e),s=l(e),f(T.$$.fragment,e),ke=l(e),Y=d(e,"P",{"data-svelte-h":!0}),u(Y)!=="svelte-sokcp9"&&(Y.textContent=gt),Ce=l(e),H=d(e,"P",{"data-svelte-h":!0}),u(H)!=="svelte-vfdo9a"&&(H.textContent=bt),Je=l(e),E=d(e,"P",{"data-svelte-h":!0}),u(E)!=="svelte-1xe3wut"&&(E.innerHTML=Mt),We=l(e),N=d(e,"P",{"data-svelte-h":!0}),u(N)!=="svelte-axv494"&&(N.textContent=_t),xe=l(e),X=d(e,"UL",{"data-svelte-h":!0}),u(X)!=="svelte-rawo7c"&&(X.innerHTML=yt),Ue=l(e),q=d(e,"P",{"data-svelte-h":!0}),u(q)!=="svelte-1mo4tvr"&&(q.textContent=vt),Ze=l(e),L=d(e,"P",{"data-svelte-h":!0}),u(L)!=="svelte-1jnf10a"&&(L.innerHTML=Tt),ze=l(e),f(V.$$.fragment,e),Be=l(e),Q=d(e,"P",{"data-svelte-h":!0}),u(Q)!=="svelte-12pi0f7"&&(Q.textContent=wt),Ie=l(e),f(A.$$.fragment,e),Ge=l(e),S=d(e,"P",{"data-svelte-h":!0}),u(S)!=="svelte-kqbl7x"&&(S.innerHTML=Ft),Re=l(e),f(P.$$.fragment,e),Ye=l(e),D=d(e,"P",{"data-svelte-h":!0}),u(D)!=="svelte-3r5qjg"&&(D.innerHTML=jt),He=l(e),f(O.$$.fragment,e),Ee=l(e),K=d(e,"P",{"data-svelte-h":!0}),u(K)!=="svelte-bizjd7"&&(K.textContent=$t),Ne=l(e),f(ee.$$.fragment,e),Xe=l(e),f(te.$$.fragment,e),qe=l(e),j=d(e,"DIV",{class:!0});var x=me(j);f(ae.$$.fragment,x),Oe=l(x),ue=d(x,"P",{"data-svelte-h":!0}),u(ue)!=="svelte-i5sdtz"&&(ue.innerHTML=kt),Ke=l(x),he=d(x,"P",{"data-svelte-h":!0}),u(he)!=="svelte-o55m63"&&(he.innerHTML=Ct),et=l(x),f(z.$$.fragment,x),x.forEach(a),Le=l(e),f(ne.$$.fragment,e),Ve=l(e),w=d(e,"DIV",{class:!0});var $=me(w);f(oe.$$.fragment,$),tt=l($),fe=d($,"P",{"data-svelte-h":!0}),u(fe)!=="svelte-vegge"&&(fe.textContent=Jt),at=l($),ge=d($,"P",{"data-svelte-h":!0}),u(ge)!=="svelte-6pahdo"&&(ge.innerHTML=Wt),nt=l($),be=d($,"P",{"data-svelte-h":!0}),u(be)!=="svelte-hswkmf"&&(be.innerHTML=xt),ot=l($),J=d($,"DIV",{class:!0});var U=me(J);f(se.$$.fragment,U),st=l(U),Me=d(U,"P",{"data-svelte-h":!0}),u(Me)!=="svelte-yet315"&&(Me.innerHTML=Ut),rt=l(U),f(B.$$.fragment,U),lt=l(U),f(I.$$.fragment,U),U.forEach(a),$.forEach(a),Qe=l(e),f(re.$$.fragment,e),Ae=l(e),F=d(e,"DIV",{class:!0});var k=me(F);f(le.$$.fragment,k),it=l(k),_e=d(k,"P",{"data-svelte-h":!0}),u(_e)!=="svelte-g0dgxw"&&(_e.textContent=Zt),dt=l(k),ye=d(k,"P",{"data-svelte-h":!0}),u(ye)!=="svelte-6pahdo"&&(ye.innerHTML=zt),mt=l(k),ve=d(k,"P",{"data-svelte-h":!0}),u(ve)!=="svelte-hswkmf"&&(ve.innerHTML=Bt),ct=l(k),W=d(k,"DIV",{class:!0});var Z=me(W);f(ie.$$.fragment,Z),pt=l(Z),Te=d(Z,"P",{"data-svelte-h":!0}),u(Te)!=="svelte-pk1lht"&&(Te.innerHTML=It),ut=l(Z),f(G.$$.fragment,Z),ht=l(Z),f(R.$$.fragment,Z),Z.forEach(a),k.forEach(a),Se=l(e),f(de.$$.fragment,e),Pe=l(e),Fe=d(e,"P",{}),me(Fe).forEach(a),this.h()},h(){ce(o,"name","hf:doc:metadata"),ce(o,"content",Pt),ce(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ce(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ce(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ce(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ce(F,"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){p(document.head,o),n(e,v,t),n(e,m,t),n(e,c,t),g(y,e,t),n(e,s,t),g(T,e,t),n(e,ke,t),n(e,Y,t),n(e,Ce,t),n(e,H,t),n(e,Je,t),n(e,E,t),n(e,We,t),n(e,N,t),n(e,xe,t),n(e,X,t),n(e,Ue,t),n(e,q,t),n(e,Ze,t),n(e,L,t),n(e,ze,t),g(V,e,t),n(e,Be,t),n(e,Q,t),n(e,Ie,t),g(A,e,t),n(e,Ge,t),n(e,S,t),n(e,Re,t),g(P,e,t),n(e,Ye,t),n(e,D,t),n(e,He,t),g(O,e,t),n(e,Ee,t),n(e,K,t),n(e,Ne,t),g(ee,e,t),n(e,Xe,t),g(te,e,t),n(e,qe,t),n(e,j,t),g(ae,j,null),p(j,Oe),p(j,ue),p(j,Ke),p(j,he),p(j,et),g(z,j,null),n(e,Le,t),g(ne,e,t),n(e,Ve,t),n(e,w,t),g(oe,w,null),p(w,tt),p(w,fe),p(w,at),p(w,ge),p(w,nt),p(w,be),p(w,ot),p(w,J),g(se,J,null),p(J,st),p(J,Me),p(J,rt),g(B,J,null),p(J,lt),g(I,J,null),n(e,Qe,t),g(re,e,t),n(e,Ae,t),n(e,F,t),g(le,F,null),p(F,it),p(F,_e),p(F,dt),p(F,ye),p(F,mt),p(F,ve),p(F,ct),p(F,W),g(ie,W,null),p(W,pt),p(W,Te),p(W,ut),g(G,W,null),p(W,ht),g(R,W,null),n(e,Se,t),g(de,e,t),n(e,Pe,t),n(e,Fe,t),De=!0},p(e,[t]){const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),z.$set(x);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),B.$set($);const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),I.$set(U);const k={};t&2&&(k.$$scope={dirty:t,ctx:e}),G.$set(k);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),R.$set(Z)},i(e){De||(b(y.$$.fragment,e),b(T.$$.fragment,e),b(V.$$.fragment,e),b(A.$$.fragment,e),b(P.$$.fragment,e),b(O.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(ae.$$.fragment,e),b(z.$$.fragment,e),b(ne.$$.fragment,e),b(oe.$$.fragment,e),b(se.$$.fragment,e),b(B.$$.fragment,e),b(I.$$.fragment,e),b(re.$$.fragment,e),b(le.$$.fragment,e),b(ie.$$.fragment,e),b(G.$$.fragment,e),b(R.$$.fragment,e),b(de.$$.fragment,e),De=!0)},o(e){M(y.$$.fragment,e),M(T.$$.fragment,e),M(V.$$.fragment,e),M(A.$$.fragment,e),M(P.$$.fragment,e),M(O.$$.fragment,e),M(ee.$$.fragment,e),M(te.$$.fragment,e),M(ae.$$.fragment,e),M(z.$$.fragment,e),M(ne.$$.fragment,e),M(oe.$$.fragment,e),M(se.$$.fragment,e),M(B.$$.fragment,e),M(I.$$.fragment,e),M(re.$$.fragment,e),M(le.$$.fragment,e),M(ie.$$.fragment,e),M(G.$$.fragment,e),M(R.$$.fragment,e),M(de.$$.fragment,e),De=!1},d(e){e&&(a(v),a(m),a(c),a(s),a(ke),a(Y),a(Ce),a(H),a(Je),a(E),a(We),a(N),a(xe),a(X),a(Ue),a(q),a(Ze),a(L),a(ze),a(Be),a(Q),a(Ie),a(Ge),a(S),a(Re),a(Ye),a(D),a(He),a(Ee),a(K),a(Ne),a(Xe),a(qe),a(j),a(Le),a(Ve),a(w),a(Qe),a(Ae),a(F),a(Se),a(Pe),a(Fe)),a(o),_(y,e),_(T,e),_(V,e),_(A,e),_(P,e),_(O,e),_(ee,e),_(te,e),_(ae),_(z),_(ne,e),_(oe),_(se),_(B),_(I),_(re,e),_(le),_(ie),_(G),_(R),_(de,e)}}}const Pt='{"title":"FalconMamba","local":"falconmamba","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2}],"depth":1}';function Dt(C){return Yt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sa extends Ht{constructor(o){super(),Et(this,o,Dt,St,Rt,{})}}export{sa as component};
