import{s as $o,f as Uo,o as zo,n as vt}from"../chunks/scheduler.25b97de1.js";import{S as Go,i as Fo,g as i,s as n,r as p,A as Zo,h as l,f as o,c as a,j as G,u,x as c,k as $,y as r,a as s,v as h,d as f,t as _,w as g}from"../chunks/index.d9030fc9.js";import{T as Qt}from"../chunks/Tip.baa67368.js";import{D as we}from"../chunks/Docstring.e257edda.js";import{C as Je}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Wo}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as ve,E as Lo}from"../chunks/EditOnGithub.91d95064.js";function Bo(F){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(m){d=l(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=T)},m(m,M){s(m,d,M)},p:vt,d(m){m&&o(d)}}}function qo(F){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(m){d=l(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=T)},m(m,M){s(m,d,M)},p:vt,d(m){m&&o(d)}}}function No(F){let d,T="Example:",m,M,C;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,m=n(),p(M.$$.fragment)},l(b){d=l(b,"P",{"data-svelte-h":!0}),c(d)!=="svelte-11lpom8"&&(d.textContent=T),m=a(b),u(M.$$.fragment,b)},m(b,U){s(b,d,U),s(b,m,U),h(M,b,U),C=!0},p:vt,i(b){C||(f(M.$$.fragment,b),C=!0)},o(b){_(M.$$.fragment,b),C=!1},d(b){b&&(o(d),o(m)),g(M,b)}}}function Ho(F){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(m){d=l(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=T)},m(m,M){s(m,d,M)},p:vt,d(m){m&&o(d)}}}function Ro(F){let d,T,m,M,C,b,U,Ee,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,E,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,V,De,Y,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,D,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,N,oo,Ke,Q,et,O,tt,K,no="Jamba requires you use <code>transformers</code> version 4.39.0 or higher:",ot,ee,nt,te,ao="In order to run optimized Mamba implementations, you first need to install <code>mamba-ssm</code> and <code>causal-conv1d</code>:",at,oe,st,ne,so="You also have to have the model on a CUDA device.",rt,ae,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,se,lt,re,dt,v,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,ie,It,xe,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>:',xt,le,ct,Z,Ce,mo="<strong>Load the model in 8-bit</strong>",Ct,je,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:',jt,de,mt,ce,pt,k,me,$t,$e,uo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30799/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/pr_30799/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/pr_30799/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,ut,pe,_o="## JambaModel[[transformers.JambaModel]]",ht,w,ue,Gt,Ge,go=`The bare Jamba Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/pr_30799/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.)`,Ft,Fe,bo=`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,yo="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>JambaDecoderLayer</code>",Wt,W,he,Lt,We,Mo='The <a href="/docs/transformers/pr_30799/en/model_doc/jamba#transformers.JambaModel">JambaModel</a> forward method, overrides the <code>__call__</code> special method.',Bt,H,ft,fe,To="## JambaForCausalLM[[transformers.JambaForCausalLM]]",_t,B,_e,qt,j,ge,Nt,Le,wo='The <a href="/docs/transformers/pr_30799/en/model_doc/jamba#transformers.JambaForCausalLM">JambaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Ht,R,Rt,A,gt,be,vo="## JambaForSequenceClassification[[transformers.JambaForSequenceClassification]]",bt,y,ye,At,Be,Jo="The Jamba Model with a sequence classification head on top (linear layer).",St,qe,ko=`<a href="/docs/transformers/pr_30799/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,Io=`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).`,Pt,He,xo=`This model inherits from <a href="/docs/transformers/pr_30799/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.)`,Et,Re,Co=`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,Me,Yt,Ae,jo='The <a href="/docs/transformers/pr_30799/en/model_doc/jamba#transformers.JambaForSequenceClassification">JambaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',Dt,S,yt,Te,Mt,Pe,Tt;return C=new ve({props:{title:"Jamba",local:"jamba",headingTag:"h1"}}),U=new ve({props:{title:"Overview",local:"overview",headingTag:"h2"}}),V=new ve({props:{title:"Model Details",local:"model-details",headingTag:"h3"}}),Q=new ve({props:{title:"Usage",local:"usage",headingTag:"h2"}}),O=new ve({props:{title:"Presequities",local:"presequities",headingTag:"h3"}}),ee=new Je({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUzRSUzRDQuMzkuMA==",highlighted:"pip install transformers&gt;=4.39.0",wrap:!1}}),oe=new Je({props:{code:"cGlwJTIwaW5zdGFsbCUyMG1hbWJhLXNzbSUyMGNhdXNhbC1jb252MWQlM0UlM0QxLjIuMA==",highlighted:"pip install mamba-ssm causal-conv1d&gt;=1.2.0",wrap:!1}}),se=new ve({props:{title:"Run the model",local:"run-the-model",headingTag:"h3"}}),re=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}}),ie=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}}),le=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}}),de=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}}),ce=new ve({props:{title:"JambaConfig",local:"transformers.JambaConfig",headingTag:"h2"}}),me=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/pr_30799/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 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 [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to </code>8\`.`,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/vr_30799/src/transformers/models/jamba/configuration_jamba.py#L26"}}),ue=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/pr_30799/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/pr_30799/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/vr_30799/src/transformers/models/jamba/modeling_jamba.py#L1356"}}),he=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/pr_30799/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30799/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30799/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/pr_30799/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30799/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30799/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/pr_30799/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/vr_30799/src/transformers/models/jamba/modeling_jamba.py#L1394"}}),H=new Qt({props:{$$slots:{default:[Bo]},$$scope:{ctx:F}}}),_e=new we({props:{name:"class transformers.JambaForCausalLM",anchor:"transformers.JambaForCausalLM",parameters:[{name:"config",val:": JambaConfig"}],source:"https://github.com/huggingface/transformers/blob/vr_30799/src/transformers/models/jamba/modeling_jamba.py#L1554"}}),ge=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/pr_30799/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30799/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30799/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/pr_30799/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30799/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30799/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/pr_30799/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/vr_30799/src/transformers/models/jamba/modeling_jamba.py#L1586",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/pr_30799/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>
`}}),R=new Qt({props:{$$slots:{default:[qo]},$$scope:{ctx:F}}}),A=new Wo({props:{anchor:"transformers.JambaForCausalLM.forward.example",$$slots:{default:[No]},$$scope:{ctx:F}}}),ye=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/pr_30799/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/pr_30799/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/vr_30799/src/transformers/models/jamba/modeling_jamba.py#L1776"}}),Me=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/pr_30799/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30799/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30799/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/pr_30799/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30799/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30799/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/pr_30799/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/vr_30799/src/transformers/models/jamba/modeling_jamba.py#L1808"}}),S=new Qt({props:{$$slots:{default:[Ho]},$$scope:{ctx:F}}}),Te=new Lo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/jamba.md"}}),{c(){d=i("meta"),T=n(),m=i("p"),M=n(),p(C.$$.fragment),b=n(),p(U.$$.fragment),Ee=n(),P=i("p"),P.textContent=Ot,Ve=n(),E=i("p"),E.innerHTML=Kt,Ye=n(),p(V.$$.fragment),De=n(),Y=i("p"),Y.textContent=eo,Qe=n(),D=i("p"),D.textContent=to,Oe=n(),N=i("img"),Ke=n(),p(Q.$$.fragment),et=n(),p(O.$$.fragment),tt=n(),K=i("p"),K.innerHTML=no,ot=n(),p(ee.$$.fragment),nt=n(),te=i("p"),te.innerHTML=ao,at=n(),p(oe.$$.fragment),st=n(),ne=i("p"),ne.textContent=so,rt=n(),ae=i("p"),ae.innerHTML=ro,it=n(),p(se.$$.fragment),lt=n(),p(re.$$.fragment),dt=n(),v=i("details"),ke=i("summary"),ke.innerHTML=io,Jt=n(),Ie=i("p"),Ie.innerHTML=lo,kt=n(),p(ie.$$.fragment),It=n(),xe=i("p"),xe.innerHTML=co,xt=n(),p(le.$$.fragment),ct=n(),Z=i("details"),Ce=i("summary"),Ce.innerHTML=mo,Ct=n(),je=i("p"),je.innerHTML=po,jt=n(),p(de.$$.fragment),mt=n(),p(ce.$$.fragment),pt=n(),k=i("div"),p(me.$$.fragment),$t=n(),$e=i("p"),$e.innerHTML=uo,Ut=n(),Ue=i("p"),Ue.innerHTML=ho,zt=n(),ze=i("p"),ze.innerHTML=fo,ut=n(),pe=i("p"),pe.textContent=_o,ht=n(),w=i("div"),p(ue.$$.fragment),Gt=n(),Ge=i("p"),Ge.innerHTML=go,Ft=n(),Fe=i("p"),Fe.innerHTML=bo,Zt=n(),Ze=i("p"),Ze.innerHTML=yo,Wt=n(),W=i("div"),p(he.$$.fragment),Lt=n(),We=i("p"),We.innerHTML=Mo,Bt=n(),p(H.$$.fragment),ft=n(),fe=i("p"),fe.textContent=To,_t=n(),B=i("div"),p(_e.$$.fragment),qt=n(),j=i("div"),p(ge.$$.fragment),Nt=n(),Le=i("p"),Le.innerHTML=wo,Ht=n(),p(R.$$.fragment),Rt=n(),p(A.$$.fragment),gt=n(),be=i("p"),be.textContent=vo,bt=n(),y=i("div"),p(ye.$$.fragment),At=n(),Be=i("p"),Be.textContent=Jo,St=n(),qe=i("p"),qe.innerHTML=ko,Xt=n(),Ne=i("p"),Ne.innerHTML=Io,Pt=n(),He=i("p"),He.innerHTML=xo,Et=n(),Re=i("p"),Re.innerHTML=Co,Vt=n(),L=i("div"),p(Me.$$.fragment),Yt=n(),Ae=i("p"),Ae.innerHTML=jo,Dt=n(),p(S.$$.fragment),yt=n(),p(Te.$$.fragment),Mt=n(),Pe=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),m=l(e,"P",{}),G(m).forEach(o),M=a(e),u(C.$$.fragment,e),b=a(e),u(U.$$.fragment,e),Ee=a(e),P=l(e,"P",{"data-svelte-h":!0}),c(P)!=="svelte-1frdu2s"&&(P.textContent=Ot),Ve=a(e),E=l(e,"P",{"data-svelte-h":!0}),c(E)!=="svelte-11hqo7x"&&(E.innerHTML=Kt),Ye=a(e),u(V.$$.fragment,e),De=a(e),Y=l(e,"P",{"data-svelte-h":!0}),c(Y)!=="svelte-57h5jx"&&(Y.textContent=eo),Qe=a(e),D=l(e,"P",{"data-svelte-h":!0}),c(D)!=="svelte-ed1xn5"&&(D.textContent=to),Oe=a(e),N=l(e,"IMG",{src:!0,alt:!0,width:!0}),Ke=a(e),u(Q.$$.fragment,e),et=a(e),u(O.$$.fragment,e),tt=a(e),K=l(e,"P",{"data-svelte-h":!0}),c(K)!=="svelte-q1z7cw"&&(K.innerHTML=no),ot=a(e),u(ee.$$.fragment,e),nt=a(e),te=l(e,"P",{"data-svelte-h":!0}),c(te)!=="svelte-1ruzjzk"&&(te.innerHTML=ao),at=a(e),u(oe.$$.fragment,e),st=a(e),ne=l(e,"P",{"data-svelte-h":!0}),c(ne)!=="svelte-1kmjqje"&&(ne.textContent=so),rt=a(e),ae=l(e,"P",{"data-svelte-h":!0}),c(ae)!=="svelte-syhw7e"&&(ae.innerHTML=ro),it=a(e),u(se.$$.fragment,e),lt=a(e),u(re.$$.fragment,e),dt=a(e),v=l(e,"DETAILS",{});var I=G(v);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),u(ie.$$.fragment,I),It=a(I),xe=l(I,"P",{"data-svelte-h":!0}),c(xe)!=="svelte-elnbbj"&&(xe.innerHTML=co),xt=a(I),u(le.$$.fragment,I),I.forEach(o),ct=a(e),Z=l(e,"DETAILS",{});var q=G(Z);Ce=l(q,"SUMMARY",{"data-svelte-h":!0}),c(Ce)!=="svelte-rm52wm"&&(Ce.innerHTML=mo),Ct=a(q),je=l(q,"P",{"data-svelte-h":!0}),c(je)!=="svelte-z0koyh"&&(je.innerHTML=po),jt=a(q),u(de.$$.fragment,q),q.forEach(o),mt=a(e),u(ce.$$.fragment,e),pt=a(e),k=l(e,"DIV",{class:!0});var z=G(k);u(me.$$.fragment,z),$t=a(z),$e=l(z,"P",{"data-svelte-h":!0}),c($e)!=="svelte-mwat9h"&&($e.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-13enpff"&&(ze.innerHTML=fo),z.forEach(o),ut=a(e),pe=l(e,"P",{"data-svelte-h":!0}),c(pe)!=="svelte-15i58j4"&&(pe.textContent=_o),ht=a(e),w=l(e,"DIV",{class:!0});var x=G(w);u(ue.$$.fragment,x),Gt=a(x),Ge=l(x,"P",{"data-svelte-h":!0}),c(Ge)!=="svelte-1k3z7br"&&(Ge.innerHTML=go),Ft=a(x),Fe=l(x,"P",{"data-svelte-h":!0}),c(Fe)!=="svelte-1ydu1el"&&(Fe.innerHTML=bo),Zt=a(x),Ze=l(x,"P",{"data-svelte-h":!0}),c(Ze)!=="svelte-8d8quo"&&(Ze.innerHTML=yo),Wt=a(x),W=l(x,"DIV",{class:!0});var Se=G(W);u(he.$$.fragment,Se),Lt=a(Se),We=l(Se,"P",{"data-svelte-h":!0}),c(We)!=="svelte-neg15i"&&(We.innerHTML=Mo),Bt=a(Se),u(H.$$.fragment,Se),Se.forEach(o),x.forEach(o),ft=a(e),fe=l(e,"P",{"data-svelte-h":!0}),c(fe)!=="svelte-1c8t2pk"&&(fe.textContent=To),_t=a(e),B=l(e,"DIV",{class:!0});var wt=G(B);u(_e.$$.fragment,wt),qt=a(wt),j=l(wt,"DIV",{class:!0});var X=G(j);u(ge.$$.fragment,X),Nt=a(X),Le=l(X,"P",{"data-svelte-h":!0}),c(Le)!=="svelte-bqkvdi"&&(Le.innerHTML=wo),Ht=a(X),u(R.$$.fragment,X),Rt=a(X),u(A.$$.fragment,X),X.forEach(o),wt.forEach(o),gt=a(e),be=l(e,"P",{"data-svelte-h":!0}),c(be)!=="svelte-1l4nho2"&&(be.textContent=vo),bt=a(e),y=l(e,"DIV",{class:!0});var J=G(y);u(ye.$$.fragment,J),At=a(J),Be=l(J,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-1qb1bfy"&&(Be.textContent=Jo),St=a(J),qe=l(J,"P",{"data-svelte-h":!0}),c(qe)!=="svelte-wzcbpp"&&(qe.innerHTML=ko),Xt=a(J),Ne=l(J,"P",{"data-svelte-h":!0}),c(Ne)!=="svelte-10ugs3m"&&(Ne.innerHTML=Io),Pt=a(J),He=l(J,"P",{"data-svelte-h":!0}),c(He)!=="svelte-19hey8c"&&(He.innerHTML=xo),Et=a(J),Re=l(J,"P",{"data-svelte-h":!0}),c(Re)!=="svelte-1ydu1el"&&(Re.innerHTML=Co),Vt=a(J),L=l(J,"DIV",{class:!0});var Xe=G(L);u(Me.$$.fragment,Xe),Yt=a(Xe),Ae=l(Xe,"P",{"data-svelte-h":!0}),c(Ae)!=="svelte-dzzfwc"&&(Ae.innerHTML=jo),Dt=a(Xe),u(S.$$.fragment,Xe),Xe.forEach(o),J.forEach(o),yt=a(e),u(Te.$$.fragment,e),Mt=a(e),Pe=l(e,"P",{}),G(Pe).forEach(o),this.h()},h(){$(d,"name","hf:doc:metadata"),$(d,"content",Ao),Uo(N.src,oo="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/jamba_architecture.png")||$(N,"src",oo),$(N,"alt","drawing"),$(N,"width","600"),$(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(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,m,t),s(e,M,t),h(C,e,t),s(e,b,t),h(U,e,t),s(e,Ee,t),s(e,P,t),s(e,Ve,t),s(e,E,t),s(e,Ye,t),h(V,e,t),s(e,De,t),s(e,Y,t),s(e,Qe,t),s(e,D,t),s(e,Oe,t),s(e,N,t),s(e,Ke,t),h(Q,e,t),s(e,et,t),h(O,e,t),s(e,tt,t),s(e,K,t),s(e,ot,t),h(ee,e,t),s(e,nt,t),s(e,te,t),s(e,at,t),h(oe,e,t),s(e,st,t),s(e,ne,t),s(e,rt,t),s(e,ae,t),s(e,it,t),h(se,e,t),s(e,lt,t),h(re,e,t),s(e,dt,t),s(e,v,t),r(v,ke),r(v,Jt),r(v,Ie),r(v,kt),h(ie,v,null),r(v,It),r(v,xe),r(v,xt),h(le,v,null),s(e,ct,t),s(e,Z,t),r(Z,Ce),r(Z,Ct),r(Z,je),r(Z,jt),h(de,Z,null),s(e,mt,t),h(ce,e,t),s(e,pt,t),s(e,k,t),h(me,k,null),r(k,$t),r(k,$e),r(k,Ut),r(k,Ue),r(k,zt),r(k,ze),s(e,ut,t),s(e,pe,t),s(e,ht,t),s(e,w,t),h(ue,w,null),r(w,Gt),r(w,Ge),r(w,Ft),r(w,Fe),r(w,Zt),r(w,Ze),r(w,Wt),r(w,W),h(he,W,null),r(W,Lt),r(W,We),r(W,Bt),h(H,W,null),s(e,ft,t),s(e,fe,t),s(e,_t,t),s(e,B,t),h(_e,B,null),r(B,qt),r(B,j),h(ge,j,null),r(j,Nt),r(j,Le),r(j,Ht),h(R,j,null),r(j,Rt),h(A,j,null),s(e,gt,t),s(e,be,t),s(e,bt,t),s(e,y,t),h(ye,y,null),r(y,At),r(y,Be),r(y,St),r(y,qe),r(y,Xt),r(y,Ne),r(y,Pt),r(y,He),r(y,Et),r(y,Re),r(y,Vt),r(y,L),h(Me,L,null),r(L,Yt),r(L,Ae),r(L,Dt),h(S,L,null),s(e,yt,t),h(Te,e,t),s(e,Mt,t),s(e,Pe,t),Tt=!0},p(e,[t]){const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),H.$set(I);const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),R.$set(q);const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),A.$set(z);const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),S.$set(x)},i(e){Tt||(f(C.$$.fragment,e),f(U.$$.fragment,e),f(V.$$.fragment,e),f(Q.$$.fragment,e),f(O.$$.fragment,e),f(ee.$$.fragment,e),f(oe.$$.fragment,e),f(se.$$.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(ue.$$.fragment,e),f(he.$$.fragment,e),f(H.$$.fragment,e),f(_e.$$.fragment,e),f(ge.$$.fragment,e),f(R.$$.fragment,e),f(A.$$.fragment,e),f(ye.$$.fragment,e),f(Me.$$.fragment,e),f(S.$$.fragment,e),f(Te.$$.fragment,e),Tt=!0)},o(e){_(C.$$.fragment,e),_(U.$$.fragment,e),_(V.$$.fragment,e),_(Q.$$.fragment,e),_(O.$$.fragment,e),_(ee.$$.fragment,e),_(oe.$$.fragment,e),_(se.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(le.$$.fragment,e),_(de.$$.fragment,e),_(ce.$$.fragment,e),_(me.$$.fragment,e),_(ue.$$.fragment,e),_(he.$$.fragment,e),_(H.$$.fragment,e),_(_e.$$.fragment,e),_(ge.$$.fragment,e),_(R.$$.fragment,e),_(A.$$.fragment,e),_(ye.$$.fragment,e),_(Me.$$.fragment,e),_(S.$$.fragment,e),_(Te.$$.fragment,e),Tt=!1},d(e){e&&(o(T),o(m),o(M),o(b),o(Ee),o(P),o(Ve),o(E),o(Ye),o(De),o(Y),o(Qe),o(D),o(Oe),o(N),o(Ke),o(et),o(tt),o(K),o(ot),o(nt),o(te),o(at),o(st),o(ne),o(rt),o(ae),o(it),o(lt),o(dt),o(v),o(ct),o(Z),o(mt),o(pt),o(k),o(ut),o(pe),o(ht),o(w),o(ft),o(fe),o(_t),o(B),o(gt),o(be),o(bt),o(y),o(yt),o(Mt),o(Pe)),o(d),g(C,e),g(U,e),g(V,e),g(Q,e),g(O,e),g(ee,e),g(oe,e),g(se,e),g(re,e),g(ie),g(le),g(de),g(ce,e),g(me),g(ue),g(he),g(H),g(_e),g(ge),g(R),g(A),g(ye),g(Me),g(S),g(Te,e)}}}const Ao='{"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}],"depth":1}';function So(F){return zo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Oo extends Go{constructor(d){super(),Fo(this,d,So,Ro,$o,{})}}export{Oo as component};
