import{s as $o,f as jo,o as xo,n as wt}from"../chunks/scheduler.25b97de1.js";import{S as Co,i as Uo,g as i,s as n,r as m,A as zo,h as l,f as o,c as a,j as F,u as p,x as c,k as C,y as r,a as s,v as u,d as h,t as f,w as g}from"../chunks/index.d9030fc9.js";import{T as Qt}from"../chunks/Tip.baa67368.js";import{D as we}from"../chunks/Docstring.ffac8efa.js";import{C as Je}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Fo}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as B,E as Go}from"../chunks/EditOnGithub.91d95064.js";function Zo(G){let d,T=`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=T},l(_){d=l(_,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=T)},m(_,M){s(_,d,M)},p:wt,d(_){_&&o(d)}}}function Wo(G){let d,T=`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=T},l(_){d=l(_,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=T)},m(_,M){s(_,d,M)},p:wt,d(_){_&&o(d)}}}function Lo(G){let d,T="Example:",_,M,j;return M=new Je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBKYW1iYUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBKYW1iYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJhaTIxbGFicyUyRkphbWJhLXYwLjElMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyYWkyMWxhYnMlMkZKYW1iYS12MC4xJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkhleSUyQyUyMGFyZSUyMHlvdSUyMGNvbnNjaW91cyUzRiUyMENhbiUyMHlvdSUyMHRhbGslMjB0byUyMG1lJTNGJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMuaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDMwKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, JambaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = JambaForCausalLM.from_pretrained(<span class="hljs-string">&quot;ai21labs/Jamba-v0.1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ai21labs/Jamba-v0.1&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){d=i("p"),d.textContent=T,_=n(),m(M.$$.fragment)},l(b){d=l(b,"P",{"data-svelte-h":!0}),c(d)!=="svelte-11lpom8"&&(d.textContent=T),_=a(b),p(M.$$.fragment,b)},m(b,U){s(b,d,U),s(b,_,U),u(M,b,U),j=!0},p:wt,i(b){j||(h(M.$$.fragment,b),j=!0)},o(b){f(M.$$.fragment,b),j=!1},d(b){b&&(o(d),o(_)),g(M,b)}}}function Bo(G){let d,T=`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=T},l(_){d=l(_,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=T)},m(_,M){s(_,d,M)},p:wt,d(_){_&&o(d)}}}function qo(G){let d,T,_,M,j,b,U,Pe,P,Ot="Jamba is a state-of-the-art, hybrid SSM-Transformer LLM. It is the first production-scale Mamba implementation, which opens up interesting research and application opportunities. While this initial experimentation shows encouraging gains, we expect these to be further enhanced with future optimizations and explorations.",Ve,V,Kt='For full details of this model please read the <a href="https://www.ai21.com/blog/announcing-jamba" rel="nofollow">release blog post</a>.',Ye,Y,De,D,eo="Jamba is a pretrained, mixture-of-experts (MoE) generative text model, with 12B active parameters and an overall of 52B parameters across all experts. It supports a 256K context length, and can fit up to 140K tokens on a single 80GB GPU.",Qe,Q,to="As depicted in the diagram below, Jamba’s architecture features a blocks-and-layers approach that allows Jamba to successfully integrate Transformer and Mamba architectures altogether. Each Jamba block contains either an attention or a Mamba layer, followed by a multi-layer perceptron (MLP), producing an overall ratio of one Transformer layer out of every eight total layers.",Oe,H,oo,Ke,O,et,K,tt,ee,no="Jamba requires you use <code>transformers</code> version 4.39.0 or higher:",ot,te,nt,oe,ao="In order to run optimized Mamba implementations, you first need to install <code>mamba-ssm</code> and <code>causal-conv1d</code>:",at,ne,st,ae,so="You also have to have the model on a CUDA device.",rt,se,ro="You can run the model not using the optimized Mamba kernels, but it is <strong>not</strong> recommended as it will result in significantly lower latencies. In order to do that, you’ll need to specify <code>use_mamba_kernels=False</code> when loading the model.",it,re,lt,ie,dt,w,ke,io="<strong>Loading the model in half precision</strong>",Jt,Ie,lo="The published checkpoint is saved in BF16. In order to load it into RAM in BF16/FP16, you need to specify <code>torch_dtype</code>:",kt,le,It,$e,co='When using half precision, you can enable the <a href="https://github.com/Dao-AILab/flash-attention" rel="nofollow">FlashAttention2</a> implementation of the Attention blocks. In order to use it, you also need the model on a CUDA device. Since in this precision the model is to big to fit on a single 80GB GPU, you’ll also need to parallelize it using <a href="https://huggingface.co/docs/accelerate/index" rel="nofollow">accelerate</a>:',$t,de,ct,Z,je,mo="<strong>Load the model in 8-bit</strong>",jt,xe,po='<strong>Using 8-bit precision, it is possible to fit up to 140K sequence lengths on a single 80GB GPU.</strong> You can easily quantize the model to 8-bit using <a href="https://huggingface.co/docs/bitsandbytes/index" rel="nofollow">bitsandbytes</a>. In order to not degrade model quality, we recommend to exclude the Mamba blocks from the quantization:',xt,ce,mt,me,pt,k,pe,Ct,Ce,uo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.42.4/en/model_doc/jamba#transformers.JambaModel">JambaModel</a>. It is used to instantiate a
Jamba 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 Jamba-v0.1 model.`,Ut,Ue,ho='<a href="https://huggingface.co/ai21labs/Jamba-v0.1" rel="nofollow">ai21labs/Jamba-v0.1</a>',zt,ze,fo=`Configuration objects inherit from <a href="/docs/transformers/v4.42.4/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.42.4/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ut,ue,ht,v,he,Ft,Fe,go=`The bare Jamba Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.42.4/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.)`,Gt,Ge,_o=`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.`,Zt,Ze,bo="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>JambaDecoderLayer</code>",Wt,W,fe,Lt,We,yo='The <a href="/docs/transformers/v4.42.4/en/model_doc/jamba#transformers.JambaModel">JambaModel</a> forward method, overrides the <code>__call__</code> special method.',Bt,R,ft,ge,gt,q,_e,qt,x,be,Nt,Le,Mo='The <a href="/docs/transformers/v4.42.4/en/model_doc/jamba#transformers.JambaForCausalLM">JambaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Ht,A,Rt,S,_t,ye,bt,y,Me,At,Be,To="The Jamba Model with a sequence classification head on top (linear layer).",St,qe,vo=`<a href="/docs/transformers/v4.42.4/en/model_doc/jamba#transformers.JambaForSequenceClassification">JambaForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,Xt,Ne,wo=`Since it does classification on the last token, it requires to know the position of the last token. If a
<code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If
no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in
each row of the batch).`,Et,He,Jo=`This model inherits from <a href="/docs/transformers/v4.42.4/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.)`,Pt,Re,ko=`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.`,Vt,L,Te,Yt,Ae,Io='The <a href="/docs/transformers/v4.42.4/en/model_doc/jamba#transformers.JambaForSequenceClassification">JambaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',Dt,X,yt,ve,Mt,Ee,Tt;return j=new B({props:{title:"Jamba",local:"jamba",headingTag:"h1"}}),U=new B({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Y=new B({props:{title:"Model Details",local:"model-details",headingTag:"h3"}}),O=new B({props:{title:"Usage",local:"usage",headingTag:"h2"}}),K=new B({props:{title:"Presequities",local:"presequities",headingTag:"h3"}}),te=new Je({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUzRSUzRDQuMzkuMA==",highlighted:"pip install transformers&gt;=4.39.0",wrap:!1}}),ne=new Je({props:{code:"cGlwJTIwaW5zdGFsbCUyMG1hbWJhLXNzbSUyMGNhdXNhbC1jb252MWQlM0UlM0QxLjIuMA==",highlighted:"pip install mamba-ssm causal-conv1d&gt;=1.2.0",wrap:!1}}),re=new B({props:{title:"Run the model",local:"run-the-model",headingTag:"h3"}}),ie=new Je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmFpMjFsYWJzJTJGSmFtYmEtdjAuMSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJhaTIxbGFicyUyRkphbWJhLXYwLjElMjIpJTBBJTBBaW5wdXRfaWRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkluJTIwdGhlJTIwcmVjZW50JTIwU3VwZXIlMjBCb3dsJTIwTFZJSUklMkMlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCdwdCcpLnRvKG1vZGVsLmRldmljZSklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRfaWRzJTJDJTIwbWF4X25ld190b2tlbnMlM0QyMTYpJTBBJTBBcHJpbnQodG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXRzKSklMEElMjMlMjAlNUIlMjIlM0MlN0NzdGFydG9mdGV4dCU3QyUzRUluJTIwdGhlJTIwcmVjZW50JTIwU3VwZXIlMjBCb3dsJTIwTFZJSUklMkMlMjB0aGUlMjBLYW5zYXMlMjBDaXR5JTIwQ2hpZWZzJTIwZW1lcmdlZCUyMHZpY3RvcmlvdXMlMkMlMjBkZWZlYXRpbmclMjB0aGUlMjBTYW4lMjBGcmFuY2lzY28lMjA0OWVycyUyMGluJTIwYSUyMHRocmlsbGluZyUyMG92ZXJ0aW1lJTIwc2hvd2Rvd24uJTIwVGhlJTIwZ2FtZSUyMHdhcyUyMGElMjBuYWlsLWJpdGVyJTJDJTIwd2l0aCUyMGJvdGglMjB0ZWFtcyUyMHNob3djYXNpbmclMjB0aGVpciUyMHNraWxscyUyMGFuZCUyMGRldGVybWluYXRpb24uJTVDbiU1Q25UaGUlMjBDaGllZnMlMkMlMjBsZWQlMjBieSUyMHRoZWlyJTIwc3RhciUyMHF1YXJ0ZXJiYWNrJTIwUGF0cmljayUyME1haG9tZXMlMkMlMjBkaXNwbGF5ZWQlMjB0aGVpciUyMG9mZmVuc2l2ZSUyMHByb3dlc3MlMkMlMjB3aGlsZSUyMHRoZSUyMDQ5ZXJzJTJDJTIwbGVkJTIwYnklMjB0aGVpciUyMHN0cm9uZyUyMGRlZmVuc2UlMkMlMjBwdXQlMjB1cCUyMGElMjB0b3VnaCUyMGZpZ2h0LiUyMFRoZSUyMGdhbWUlMjB3ZW50JTIwaW50byUyMG92ZXJ0aW1lJTJDJTIwd2l0aCUyMHRoZSUyMENoaWVmcyUyMHVsdGltYXRlbHklMjBzZWN1cmluZyUyMHRoZSUyMHdpbiUyMHdpdGglMjBhJTIwdG91Y2hkb3duLiU1Q24lNUNuVGhlJTIwdmljdG9yeSUyMG1hcmtlZCUyMHRoZSUyMENoaWVmcyclMjBzZWNvbmQlMjBTdXBlciUyMEJvd2wlMjB3aW4lMjBpbiUyMGZvdXIlMjB5ZWFycyUyQyUyMHNvbGlkaWZ5aW5nJTIwdGhlaXIlMjBzdGF0dXMlMjBhcyUyMG9uZSUyMG9mJTIwdGhlJTIwdG9wJTIwdGVhbXMlMjBpbiUyMHRoZSUyME5GTC4lMjBUaGUlMjBnYW1lJTIwd2FzJTIwYSUyMHRlc3RhbWVudCUyMHRvJTIwdGhlJTIwc2tpbGwlMjBhbmQlMjB0YWxlbnQlMjBvZiUyMGJvdGglMjB0ZWFtcyUyQyUyMGFuZCUyMGElMjB0aHJpbGxpbmclMjBlbmQlMjB0byUyMHRoZSUyME5GTCUyMHNlYXNvbi4lNUNuJTVDblRoZSUyMFN1cGVyJTIwQm93bCUyMGlzJTIwbm90JTIwanVzdCUyMGFib3V0JTIwdGhlJTIwZ2FtZSUyMGl0c2VsZiUyQyUyMGJ1dCUyMGFsc28lMjBhYm91dCUyMHRoZSUyMGhhbGZ0aW1lJTIwc2hvdyUyMGFuZCUyMHRoZSUyMGNvbW1lcmNpYWxzLiUyMFRoaXMlMjB5ZWFyJ3MlMjBoYWxmdGltZSUyMHNob3clMjBmZWF0dXJlZCUyMGElMjBzdGFyLXN0dWRkZWQlMjBsaW5ldXAlMkMlMjBpbmNsdWRpbmclMjBVc2hlciUyQyUyMEFsaWNpYSUyMEtleXMlMkMlMjBhbmQlMjBMaWwlMjBKb24uJTIwVGhlJTIwc2hvdyUyMHdhcyUyMGElMjBzcGVjdGFjbGUlMjBvZiUyMG11c2ljJTIwYW5kJTIwZGFuY2UlMkMlMjB3aXRoJTIwdGhlJTIwcGVyZm9ybWVycyUyMGRlbGl2ZXJpbmclMjBhbiUyMGVuZXJnZXRpYyUyMGFuZCUyMGVudGVydGFpbmluZyUyMHBlcmZvcm1hbmNlLiU1Q24lMjIlNUQ=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;ai21labs/Jamba-v0.1&quot;</span>)
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ai21labs/Jamba-v0.1&quot;</span>)

input_ids = tokenizer(<span class="hljs-string">&quot;In the recent Super Bowl LVIII,&quot;</span>, return_tensors=<span class="hljs-string">&#x27;pt&#x27;</span>).to(model.device)[<span class="hljs-string">&quot;input_ids&quot;</span>]

outputs = model.generate(input_ids, max_new_tokens=<span class="hljs-number">216</span>)

<span class="hljs-built_in">print</span>(tokenizer.batch_decode(outputs))
<span class="hljs-comment"># [&quot;&lt;|startoftext|&gt;In the recent Super Bowl LVIII, the Kansas City Chiefs emerged victorious, defeating the San Francisco 49ers in a thrilling overtime showdown. The game was a nail-biter, with both teams showcasing their skills and determination.\\n\\nThe Chiefs, led by their star quarterback Patrick Mahomes, displayed their offensive prowess, while the 49ers, led by their strong defense, put up a tough fight. The game went into overtime, with the Chiefs ultimately securing the win with a touchdown.\\n\\nThe victory marked the Chiefs&#x27; second Super Bowl win in four years, solidifying their status as one of the top teams in the NFL. The game was a testament to the skill and talent of both teams, and a thrilling end to the NFL season.\\n\\nThe Super Bowl is not just about the game itself, but also about the halftime show and the commercials. This year&#x27;s halftime show featured a star-studded lineup, including Usher, Alicia Keys, and Lil Jon. The show was a spectacle of music and dance, with the performers delivering an energetic and entertaining performance.\\n&quot;]</span>`,wrap:!1}}),le=new Je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBaW1wb3J0JTIwdG9yY2glMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJhaTIxbGFicyUyRkphbWJhLXYwLjElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQSUyMyUyMHlvdSUyMGNhbiUyMGFsc28lMjB1c2UlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTY=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM
<span class="hljs-keyword">import</span> torch
model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;ai21labs/Jamba-v0.1&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-comment"># you can also use torch_dtype=torch.float16</span>`,wrap:!1}}),de=new Je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBaW1wb3J0JTIwdG9yY2glMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJhaTIxbGFicyUyRkphbWJhLXYwLjElMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMmZsYXNoX2F0dGVudGlvbl8yJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM
<span class="hljs-keyword">import</span> torch
model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;ai21labs/Jamba-v0.1&quot;</span>,
                                             torch_dtype=torch.bfloat16,
                                             attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>,
                                             device_map=<span class="hljs-string">&quot;auto&quot;</span>)`,wrap:!1}}),ce=new Je({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyhsb2FkX2luXzhiaXQlM0RUcnVlJTJDJTIwbGxtX2ludDhfc2tpcF9tb2R1bGVzJTNEJTVCJTIybWFtYmElMjIlNUQpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyYWkyMWxhYnMlMkZKYW1iYS12MC4xJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUyQyUyMGF0dG5faW1wbGVtZW50YXRpb24lM0QlMjJmbGFzaF9hdHRlbnRpb25fMiUyMiUyQyUyMHF1YW50aXphdGlvbl9jb25maWclM0RxdWFudGl6YXRpb25fY29uZmlnJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig
quantization_config = BitsAndBytesConfig(load_in_8bit=<span class="hljs-literal">True</span>, llm_int8_skip_modules=[<span class="hljs-string">&quot;mamba&quot;</span>])
model = AutoModelForCausalLM.from_pretrained(
    <span class="hljs-string">&quot;ai21labs/Jamba-v0.1&quot;</span>, torch_dtype=torch.bfloat16, attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>, quantization_config=quantization_config
)`,wrap:!1}}),me=new B({props:{title:"JambaConfig",local:"transformers.JambaConfig",headingTag:"h2"}}),pe=new we({props:{name:"class transformers.JambaConfig",anchor:"transformers.JambaConfig",parameters:[{name:"vocab_size",val:" = 65536"},{name:"tie_word_embeddings",val:" = False"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 14336"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = 8"},{name:"hidden_act",val:" = 'silu'"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"num_logits_to_keep",val:" = 1"},{name:"output_router_logits",val:" = False"},{name:"router_aux_loss_coef",val:" = 0.001"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"sliding_window",val:" = None"},{name:"max_position_embeddings",val:" = 262144"},{name:"attention_dropout",val:" = 0.0"},{name:"num_experts_per_tok",val:" = 2"},{name:"num_experts",val:" = 16"},{name:"expert_layer_period",val:" = 2"},{name:"expert_layer_offset",val:" = 1"},{name:"attn_layer_period",val:" = 8"},{name:"attn_layer_offset",val:" = 4"},{name:"use_mamba_kernels",val:" = True"},{name:"mamba_d_state",val:" = 16"},{name:"mamba_d_conv",val:" = 4"},{name:"mamba_expand",val:" = 2"},{name:"mamba_dt_rank",val:" = 'auto'"},{name:"mamba_conv_bias",val:" = True"},{name:"mamba_proj_bias",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.JambaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 65536) &#x2014;
Vocabulary size of the Jamba 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.42.4/en/model_doc/jamba#transformers.JambaModel">JambaModel</a>`,name:"vocab_size"},{anchor:"transformers.JambaConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model&#x2019;s input and output word embeddings should be tied. Note that this is only relevant if the
model has a output word embedding layer.`,name:"tie_word_embeddings"},{anchor:"transformers.JambaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.JambaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 14336) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.JambaConfig.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 Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.JambaConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.JambaConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1</code> the model will use Multi Query Attention (MQA) otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
by meanpooling all the original heads within that group. For more details checkout <a href="https://arxiv.org/pdf/2305.13245.pdf" rel="nofollow">this
paper</a>. If it is not specified, will default to <code>8</code>.`,name:"num_key_value_heads"},{anchor:"transformers.JambaConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</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.JambaConfig.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.JambaConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.JambaConfig.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). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.JambaConfig.num_logits_to_keep",description:`<strong>num_logits_to_keep</strong> (<code>int</code> or <code>None</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of prompt logits to calculate during generation. If <code>None</code>, all logits will be calculated. If an
integer value, only last <code>num_logits_to_keep</code> logits will be calculated. Default is 1 because only the
logits of the last prompt token are needed for generation. For long sequences, the logits for the entire
sequence may use a lot of memory so, setting <code>num_logits_to_keep=1</code> will reduce memory footprint
significantly.`,name:"num_logits_to_keep"},{anchor:"transformers.JambaConfig.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the router logits should be returned by the model. Enabling this will also
allow the model to output the auxiliary loss. See <a href>here</a> for more details`,name:"output_router_logits"},{anchor:"transformers.JambaConfig.router_aux_loss_coef",description:`<strong>router_aux_loss_coef</strong> (<code>float</code>, <em>optional</em>, defaults to 0.001) &#x2014;
The aux loss factor for the total loss.`,name:"router_aux_loss_coef"},{anchor:"transformers.JambaConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The id of the padding token.`,name:"pad_token_id"},{anchor:"transformers.JambaConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The id of the &#x201C;beginning-of-sequence&#x201D; token.`,name:"bos_token_id"},{anchor:"transformers.JambaConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The id of the &#x201C;end-of-sequence&#x201D; token.`,name:"eos_token_id"},{anchor:"transformers.JambaConfig.sliding_window",description:`<strong>sliding_window</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Sliding window attention window size. If not specified, will default to <code>None</code>.`,name:"sliding_window"},{anchor:"transformers.JambaConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 262144) &#x2014;
This value doesn&#x2019;t have any real effect. The maximum sequence length that this model is intended to be
used with. It can be used with longer sequences, but performance may degrade.`,name:"max_position_embeddings"},{anchor:"transformers.JambaConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.JambaConfig.num_experts_per_tok",description:`<strong>num_experts_per_tok</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The number of experts to root per-token, can be also interpreted as the <code>top-p</code> routing
parameter`,name:"num_experts_per_tok"},{anchor:"transformers.JambaConfig.num_experts",description:`<strong>num_experts</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of experts per Sparse MLP layer.`,name:"num_experts"},{anchor:"transformers.JambaConfig.expert_layer_period",description:`<strong>expert_layer_period</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Once in this many layers, we will have an expert layer`,name:"expert_layer_period"},{anchor:"transformers.JambaConfig.expert_layer_offset",description:`<strong>expert_layer_offset</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The first layer index that contains an expert mlp layer`,name:"expert_layer_offset"},{anchor:"transformers.JambaConfig.attn_layer_period",description:`<strong>attn_layer_period</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Once in this many layers, we will have a vanilla attention layer`,name:"attn_layer_period"},{anchor:"transformers.JambaConfig.attn_layer_offset",description:`<strong>attn_layer_offset</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The first layer index that contains a vanilla attention mlp layer`,name:"attn_layer_offset"},{anchor:"transformers.JambaConfig.use_mamba_kernels",description:`<strong>use_mamba_kernels</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Flag indicating whether or not to use the fast mamba kernels. These are available only if <code>mamba-ssm</code> and
<code>causal-conv1d</code> are installed, and the mamba modules are running on a CUDA device. Raises ValueError if
<code>True</code> and kernels are not available`,name:"use_mamba_kernels"},{anchor:"transformers.JambaConfig.mamba_d_state",description:`<strong>mamba_d_state</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The dimension the mamba state space latents`,name:"mamba_d_state"},{anchor:"transformers.JambaConfig.mamba_d_conv",description:`<strong>mamba_d_conv</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The size of the mamba convolution kernel`,name:"mamba_d_conv"},{anchor:"transformers.JambaConfig.mamba_expand",description:`<strong>mamba_expand</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Expanding factor (relative to hidden_size) used to determine the mamba intermediate size`,name:"mamba_expand"},{anchor:"transformers.JambaConfig.mamba_dt_rank",description:`<strong>mamba_dt_rank</strong> (<code>Union[int,str]</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
Rank of the the mamba discretization projection matrix. <code>&quot;auto&quot;</code> means that it will default to <code>math.ceil(self.hidden_size / 16)</code>`,name:"mamba_dt_rank"},{anchor:"transformers.JambaConfig.mamba_conv_bias",description:`<strong>mamba_conv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Flag indicating whether or not to use bias in the convolution layer of the mamba mixer block.`,name:"mamba_conv_bias"},{anchor:"transformers.JambaConfig.mamba_proj_bias",description:`<strong>mamba_proj_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Flag indicating whether or not to use bias in the input and output projections ([&#x201C;in_proj&#x201D;, &#x201C;out_proj&#x201D;]) of the mamba mixer block`,name:"mamba_proj_bias"}],source:"https://github.com/huggingface/transformers/blob/v4.42.4/src/transformers/models/jamba/configuration_jamba.py#L26"}}),ue=new B({props:{title:"JambaModel",local:"transformers.JambaModel",headingTag:"h2"}}),he=new we({props:{name:"class transformers.JambaModel",anchor:"transformers.JambaModel",parameters:[{name:"config",val:": JambaConfig"}],parametersDescription:[{anchor:"transformers.JambaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.42.4/en/model_doc/jamba#transformers.JambaConfig">JambaConfig</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.42.4/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; JambaConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.42.4/src/transformers/models/jamba/modeling_jamba.py#L1357"}}),fe=new we({props:{name:"forward",anchor:"transformers.JambaModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"output_router_logits",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.JambaModel.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.42.4/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.JambaModel.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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</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:"attention_mask"},{anchor:"transformers.JambaModel.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.JambaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>HybridMambaAttentionDynamicCache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
A HybridMambaAttentionDynamicCache object containing pre-computed hidden-states (keys and values in the
self-attention blocks and convolution and ssm states in the mamba blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.
Key and value cache tensors have shape <code>(batch_size, num_heads, seq_len, head_dim)</code>.
Convolution and ssm states tensors have shape <code>(batch_size, d_inner, d_conv)</code> and
<code>(batch_size, d_inner, d_state)</code> respectively.
See the <code>HybridMambaAttentionDynamicCache</code> class for more details.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>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.JambaModel.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.JambaModel.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.JambaModel.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.JambaModel.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.JambaModel.forward.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the logits of all the routers. They are useful for computing the router loss, and
should not be returned during inference.`,name:"output_router_logits"},{anchor:"transformers.JambaModel.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.42.4/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.JambaModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/v4.42.4/src/transformers/models/jamba/modeling_jamba.py#L1395"}}),R=new Qt({props:{$$slots:{default:[Zo]},$$scope:{ctx:G}}}),ge=new B({props:{title:"JambaForCausalLM",local:"transformers.JambaForCausalLM",headingTag:"h2"}}),_e=new we({props:{name:"class transformers.JambaForCausalLM",anchor:"transformers.JambaForCausalLM",parameters:[{name:"config",val:": JambaConfig"}],source:"https://github.com/huggingface/transformers/blob/v4.42.4/src/transformers/models/jamba/modeling_jamba.py#L1555"}}),be=new we({props:{name:"forward",anchor:"transformers.JambaForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"output_router_logits",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"},{name:"num_logits_to_keep",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.JambaForCausalLM.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.42.4/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.JambaForCausalLM.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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</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:"attention_mask"},{anchor:"transformers.JambaForCausalLM.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.JambaForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>HybridMambaAttentionDynamicCache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
A HybridMambaAttentionDynamicCache object containing pre-computed hidden-states (keys and values in the
self-attention blocks and convolution and ssm states in the mamba blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.
Key and value cache tensors have shape <code>(batch_size, num_heads, seq_len, head_dim)</code>.
Convolution and ssm states tensors have shape <code>(batch_size, d_inner, d_conv)</code> and
<code>(batch_size, d_inner, d_state)</code> respectively.
See the <code>HybridMambaAttentionDynamicCache</code> class for more details.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>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.JambaForCausalLM.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.JambaForCausalLM.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.JambaForCausalLM.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.JambaForCausalLM.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.JambaForCausalLM.forward.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the logits of all the routers. They are useful for computing the router loss, and
should not be returned during inference.`,name:"output_router_logits"},{anchor:"transformers.JambaForCausalLM.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.42.4/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.JambaForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.</p>
<p>num_logits_to_keep (<code>int</code> or <code>None</code>, <em>optional</em>):
Calculate logits for the last <code>num_logits_to_keep</code> tokens. If <code>None</code>, calculate logits for all
<code>input_ids</code>. Only last token logits are needed for generation, and calculating them only for that token
can save memory, which becomes pretty significant for long sequences.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/v4.42.4/src/transformers/models/jamba/modeling_jamba.py#L1587",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.MoeCausalLMOutputWithPast</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/v4.42.4/en/model_doc/jamba#transformers.JambaConfig"
>JambaConfig</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>aux_loss</strong> (<code>torch.FloatTensor</code>, <em>optional</em>, returned when <code>labels</code> is provided) — aux_loss for the sparse modules.</p>
</li>
<li>
<p><strong>router_logits</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_router_probs=True</code> and <code>config.add_router_probs=True</code> is passed or when <code>config.output_router_probs=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, sequence_length, num_experts)</code>.</p>
<p>Raw router logtis (post-softmax) that are computed by MoE routers, these terms are used to compute the auxiliary
loss for Mixture of Experts models.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — 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>
</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>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.MoeCausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),A=new Qt({props:{$$slots:{default:[Wo]},$$scope:{ctx:G}}}),S=new Fo({props:{anchor:"transformers.JambaForCausalLM.forward.example",$$slots:{default:[Lo]},$$scope:{ctx:G}}}),ye=new B({props:{title:"JambaForSequenceClassification",local:"transformers.JambaForSequenceClassification",headingTag:"h2"}}),Me=new we({props:{name:"class transformers.JambaForSequenceClassification",anchor:"transformers.JambaForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.JambaForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.42.4/en/model_doc/jamba#transformers.JambaConfig">JambaConfig</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.42.4/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.42.4/src/transformers/models/jamba/modeling_jamba.py#L1777"}}),Te=new we({props:{name:"forward",anchor:"transformers.JambaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.JambaForSequenceClassification.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.42.4/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.JambaForSequenceClassification.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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.42.4/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.42.4/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</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:"attention_mask"},{anchor:"transformers.JambaForSequenceClassification.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.JambaForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>HybridMambaAttentionDynamicCache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
A HybridMambaAttentionDynamicCache object containing pre-computed hidden-states (keys and values in the
self-attention blocks and convolution and ssm states in the mamba blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.
Key and value cache tensors have shape <code>(batch_size, num_heads, seq_len, head_dim)</code>.
Convolution and ssm states tensors have shape <code>(batch_size, d_inner, d_conv)</code> and
<code>(batch_size, d_inner, d_state)</code> respectively.
See the <code>HybridMambaAttentionDynamicCache</code> class for more details.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>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.JambaForSequenceClassification.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.JambaForSequenceClassification.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.JambaForSequenceClassification.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.JambaForSequenceClassification.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.JambaForSequenceClassification.forward.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the logits of all the routers. They are useful for computing the router loss, and
should not be returned during inference.`,name:"output_router_logits"},{anchor:"transformers.JambaForSequenceClassification.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.42.4/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.JambaForSequenceClassification.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.JambaForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.42.4/src/transformers/models/jamba/modeling_jamba.py#L1809"}}),X=new Qt({props:{$$slots:{default:[Bo]},$$scope:{ctx:G}}}),ve=new Go({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/jamba.md"}}),{c(){d=i("meta"),T=n(),_=i("p"),M=n(),m(j.$$.fragment),b=n(),m(U.$$.fragment),Pe=n(),P=i("p"),P.textContent=Ot,Ve=n(),V=i("p"),V.innerHTML=Kt,Ye=n(),m(Y.$$.fragment),De=n(),D=i("p"),D.textContent=eo,Qe=n(),Q=i("p"),Q.textContent=to,Oe=n(),H=i("img"),Ke=n(),m(O.$$.fragment),et=n(),m(K.$$.fragment),tt=n(),ee=i("p"),ee.innerHTML=no,ot=n(),m(te.$$.fragment),nt=n(),oe=i("p"),oe.innerHTML=ao,at=n(),m(ne.$$.fragment),st=n(),ae=i("p"),ae.textContent=so,rt=n(),se=i("p"),se.innerHTML=ro,it=n(),m(re.$$.fragment),lt=n(),m(ie.$$.fragment),dt=n(),w=i("details"),ke=i("summary"),ke.innerHTML=io,Jt=n(),Ie=i("p"),Ie.innerHTML=lo,kt=n(),m(le.$$.fragment),It=n(),$e=i("p"),$e.innerHTML=co,$t=n(),m(de.$$.fragment),ct=n(),Z=i("details"),je=i("summary"),je.innerHTML=mo,jt=n(),xe=i("p"),xe.innerHTML=po,xt=n(),m(ce.$$.fragment),mt=n(),m(me.$$.fragment),pt=n(),k=i("div"),m(pe.$$.fragment),Ct=n(),Ce=i("p"),Ce.innerHTML=uo,Ut=n(),Ue=i("p"),Ue.innerHTML=ho,zt=n(),ze=i("p"),ze.innerHTML=fo,ut=n(),m(ue.$$.fragment),ht=n(),v=i("div"),m(he.$$.fragment),Ft=n(),Fe=i("p"),Fe.innerHTML=go,Gt=n(),Ge=i("p"),Ge.innerHTML=_o,Zt=n(),Ze=i("p"),Ze.innerHTML=bo,Wt=n(),W=i("div"),m(fe.$$.fragment),Lt=n(),We=i("p"),We.innerHTML=yo,Bt=n(),m(R.$$.fragment),ft=n(),m(ge.$$.fragment),gt=n(),q=i("div"),m(_e.$$.fragment),qt=n(),x=i("div"),m(be.$$.fragment),Nt=n(),Le=i("p"),Le.innerHTML=Mo,Ht=n(),m(A.$$.fragment),Rt=n(),m(S.$$.fragment),_t=n(),m(ye.$$.fragment),bt=n(),y=i("div"),m(Me.$$.fragment),At=n(),Be=i("p"),Be.textContent=To,St=n(),qe=i("p"),qe.innerHTML=vo,Xt=n(),Ne=i("p"),Ne.innerHTML=wo,Et=n(),He=i("p"),He.innerHTML=Jo,Pt=n(),Re=i("p"),Re.innerHTML=ko,Vt=n(),L=i("div"),m(Te.$$.fragment),Yt=n(),Ae=i("p"),Ae.innerHTML=Io,Dt=n(),m(X.$$.fragment),yt=n(),m(ve.$$.fragment),Mt=n(),Ee=i("p"),this.h()},l(e){const t=zo("svelte-u9bgzb",document.head);d=l(t,"META",{name:!0,content:!0}),t.forEach(o),T=a(e),_=l(e,"P",{}),F(_).forEach(o),M=a(e),p(j.$$.fragment,e),b=a(e),p(U.$$.fragment,e),Pe=a(e),P=l(e,"P",{"data-svelte-h":!0}),c(P)!=="svelte-1frdu2s"&&(P.textContent=Ot),Ve=a(e),V=l(e,"P",{"data-svelte-h":!0}),c(V)!=="svelte-11hqo7x"&&(V.innerHTML=Kt),Ye=a(e),p(Y.$$.fragment,e),De=a(e),D=l(e,"P",{"data-svelte-h":!0}),c(D)!=="svelte-57h5jx"&&(D.textContent=eo),Qe=a(e),Q=l(e,"P",{"data-svelte-h":!0}),c(Q)!=="svelte-ed1xn5"&&(Q.textContent=to),Oe=a(e),H=l(e,"IMG",{src:!0,alt:!0,width:!0}),Ke=a(e),p(O.$$.fragment,e),et=a(e),p(K.$$.fragment,e),tt=a(e),ee=l(e,"P",{"data-svelte-h":!0}),c(ee)!=="svelte-q1z7cw"&&(ee.innerHTML=no),ot=a(e),p(te.$$.fragment,e),nt=a(e),oe=l(e,"P",{"data-svelte-h":!0}),c(oe)!=="svelte-1ruzjzk"&&(oe.innerHTML=ao),at=a(e),p(ne.$$.fragment,e),st=a(e),ae=l(e,"P",{"data-svelte-h":!0}),c(ae)!=="svelte-1kmjqje"&&(ae.textContent=so),rt=a(e),se=l(e,"P",{"data-svelte-h":!0}),c(se)!=="svelte-syhw7e"&&(se.innerHTML=ro),it=a(e),p(re.$$.fragment,e),lt=a(e),p(ie.$$.fragment,e),dt=a(e),w=l(e,"DETAILS",{});var I=F(w);ke=l(I,"SUMMARY",{"data-svelte-h":!0}),c(ke)!=="svelte-1w6603b"&&(ke.innerHTML=io),Jt=a(I),Ie=l(I,"P",{"data-svelte-h":!0}),c(Ie)!=="svelte-8fni2k"&&(Ie.innerHTML=lo),kt=a(I),p(le.$$.fragment,I),It=a(I),$e=l(I,"P",{"data-svelte-h":!0}),c($e)!=="svelte-elnbbj"&&($e.innerHTML=co),$t=a(I),p(de.$$.fragment,I),I.forEach(o),ct=a(e),Z=l(e,"DETAILS",{});var N=F(Z);je=l(N,"SUMMARY",{"data-svelte-h":!0}),c(je)!=="svelte-rm52wm"&&(je.innerHTML=mo),jt=a(N),xe=l(N,"P",{"data-svelte-h":!0}),c(xe)!=="svelte-z0koyh"&&(xe.innerHTML=po),xt=a(N),p(ce.$$.fragment,N),N.forEach(o),mt=a(e),p(me.$$.fragment,e),pt=a(e),k=l(e,"DIV",{class:!0});var z=F(k);p(pe.$$.fragment,z),Ct=a(z),Ce=l(z,"P",{"data-svelte-h":!0}),c(Ce)!=="svelte-1pg4yhk"&&(Ce.innerHTML=uo),Ut=a(z),Ue=l(z,"P",{"data-svelte-h":!0}),c(Ue)!=="svelte-m6yqn7"&&(Ue.innerHTML=ho),zt=a(z),ze=l(z,"P",{"data-svelte-h":!0}),c(ze)!=="svelte-q5f6v7"&&(ze.innerHTML=fo),z.forEach(o),ut=a(e),p(ue.$$.fragment,e),ht=a(e),v=l(e,"DIV",{class:!0});var $=F(v);p(he.$$.fragment,$),Ft=a($),Fe=l($,"P",{"data-svelte-h":!0}),c(Fe)!=="svelte-2u6lvw"&&(Fe.innerHTML=go),Gt=a($),Ge=l($,"P",{"data-svelte-h":!0}),c(Ge)!=="svelte-hswkmf"&&(Ge.innerHTML=_o),Zt=a($),Ze=l($,"P",{"data-svelte-h":!0}),c(Ze)!=="svelte-8d8quo"&&(Ze.innerHTML=bo),Wt=a($),W=l($,"DIV",{class:!0});var Se=F(W);p(fe.$$.fragment,Se),Lt=a(Se),We=l(Se,"P",{"data-svelte-h":!0}),c(We)!=="svelte-oeoz5r"&&(We.innerHTML=yo),Bt=a(Se),p(R.$$.fragment,Se),Se.forEach(o),$.forEach(o),ft=a(e),p(ge.$$.fragment,e),gt=a(e),q=l(e,"DIV",{class:!0});var vt=F(q);p(_e.$$.fragment,vt),qt=a(vt),x=l(vt,"DIV",{class:!0});var E=F(x);p(be.$$.fragment,E),Nt=a(E),Le=l(E,"P",{"data-svelte-h":!0}),c(Le)!=="svelte-1g7fpxb"&&(Le.innerHTML=Mo),Ht=a(E),p(A.$$.fragment,E),Rt=a(E),p(S.$$.fragment,E),E.forEach(o),vt.forEach(o),_t=a(e),p(ye.$$.fragment,e),bt=a(e),y=l(e,"DIV",{class:!0});var J=F(y);p(Me.$$.fragment,J),At=a(J),Be=l(J,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-1qb1bfy"&&(Be.textContent=To),St=a(J),qe=l(J,"P",{"data-svelte-h":!0}),c(qe)!=="svelte-s1ed2o"&&(qe.innerHTML=vo),Xt=a(J),Ne=l(J,"P",{"data-svelte-h":!0}),c(Ne)!=="svelte-10ugs3m"&&(Ne.innerHTML=wo),Et=a(J),He=l(J,"P",{"data-svelte-h":!0}),c(He)!=="svelte-mhvelr"&&(He.innerHTML=Jo),Pt=a(J),Re=l(J,"P",{"data-svelte-h":!0}),c(Re)!=="svelte-hswkmf"&&(Re.innerHTML=ko),Vt=a(J),L=l(J,"DIV",{class:!0});var Xe=F(L);p(Te.$$.fragment,Xe),Yt=a(Xe),Ae=l(Xe,"P",{"data-svelte-h":!0}),c(Ae)!=="svelte-1pv4hnl"&&(Ae.innerHTML=Io),Dt=a(Xe),p(X.$$.fragment,Xe),Xe.forEach(o),J.forEach(o),yt=a(e),p(ve.$$.fragment,e),Mt=a(e),Ee=l(e,"P",{}),F(Ee).forEach(o),this.h()},h(){C(d,"name","hf:doc:metadata"),C(d,"content",No),jo(H.src,oo="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/jamba_architecture.png")||C(H,"src",oo),C(H,"alt","drawing"),C(H,"width","600"),C(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(y,"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){r(document.head,d),s(e,T,t),s(e,_,t),s(e,M,t),u(j,e,t),s(e,b,t),u(U,e,t),s(e,Pe,t),s(e,P,t),s(e,Ve,t),s(e,V,t),s(e,Ye,t),u(Y,e,t),s(e,De,t),s(e,D,t),s(e,Qe,t),s(e,Q,t),s(e,Oe,t),s(e,H,t),s(e,Ke,t),u(O,e,t),s(e,et,t),u(K,e,t),s(e,tt,t),s(e,ee,t),s(e,ot,t),u(te,e,t),s(e,nt,t),s(e,oe,t),s(e,at,t),u(ne,e,t),s(e,st,t),s(e,ae,t),s(e,rt,t),s(e,se,t),s(e,it,t),u(re,e,t),s(e,lt,t),u(ie,e,t),s(e,dt,t),s(e,w,t),r(w,ke),r(w,Jt),r(w,Ie),r(w,kt),u(le,w,null),r(w,It),r(w,$e),r(w,$t),u(de,w,null),s(e,ct,t),s(e,Z,t),r(Z,je),r(Z,jt),r(Z,xe),r(Z,xt),u(ce,Z,null),s(e,mt,t),u(me,e,t),s(e,pt,t),s(e,k,t),u(pe,k,null),r(k,Ct),r(k,Ce),r(k,Ut),r(k,Ue),r(k,zt),r(k,ze),s(e,ut,t),u(ue,e,t),s(e,ht,t),s(e,v,t),u(he,v,null),r(v,Ft),r(v,Fe),r(v,Gt),r(v,Ge),r(v,Zt),r(v,Ze),r(v,Wt),r(v,W),u(fe,W,null),r(W,Lt),r(W,We),r(W,Bt),u(R,W,null),s(e,ft,t),u(ge,e,t),s(e,gt,t),s(e,q,t),u(_e,q,null),r(q,qt),r(q,x),u(be,x,null),r(x,Nt),r(x,Le),r(x,Ht),u(A,x,null),r(x,Rt),u(S,x,null),s(e,_t,t),u(ye,e,t),s(e,bt,t),s(e,y,t),u(Me,y,null),r(y,At),r(y,Be),r(y,St),r(y,qe),r(y,Xt),r(y,Ne),r(y,Et),r(y,He),r(y,Pt),r(y,Re),r(y,Vt),r(y,L),u(Te,L,null),r(L,Yt),r(L,Ae),r(L,Dt),u(X,L,null),s(e,yt,t),u(ve,e,t),s(e,Mt,t),s(e,Ee,t),Tt=!0},p(e,[t]){const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),R.$set(I);const N={};t&2&&(N.$$scope={dirty:t,ctx:e}),A.$set(N);const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),S.$set(z);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),X.$set($)},i(e){Tt||(h(j.$$.fragment,e),h(U.$$.fragment,e),h(Y.$$.fragment,e),h(O.$$.fragment,e),h(K.$$.fragment,e),h(te.$$.fragment,e),h(ne.$$.fragment,e),h(re.$$.fragment,e),h(ie.$$.fragment,e),h(le.$$.fragment,e),h(de.$$.fragment,e),h(ce.$$.fragment,e),h(me.$$.fragment,e),h(pe.$$.fragment,e),h(ue.$$.fragment,e),h(he.$$.fragment,e),h(fe.$$.fragment,e),h(R.$$.fragment,e),h(ge.$$.fragment,e),h(_e.$$.fragment,e),h(be.$$.fragment,e),h(A.$$.fragment,e),h(S.$$.fragment,e),h(ye.$$.fragment,e),h(Me.$$.fragment,e),h(Te.$$.fragment,e),h(X.$$.fragment,e),h(ve.$$.fragment,e),Tt=!0)},o(e){f(j.$$.fragment,e),f(U.$$.fragment,e),f(Y.$$.fragment,e),f(O.$$.fragment,e),f(K.$$.fragment,e),f(te.$$.fragment,e),f(ne.$$.fragment,e),f(re.$$.fragment,e),f(ie.$$.fragment,e),f(le.$$.fragment,e),f(de.$$.fragment,e),f(ce.$$.fragment,e),f(me.$$.fragment,e),f(pe.$$.fragment,e),f(ue.$$.fragment,e),f(he.$$.fragment,e),f(fe.$$.fragment,e),f(R.$$.fragment,e),f(ge.$$.fragment,e),f(_e.$$.fragment,e),f(be.$$.fragment,e),f(A.$$.fragment,e),f(S.$$.fragment,e),f(ye.$$.fragment,e),f(Me.$$.fragment,e),f(Te.$$.fragment,e),f(X.$$.fragment,e),f(ve.$$.fragment,e),Tt=!1},d(e){e&&(o(T),o(_),o(M),o(b),o(Pe),o(P),o(Ve),o(V),o(Ye),o(De),o(D),o(Qe),o(Q),o(Oe),o(H),o(Ke),o(et),o(tt),o(ee),o(ot),o(nt),o(oe),o(at),o(st),o(ae),o(rt),o(se),o(it),o(lt),o(dt),o(w),o(ct),o(Z),o(mt),o(pt),o(k),o(ut),o(ht),o(v),o(ft),o(gt),o(q),o(_t),o(bt),o(y),o(yt),o(Mt),o(Ee)),o(d),g(j,e),g(U,e),g(Y,e),g(O,e),g(K,e),g(te,e),g(ne,e),g(re,e),g(ie,e),g(le),g(de),g(ce),g(me,e),g(pe),g(ue,e),g(he),g(fe),g(R),g(ge,e),g(_e),g(be),g(A),g(S),g(ye,e),g(Me),g(Te),g(X),g(ve,e)}}}const No='{"title":"Jamba","local":"jamba","sections":[{"title":"Overview","local":"overview","sections":[{"title":"Model Details","local":"model-details","sections":[],"depth":3}],"depth":2},{"title":"Usage","local":"usage","sections":[{"title":"Presequities","local":"presequities","sections":[],"depth":3},{"title":"Run the model","local":"run-the-model","sections":[],"depth":3}],"depth":2},{"title":"JambaConfig","local":"transformers.JambaConfig","sections":[],"depth":2},{"title":"JambaModel","local":"transformers.JambaModel","sections":[],"depth":2},{"title":"JambaForCausalLM","local":"transformers.JambaForCausalLM","sections":[],"depth":2},{"title":"JambaForSequenceClassification","local":"transformers.JambaForSequenceClassification","sections":[],"depth":2}],"depth":1}';function Ho(G){return xo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yo extends Co{constructor(d){super(),Uo(this,d,Ho,qo,$o,{})}}export{Yo as component};
