import{s as Ba,o as Va,n as S}from"../chunks/scheduler.25b97de1.js";import{S as Da,i as Oa,g as d,s as n,r as f,A as Ra,h as l,f as s,c as a,j as $,u as _,x as m,k as w,y as o,a as c,v as g,d as b,t as k,w as v}from"../chunks/index.d9030fc9.js";import{T as Te}from"../chunks/Tip.baa67368.js";import{D as M}from"../chunks/Docstring.e257edda.js";import{C as to}from"../chunks/CodeBlock.e6cd0d95.js";import{E as eo}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as An,E as Xa}from"../chunks/EditOnGithub.91d95064.js";function Qa(y){let t,h;return t=new to({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdlbW1hTW9kZWwlMkMlMjBHZW1tYUNvbmZpZyUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBHZW1tYSUyMGdlbW1hLTdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEdlbW1hQ29uZmlnKCklMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwZ2VtbWEtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEdlbW1hTW9kZWwoY29uZmlndXJhdGlvbiklMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GemmaModel, GemmaConfig
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Gemma gemma-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GemmaConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the gemma-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GemmaModel(configuration)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){f(t.$$.fragment)},l(r){_(t.$$.fragment,r)},m(r,u){g(t,r,u),h=!0},p:S,i(r){h||(b(t.$$.fragment,r),h=!0)},o(r){k(t.$$.fragment,r),h=!1},d(r){v(t,r)}}}function Ya(y){let t,h="sequence pair mask has the following format:",r,u,T;return u=new to({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`,wrap:!1}}),{c(){t=d("p"),t.textContent=h,r=n(),f(u.$$.fragment)},l(p){t=l(p,"P",{"data-svelte-h":!0}),m(t)!=="svelte-16klr56"&&(t.textContent=h),r=a(p),_(u.$$.fragment,p)},m(p,x){c(p,t,x),c(p,r,x),g(u,p,x),T=!0},p:S,i(p){T||(b(u.$$.fragment,p),T=!0)},o(p){k(u.$$.fragment,p),T=!1},d(p){p&&(s(t),s(r)),v(u,p)}}}function Ka(y){let t,h;return t=new to({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdlbW1hVG9rZW5pemVyRmFzdCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEdlbW1hVG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmR1bW15LWdlbW1hJTIyKSUwQXRva2VuaXplci5lbmNvZGUoJTIySGVsbG8lMjB0aGlzJTIwaXMlMjBhJTIwdGVzdCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GemmaTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = GemmaTokenizerFast.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/dummy-gemma&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.encode(<span class="hljs-string">&quot;Hello this is a test&quot;</span>)
[<span class="hljs-number">2</span>, <span class="hljs-number">4521</span>, <span class="hljs-number">736</span>, <span class="hljs-number">603</span>, <span class="hljs-number">476</span>, <span class="hljs-number">2121</span>]`,wrap:!1}}),{c(){f(t.$$.fragment)},l(r){_(t.$$.fragment,r)},m(r,u){g(t,r,u),h=!0},p:S,i(r){h||(b(t.$$.fragment,r),h=!0)},o(r){k(t.$$.fragment,r),h=!1},d(r){v(t,r)}}}function es(y){let t,h=`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(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function ts(y){let t,h=`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(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function os(y){let t,h="Example:",r,u,T;return u=new to({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHZW1tYUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBHZW1tYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZnZW1tYS03YiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZnZW1tYS03YiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJXaGF0JTIwaXMlMjB5b3VyJTIwZmF2b3JpdGUlMjBjb25kaW1lbnQlM0YlMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbGVuZ3RoJTNEMzApJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GemmaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GemmaForCausalLM.from_pretrained(<span class="hljs-string">&quot;google/gemma-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/gemma-7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;What is your favorite condiment?&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;What is your favorite condiment?&quot;</span>`,wrap:!1}}),{c(){t=d("p"),t.textContent=h,r=n(),f(u.$$.fragment)},l(p){t=l(p,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(p),_(u.$$.fragment,p)},m(p,x){c(p,t,x),c(p,r,x),g(u,p,x),T=!0},p:S,i(p){T||(b(u.$$.fragment,p),T=!0)},o(p){k(u.$$.fragment,p),T=!1},d(p){p&&(s(t),s(r)),v(u,p)}}}function ns(y){let t,h=`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(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function as(y){let t,h=`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(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function ss(y){let t,h=`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(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function rs(y){let t,h=`This example uses a random model as the real ones are all very big. To get proper results, you should use
openlm-research/open_llama_3b_v2 instead of google/gemma-2b. If you get out-of-memory when loading that checkpoint, you can try
adding <code>device_map=&quot;auto&quot;</code> in the <code>from_pretrained</code> call.`;return{c(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-i4y11c"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function is(y){let t,h="Example:",r,u,T;return u=new to({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4R2VtbWFNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmdlbW1hLTJiJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEdlbW1hTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmdlbW1hLTJiJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxGemmaModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/gemma-2b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxGemmaModel.from_pretrained(<span class="hljs-string">&quot;google/gemma-2b&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){t=d("p"),t.textContent=h,r=n(),f(u.$$.fragment)},l(p){t=l(p,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(p),_(u.$$.fragment,p)},m(p,x){c(p,t,x),c(p,r,x),g(u,p,x),T=!0},p:S,i(p){T||(b(u.$$.fragment,p),T=!0)},o(p){k(u.$$.fragment,p),T=!1},d(p){p&&(s(t),s(r)),v(u,p)}}}function ds(y){let t,h=`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(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function ls(y){let t,h=`This example uses a random model as the real ones are all very big. To get proper results, you should use
openlm-research/open_llama_3b_v2 instead of google/gemma-2b. If you get out-of-memory when loading that checkpoint, you can try
adding <code>device_map=&quot;auto&quot;</code> in the <code>from_pretrained</code> call.`;return{c(){t=d("p"),t.innerHTML=h},l(r){t=l(r,"P",{"data-svelte-h":!0}),m(t)!=="svelte-i4y11c"&&(t.innerHTML=h)},m(r,u){c(r,t,u)},p:S,d(r){r&&s(t)}}}function cs(y){let t,h="Example:",r,u,T;return u=new to({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4R2VtbWFGb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmdlbW1hLTJiJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheEdlbW1hRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmdlbW1hLTJiJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwcmV0cmlldmUlMjBsb2d0cyUyMGZvciUyMG5leHQlMjB0b2tlbiUwQW5leHRfdG9rZW5fbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlNUIlM0ElMkMlMjAtMSU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxGemmaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/gemma-2b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxGemmaForCausalLM.from_pretrained(<span class="hljs-string">&quot;google/gemma-2b&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`,wrap:!1}}),{c(){t=d("p"),t.textContent=h,r=n(),f(u.$$.fragment)},l(p){t=l(p,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=h),r=a(p),_(u.$$.fragment,p)},m(p,x){c(p,t,x),c(p,r,x),g(u,p,x),T=!0},p:S,i(p){T||(b(u.$$.fragment,p),T=!0)},o(p){k(u.$$.fragment,p),T=!1},d(p){p&&(s(t),s(r)),v(u,p)}}}function ms(y){let t,h,r,u,T,p,x,no,xe,Bn=`The Gemma model was proposed in <a href="https://blog.google/technology/developers/gemma-open-models/" rel="nofollow">Gemma: Open Models Based on Gemini Technology and Research</a> by Gemma Team, Google.
Gemma models are trained on 6T tokens, and released with 2 versions, 2b and 7b.`,ao,$e,Vn="The abstract from the paper is the following:",so,we,Dn="<em>This work introduces Gemma, a new family of open language models demonstrating strong performance across academic benchmarks for language understanding, reasoning, and safety. We release two sizes of models (2 billion and 7 billion parameters), and provide both pretrained and fine-tuned checkpoints. Gemma outperforms similarly sized open models on 11 out of 18 text-based tasks, and we present comprehensive evaluations of safety and responsibility aspects of the models, alongside a detailed description of our model development. We believe the responsible release of LLMs is critical for improving the safety of frontier models, and for enabling the next wave of LLM innovations</em>",ro,Me,On="Tips:",io,ze,Rn="<li>The original checkpoints can be converted using the conversion script <code>src/transformers/models/gemma/convert_gemma_weights_to_hf.py</code></li>",lo,Ce,Xn='This model was contributed by <a href="https://huggingface.co/ArthurZ" rel="nofollow">Arthur Zucker</a>, <a href="https://huggingface.co/ybelkada" rel="nofollow">Younes Belkada</a>, <a href="https://huggingface.co/sanchit-gandhi" rel="nofollow">Sanchit Gandhi</a>, <a href="https://huggingface.co/pcuenq" rel="nofollow">Pedro Cuenca</a>.',co,Ge,mo,B,Fe,qo,pt,Qn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaModel">GemmaModel</a>. It is used to instantiate an Gemma
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 Gemma-7B.
e.g. <a href="https://huggingface.co/google/gemma-7b" rel="nofollow">google/gemma-7b</a>
Configuration objects inherit from <a href="/docs/transformers/pr_31172/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_31172/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Lo,ne,po,qe,Yn="## GemmaTokenizer[[transformers.GemmaTokenizer]]",uo,z,Le,Po,ut,Kn=`Construct a Gemma tokenizer. Based on byte-level Byte-Pair-Encoding. The default padding token is unset as there is
no padding token in the original model.`,jo,ae,Pe,Io,ht,ea="Converts a sequence of tokens (string) in a single string.",Wo,E,je,Uo,ft,ta="Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT",Ho,se,Jo,_t,oa="if token_ids_1 is None, only returns the first portion of the mask (0s).",No,re,Ie,So,gt,na=`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer <code>prepare_for_model</code> method.`,Zo,ie,We,Eo,bt,aa="Returns vocab as a dict",Ao,de,Ue,Bo,kt,sa="Save the vocabulary and special tokens file to a directory.",ho,He,ra="## GemmaTokenizerFast[[transformers.GemmaTokenizerFast]]",fo,C,Je,Vo,vt,ia="Construct a Gemma tokenizer fast. Based on byte-level Byte-Pair-Encoding.",Do,yt,da="This uses notably ByteFallback and no prefix space. Normalization is applied to replace  <code>&quot; &quot;</code> with <code>&quot;▁&quot;</code>",Oo,le,Ro,Tt,la=`If you want to change the <code>bos_token</code> or the <code>eos_token</code>, make sure to specify them when initializing the model, or
call <code>tokenizer.update_post_processor()</code> to make sure that the post-processing is correctly done (otherwise the
values of the first token and final token of an encoded sequence will not be correct). For more details, checkout
[post-processors] (<a href="https://huggingface.co/docs/tokenizers/api/post-processors" rel="nofollow">https://huggingface.co/docs/tokenizers/api/post-processors</a>) documentation.`,Xo,xt,ca=`This tokenizer inherits from <a href="/docs/transformers/pr_31172/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Qo,ce,Ne,Yo,$t,ma="Updates the underlying post processor with the current <code>bos_token</code> and <code>eos_token</code>.",_o,Se,pa="## GemmaModel[[transformers.GemmaModel]]",go,I,Ze,Ko,wt,ua=`The bare Gemma Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/pr_31172/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.)`,en,Mt,ha=`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.`,tn,zt,fa="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>GemmaDecoderLayer</code>",on,O,Ee,nn,Ct,_a='The <a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaModel">GemmaModel</a> forward method, overrides the <code>__call__</code> special method.',an,me,bo,Ae,ga="## GemmaForCausalLM[[transformers.GemmaForCausalLM]]",ko,ee,Be,sn,A,Ve,rn,Gt,ba='The <a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaForCausalLM">GemmaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',dn,pe,ln,ue,vo,De,ka="## GemmaForSequenceClassification[[transformers.GemmaForSequenceClassification]]",yo,G,Oe,cn,Ft,va="The Gemma Model transformer with a sequence classification head on top (linear layer).",mn,qt,ya=`<a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaForSequenceClassification">GemmaForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,pn,Lt,Ta=`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).`,un,Pt,xa=`This model inherits from <a href="/docs/transformers/pr_31172/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.)`,hn,jt,$a=`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.`,fn,R,Re,_n,It,wa='The <a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaForSequenceClassification">GemmaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',gn,he,To,Xe,Ma="## GemmaForTokenClassification[[transformers.GemmaForTokenClassification]]",xo,W,Qe,bn,Wt,za=`The Gemma Model transformer with a token classification head on top (a linear layer on top of the hidden-states
output) e.g. for Named-Entity-Recognition (NER) tasks.`,kn,Ut,Ca=`This model inherits from <a href="/docs/transformers/pr_31172/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.)`,vn,Ht,Ga=`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.`,yn,X,Ye,Tn,Jt,Fa='The <a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaForTokenClassification">GemmaForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',xn,fe,$o,Ke,qa="## FlaxGemmaModel[[transformers.FlaxGemmaModel]]",wo,F,et,$n,Nt,La="The bare Gemma Model transformer outputting raw hidden-states without any specific head on top.",wn,St,Pa=`This model inherits from <a href="/docs/transformers/pr_31172/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</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.)`,Mn,Zt,ja=`This model is also a Flax Linen
<a href="https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html" rel="nofollow">flax.nn.Module</a> subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`,zn,Et,Ia="Finally, this model supports inherent JAX features such as:",Cn,At,Wa='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',Gn,U,tt,Fn,Bt,Ua="The <code>FlaxGemmaPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",qn,_e,Ln,ge,Pn,be,Mo,ot,Ha="## FlaxGemmaForCausalLM[[transformers.FlaxGemmaForCausalLM]]",zo,q,nt,jn,Vt,Ja="The Gemma Model transformer with a language modeling head (linear layer) on top.",In,Dt,Na=`This model inherits from <a href="/docs/transformers/pr_31172/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</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.)`,Wn,Ot,Sa=`This model is also a Flax Linen
<a href="https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html" rel="nofollow">flax.nn.Module</a> subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`,Un,Rt,Za="Finally, this model supports inherent JAX features such as:",Hn,Xt,Ea='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',Jn,H,at,Nn,Qt,Aa="The <code>FlaxGemmaPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Sn,ke,Zn,ve,En,ye,Co,st,Go,oo,Fo;return T=new An({props:{title:"Gemma",local:"gemma",headingTag:"h1"}}),x=new An({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Ge=new An({props:{title:"GemmaConfig",local:"transformers.GemmaConfig",headingTag:"h2"}}),Fe=new M({props:{name:"class transformers.GemmaConfig",anchor:"transformers.GemmaConfig",parameters:[{name:"vocab_size",val:" = 256000"},{name:"hidden_size",val:" = 3072"},{name:"intermediate_size",val:" = 24576"},{name:"num_hidden_layers",val:" = 28"},{name:"num_attention_heads",val:" = 16"},{name:"num_key_value_heads",val:" = 16"},{name:"head_dim",val:" = 256"},{name:"hidden_act",val:" = 'gelu_pytorch_tanh'"},{name:"hidden_activation",val:" = None"},{name:"max_position_embeddings",val:" = 8192"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"eos_token_id",val:" = 1"},{name:"bos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = True"},{name:"rope_theta",val:" = 10000.0"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GemmaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256000) &#x2014;
Vocabulary size of the Gemma 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_31172/en/model_doc/gemma#transformers.GemmaModel">GemmaModel</a>`,name:"vocab_size"},{anchor:"transformers.GemmaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.GemmaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 24576) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.GemmaConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 28) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.GemmaConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.GemmaConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#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>num_attention_heads\`.`,name:"num_key_value_heads"},{anchor:"transformers.GemmaConfig.head_dim",description:`<strong>head_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The attention head dimension.`,name:"head_dim"},{anchor:"transformers.GemmaConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_pytorch_tanh&quot;</code>) &#x2014;
The legacy activation function. It is overwritten by the <code>hidden_activation</code>.`,name:"hidden_act"},{anchor:"transformers.GemmaConfig.hidden_activation",description:`<strong>hidden_activation</strong> (<code>str</code> or <code>function</code>, <em>optional</em>) &#x2014;
The non-linear activation function (function or string) in the decoder. Will default to <code>&quot;gelu_pytorch_tanh&quot;</code>
if not specified. <code>&quot;gelu_pytorch_tanh&quot;</code> uses an approximation of the <code>&quot;gelu&quot;</code> activation function.`,name:"hidden_activation"},{anchor:"transformers.GemmaConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.GemmaConfig.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.GemmaConfig.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.GemmaConfig.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.GemmaConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.GemmaConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.GemmaConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.GemmaConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.GemmaConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.GemmaConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, defaults to <code>False</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.GemmaConfig.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"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/configuration_gemma.py#L27"}}),ne=new eo({props:{anchor:"transformers.GemmaConfig.example",$$slots:{default:[Qa]},$$scope:{ctx:y}}}),Le=new M({props:{name:"class transformers.GemmaTokenizer",anchor:"transformers.GemmaTokenizer",parameters:[{name:"vocab_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<bos>'"},{name:"eos_token",val:" = '<eos>'"},{name:"pad_token",val:" = '<pad>'"},{name:"sp_model_kwargs",val:": Optional = None"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"use_default_system_prompt",val:" = False"},{name:"spaces_between_special_tokens",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GemmaTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.GemmaTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.GemmaTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;bos&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.`,name:"bos_token"},{anchor:"transformers.GemmaTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;eos&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.GemmaTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation.`,name:"pad_token"},{anchor:"transformers.GemmaTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>Dict[str, Any]</code>, <code>Optional</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.GemmaTokenizer.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add an <code>bos_token</code> at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.GemmaTokenizer.add_eos_token",description:`<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an <code>eos_token</code> at the end of sequences.`,name:"add_eos_token"},{anchor:"transformers.GemmaTokenizer.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to cleanup spaces after decoding, cleanup consists in removing potential artifacts like
extra spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.GemmaTokenizer.use_default_system_prompt",description:`<strong>use_default_system_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the default system prompt for Gemma should be used.`,name:"use_default_system_prompt"},{anchor:"transformers.GemmaTokenizer.spaces_between_special_tokens",description:`<strong>spaces_between_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add spaces between special tokens.`,name:"spaces_between_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma.py#L38"}}),Pe=new M({props:{name:"convert_tokens_to_string",anchor:"transformers.GemmaTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma.py#L203"}}),je=new M({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.GemmaTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GemmaTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids.`,name:"token_ids_0"},{anchor:"transformers.GemmaTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma.py#L296",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),se=new eo({props:{anchor:"transformers.GemmaTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Ya]},$$scope:{ctx:y}}}),Ie=new M({props:{name:"get_special_tokens_mask",anchor:"transformers.GemmaTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.GemmaTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.GemmaTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.GemmaTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma.py#L258",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),We=new M({props:{name:"get_vocab",anchor:"transformers.GemmaTokenizer.get_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma.py#L151"}}),Ue=new M({props:{name:"save_vocabulary",anchor:"transformers.GemmaTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:""},{name:"filename_prefix",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GemmaTokenizer.save_vocabulary.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) &#x2014;
The directory in which to save the vocabulary.`,name:"save_directory"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma.py#L218",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Paths to the files saved.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Tuple(str)</code></p>
`}}),Je=new M({props:{name:"class transformers.GemmaTokenizerFast",anchor:"transformers.GemmaTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<bos>'"},{name:"eos_token",val:" = '<eos>'"},{name:"pad_token",val:" = '<pad>'"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GemmaTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .model extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.GemmaTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://github.com/huggingface/tokenizers" rel="nofollow">tokenizers</a> file (generally has a .json extension) that
contains everything needed to load the tokenizer.`,name:"tokenizer_file"},{anchor:"transformers.GemmaTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to cleanup spaces after decoding, cleanup consists in removing potential artifacts like
extra spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.GemmaTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.GemmaTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;bos&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.`,name:"bos_token"},{anchor:"transformers.GemmaTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;eos&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.GemmaTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The padding token`,name:"pad_token"},{anchor:"transformers.GemmaTokenizerFast.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add an <code>bos_token</code> at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.GemmaTokenizerFast.add_eos_token",description:`<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an <code>eos_token</code> at the end of sequences.`,name:"add_eos_token"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma_fast.py#L37"}}),le=new eo({props:{anchor:"transformers.GemmaTokenizerFast.example",$$slots:{default:[Ka]},$$scope:{ctx:y}}}),Ne=new M({props:{name:"update_post_processor",anchor:"transformers.GemmaTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/tokenization_gemma_fast.py#L125"}}),Ze=new M({props:{name:"class transformers.GemmaModel",anchor:"transformers.GemmaModel",parameters:[{name:"config",val:": GemmaConfig"}],parametersDescription:[{anchor:"transformers.GemmaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaConfig">GemmaConfig</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_31172/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; GemmaConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/modeling_gemma.py#L801"}}),Ee=new M({props:{name:"forward",anchor:"transformers.GemmaModel.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:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GemmaModel.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaModel.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaModel.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.GemmaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/pr_31172/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</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.GemmaModel.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.GemmaModel.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.GemmaModel.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.GemmaModel.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.GemmaModel.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_31172/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GemmaModel.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_31172/src/transformers/models/gemma/modeling_gemma.py#L834"}}),me=new Te({props:{$$slots:{default:[es]},$$scope:{ctx:y}}}),Be=new M({props:{name:"class transformers.GemmaForCausalLM",anchor:"transformers.GemmaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/modeling_gemma.py#L1035"}}),Ve=new M({props:{name:"forward",anchor:"transformers.GemmaForCausalLM.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"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GemmaForCausalLM.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaForCausalLM.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaForCausalLM.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.GemmaForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/pr_31172/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</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.GemmaForCausalLM.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.GemmaForCausalLM.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.GemmaForCausalLM.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.GemmaForCausalLM.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.GemmaForCausalLM.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_31172/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GemmaForCausalLM.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>.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/modeling_gemma.py#L1065",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31172/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> 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_31172/en/model_doc/gemma#transformers.GemmaConfig"
>GemmaConfig</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>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><a
  href="/docs/transformers/pr_31172/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pe=new Te({props:{$$slots:{default:[ts]},$$scope:{ctx:y}}}),ue=new eo({props:{anchor:"transformers.GemmaForCausalLM.forward.example",$$slots:{default:[os]},$$scope:{ctx:y}}}),Oe=new M({props:{name:"class transformers.GemmaForSequenceClassification",anchor:"transformers.GemmaForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GemmaForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaConfig">GemmaConfig</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_31172/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_31172/src/transformers/models/gemma/modeling_gemma.py#L1238"}}),Re=new M({props:{name:"forward",anchor:"transformers.GemmaForSequenceClassification.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.GemmaForSequenceClassification.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaForSequenceClassification.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaForSequenceClassification.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.GemmaForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/pr_31172/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</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.GemmaForSequenceClassification.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.GemmaForSequenceClassification.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.GemmaForSequenceClassification.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.GemmaForSequenceClassification.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.GemmaForSequenceClassification.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_31172/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GemmaForSequenceClassification.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.GemmaForSequenceClassification.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_31172/src/transformers/models/gemma/modeling_gemma.py#L1269"}}),he=new Te({props:{$$slots:{default:[ns]},$$scope:{ctx:y}}}),Qe=new M({props:{name:"class transformers.GemmaForTokenClassification",anchor:"transformers.GemmaForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GemmaForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaConfig">GemmaConfig</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_31172/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_31172/src/transformers/models/gemma/modeling_gemma.py#L1361"}}),Ye=new M({props:{name:"forward",anchor:"transformers.GemmaForTokenClassification.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:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.GemmaForTokenClassification.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaForTokenClassification.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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.GemmaForTokenClassification.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.GemmaForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/pr_31172/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</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.GemmaForTokenClassification.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.GemmaForTokenClassification.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.GemmaForTokenClassification.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.GemmaForTokenClassification.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.GemmaForTokenClassification.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_31172/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GemmaForTokenClassification.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.GemmaForTokenClassification.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_31172/src/transformers/models/gemma/modeling_gemma.py#L1391"}}),fe=new Te({props:{$$slots:{default:[as]},$$scope:{ctx:y}}}),et=new M({props:{name:"class transformers.FlaxGemmaModel",anchor:"transformers.FlaxGemmaModel",parameters:[{name:"config",val:": GemmaConfig"},{name:"input_shape",val:": Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxGemmaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaConfig">GemmaConfig</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_31172/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxGemmaModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code>, or
<code>jax.numpy.bfloat16</code>.</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_31172/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_31172/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/modeling_flax_gemma.py#L663"}}),tt=new M({props:{name:"__call__",anchor:"transformers.FlaxGemmaModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.FlaxGemmaModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, input_ids_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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.FlaxGemmaModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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>decoder_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.FlaxGemmaModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.FlaxGemmaModel.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxGemmaModel.__call__.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.FlaxGemmaModel.__call__.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.FlaxGemmaModel.__call__.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_31172/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/modeling_flax_gemma.py#L482",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31172/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> 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_31172/en/model_doc/gemma#transformers.GemmaConfig"
>GemmaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>jnp.ndarray</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><a
  href="/docs/transformers/pr_31172/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new Te({props:{$$slots:{default:[ss]},$$scope:{ctx:y}}}),ge=new Te({props:{warning:!0,$$slots:{default:[rs]},$$scope:{ctx:y}}}),be=new eo({props:{anchor:"transformers.FlaxGemmaModel.__call__.example",$$slots:{default:[is]},$$scope:{ctx:y}}}),nt=new M({props:{name:"class transformers.FlaxGemmaForCausalLM",anchor:"transformers.FlaxGemmaForCausalLM",parameters:[{name:"config",val:": GemmaConfig"},{name:"input_shape",val:": Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxGemmaForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_31172/en/model_doc/gemma#transformers.GemmaConfig">GemmaConfig</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_31172/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxGemmaForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code>, or
<code>jax.numpy.bfloat16</code>.</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/pr_31172/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/pr_31172/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/modeling_flax_gemma.py#L731"}}),at=new M({props:{name:"__call__",anchor:"transformers.FlaxGemmaForCausalLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.FlaxGemmaForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, input_ids_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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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.FlaxGemmaForCausalLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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_31172/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_31172/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_31172/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>decoder_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.FlaxGemmaForCausalLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.FlaxGemmaForCausalLM.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxGemmaForCausalLM.__call__.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.FlaxGemmaForCausalLM.__call__.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.FlaxGemmaForCausalLM.__call__.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_31172/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_31172/src/transformers/models/gemma/modeling_flax_gemma.py#L482",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_31172/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> 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_31172/en/model_doc/gemma#transformers.GemmaConfig"
>GemmaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</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>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>jnp.ndarray</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><a
  href="/docs/transformers/pr_31172/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ke=new Te({props:{$$slots:{default:[ds]},$$scope:{ctx:y}}}),ve=new Te({props:{warning:!0,$$slots:{default:[ls]},$$scope:{ctx:y}}}),ye=new eo({props:{anchor:"transformers.FlaxGemmaForCausalLM.__call__.example",$$slots:{default:[cs]},$$scope:{ctx:y}}}),st=new Xa({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/gemma.md"}}),{c(){t=d("meta"),h=n(),r=d("p"),u=n(),f(T.$$.fragment),p=n(),f(x.$$.fragment),no=n(),xe=d("p"),xe.innerHTML=Bn,ao=n(),$e=d("p"),$e.textContent=Vn,so=n(),we=d("p"),we.innerHTML=Dn,ro=n(),Me=d("p"),Me.textContent=On,io=n(),ze=d("ul"),ze.innerHTML=Rn,lo=n(),Ce=d("p"),Ce.innerHTML=Xn,co=n(),f(Ge.$$.fragment),mo=n(),B=d("div"),f(Fe.$$.fragment),qo=n(),pt=d("p"),pt.innerHTML=Qn,Lo=n(),f(ne.$$.fragment),po=n(),qe=d("p"),qe.textContent=Yn,uo=n(),z=d("div"),f(Le.$$.fragment),Po=n(),ut=d("p"),ut.textContent=Kn,jo=n(),ae=d("div"),f(Pe.$$.fragment),Io=n(),ht=d("p"),ht.textContent=ea,Wo=n(),E=d("div"),f(je.$$.fragment),Uo=n(),ft=d("p"),ft.textContent=ta,Ho=n(),f(se.$$.fragment),Jo=n(),_t=d("p"),_t.textContent=oa,No=n(),re=d("div"),f(Ie.$$.fragment),So=n(),gt=d("p"),gt.innerHTML=na,Zo=n(),ie=d("div"),f(We.$$.fragment),Eo=n(),bt=d("p"),bt.textContent=aa,Ao=n(),de=d("div"),f(Ue.$$.fragment),Bo=n(),kt=d("p"),kt.textContent=sa,ho=n(),He=d("p"),He.textContent=ra,fo=n(),C=d("div"),f(Je.$$.fragment),Vo=n(),vt=d("p"),vt.textContent=ia,Do=n(),yt=d("p"),yt.innerHTML=da,Oo=n(),f(le.$$.fragment),Ro=n(),Tt=d("p"),Tt.innerHTML=la,Xo=n(),xt=d("p"),xt.innerHTML=ca,Qo=n(),ce=d("div"),f(Ne.$$.fragment),Yo=n(),$t=d("p"),$t.innerHTML=ma,_o=n(),Se=d("p"),Se.textContent=pa,go=n(),I=d("div"),f(Ze.$$.fragment),Ko=n(),wt=d("p"),wt.innerHTML=ua,en=n(),Mt=d("p"),Mt.innerHTML=ha,tn=n(),zt=d("p"),zt.innerHTML=fa,on=n(),O=d("div"),f(Ee.$$.fragment),nn=n(),Ct=d("p"),Ct.innerHTML=_a,an=n(),f(me.$$.fragment),bo=n(),Ae=d("p"),Ae.textContent=ga,ko=n(),ee=d("div"),f(Be.$$.fragment),sn=n(),A=d("div"),f(Ve.$$.fragment),rn=n(),Gt=d("p"),Gt.innerHTML=ba,dn=n(),f(pe.$$.fragment),ln=n(),f(ue.$$.fragment),vo=n(),De=d("p"),De.textContent=ka,yo=n(),G=d("div"),f(Oe.$$.fragment),cn=n(),Ft=d("p"),Ft.textContent=va,mn=n(),qt=d("p"),qt.innerHTML=ya,pn=n(),Lt=d("p"),Lt.innerHTML=Ta,un=n(),Pt=d("p"),Pt.innerHTML=xa,hn=n(),jt=d("p"),jt.innerHTML=$a,fn=n(),R=d("div"),f(Re.$$.fragment),_n=n(),It=d("p"),It.innerHTML=wa,gn=n(),f(he.$$.fragment),To=n(),Xe=d("p"),Xe.textContent=Ma,xo=n(),W=d("div"),f(Qe.$$.fragment),bn=n(),Wt=d("p"),Wt.textContent=za,kn=n(),Ut=d("p"),Ut.innerHTML=Ca,vn=n(),Ht=d("p"),Ht.innerHTML=Ga,yn=n(),X=d("div"),f(Ye.$$.fragment),Tn=n(),Jt=d("p"),Jt.innerHTML=Fa,xn=n(),f(fe.$$.fragment),$o=n(),Ke=d("p"),Ke.textContent=qa,wo=n(),F=d("div"),f(et.$$.fragment),$n=n(),Nt=d("p"),Nt.textContent=La,wn=n(),St=d("p"),St.innerHTML=Pa,Mn=n(),Zt=d("p"),Zt.innerHTML=ja,zn=n(),Et=d("p"),Et.textContent=Ia,Cn=n(),At=d("ul"),At.innerHTML=Wa,Gn=n(),U=d("div"),f(tt.$$.fragment),Fn=n(),Bt=d("p"),Bt.innerHTML=Ua,qn=n(),f(_e.$$.fragment),Ln=n(),f(ge.$$.fragment),Pn=n(),f(be.$$.fragment),Mo=n(),ot=d("p"),ot.textContent=Ha,zo=n(),q=d("div"),f(nt.$$.fragment),jn=n(),Vt=d("p"),Vt.textContent=Ja,In=n(),Dt=d("p"),Dt.innerHTML=Na,Wn=n(),Ot=d("p"),Ot.innerHTML=Sa,Un=n(),Rt=d("p"),Rt.textContent=Za,Hn=n(),Xt=d("ul"),Xt.innerHTML=Ea,Jn=n(),H=d("div"),f(at.$$.fragment),Nn=n(),Qt=d("p"),Qt.innerHTML=Aa,Sn=n(),f(ke.$$.fragment),Zn=n(),f(ve.$$.fragment),En=n(),f(ye.$$.fragment),Co=n(),f(st.$$.fragment),Go=n(),oo=d("p"),this.h()},l(e){const i=Ra("svelte-u9bgzb",document.head);t=l(i,"META",{name:!0,content:!0}),i.forEach(s),h=a(e),r=l(e,"P",{}),$(r).forEach(s),u=a(e),_(T.$$.fragment,e),p=a(e),_(x.$$.fragment,e),no=a(e),xe=l(e,"P",{"data-svelte-h":!0}),m(xe)!=="svelte-1x14ct2"&&(xe.innerHTML=Bn),ao=a(e),$e=l(e,"P",{"data-svelte-h":!0}),m($e)!=="svelte-vfdo9a"&&($e.textContent=Vn),so=a(e),we=l(e,"P",{"data-svelte-h":!0}),m(we)!=="svelte-1i59my0"&&(we.innerHTML=Dn),ro=a(e),Me=l(e,"P",{"data-svelte-h":!0}),m(Me)!=="svelte-axv494"&&(Me.textContent=On),io=a(e),ze=l(e,"UL",{"data-svelte-h":!0}),m(ze)!=="svelte-13a1z9o"&&(ze.innerHTML=Rn),lo=a(e),Ce=l(e,"P",{"data-svelte-h":!0}),m(Ce)!=="svelte-hm8qhc"&&(Ce.innerHTML=Xn),co=a(e),_(Ge.$$.fragment,e),mo=a(e),B=l(e,"DIV",{class:!0});var te=$(B);_(Fe.$$.fragment,te),qo=a(te),pt=l(te,"P",{"data-svelte-h":!0}),m(pt)!=="svelte-1iwp8jk"&&(pt.innerHTML=Qn),Lo=a(te),_(ne.$$.fragment,te),te.forEach(s),po=a(e),qe=l(e,"P",{"data-svelte-h":!0}),m(qe)!=="svelte-1pqk37w"&&(qe.textContent=Yn),uo=a(e),z=l(e,"DIV",{class:!0});var L=$(z);_(Le.$$.fragment,L),Po=a(L),ut=l(L,"P",{"data-svelte-h":!0}),m(ut)!=="svelte-33lcdu"&&(ut.textContent=Kn),jo=a(L),ae=l(L,"DIV",{class:!0});var rt=$(ae);_(Pe.$$.fragment,rt),Io=a(rt),ht=l(rt,"P",{"data-svelte-h":!0}),m(ht)!=="svelte-b3k2yi"&&(ht.textContent=ea),rt.forEach(s),Wo=a(L),E=l(L,"DIV",{class:!0});var V=$(E);_(je.$$.fragment,V),Uo=a(V),ft=l(V,"P",{"data-svelte-h":!0}),m(ft)!=="svelte-13bfd60"&&(ft.textContent=ta),Ho=a(V),_(se.$$.fragment,V),Jo=a(V),_t=l(V,"P",{"data-svelte-h":!0}),m(_t)!=="svelte-wtrslu"&&(_t.textContent=oa),V.forEach(s),No=a(L),re=l(L,"DIV",{class:!0});var it=$(re);_(Ie.$$.fragment,it),So=a(it),gt=l(it,"P",{"data-svelte-h":!0}),m(gt)!=="svelte-1f4f5kp"&&(gt.innerHTML=na),it.forEach(s),Zo=a(L),ie=l(L,"DIV",{class:!0});var dt=$(ie);_(We.$$.fragment,dt),Eo=a(dt),bt=l(dt,"P",{"data-svelte-h":!0}),m(bt)!=="svelte-iwelht"&&(bt.textContent=aa),dt.forEach(s),Ao=a(L),de=l(L,"DIV",{class:!0});var lt=$(de);_(Ue.$$.fragment,lt),Bo=a(lt),kt=l(lt,"P",{"data-svelte-h":!0}),m(kt)!=="svelte-1slb66l"&&(kt.textContent=sa),lt.forEach(s),L.forEach(s),ho=a(e),He=l(e,"P",{"data-svelte-h":!0}),m(He)!=="svelte-15tvvv4"&&(He.textContent=ra),fo=a(e),C=l(e,"DIV",{class:!0});var P=$(C);_(Je.$$.fragment,P),Vo=a(P),vt=l(P,"P",{"data-svelte-h":!0}),m(vt)!=="svelte-m9hkz6"&&(vt.textContent=ia),Do=a(P),yt=l(P,"P",{"data-svelte-h":!0}),m(yt)!=="svelte-1l3z03t"&&(yt.innerHTML=da),Oo=a(P),_(le.$$.fragment,P),Ro=a(P),Tt=l(P,"P",{"data-svelte-h":!0}),m(Tt)!=="svelte-cnb6q1"&&(Tt.innerHTML=la),Xo=a(P),xt=l(P,"P",{"data-svelte-h":!0}),m(xt)!=="svelte-1ukt6nq"&&(xt.innerHTML=ca),Qo=a(P),ce=l(P,"DIV",{class:!0});var ct=$(ce);_(Ne.$$.fragment,ct),Yo=a(ct),$t=l(ct,"P",{"data-svelte-h":!0}),m($t)!=="svelte-nfci2w"&&($t.innerHTML=ma),ct.forEach(s),P.forEach(s),_o=a(e),Se=l(e,"P",{"data-svelte-h":!0}),m(Se)!=="svelte-pzei6k"&&(Se.textContent=pa),go=a(e),I=l(e,"DIV",{class:!0});var Z=$(I);_(Ze.$$.fragment,Z),Ko=a(Z),wt=l(Z,"P",{"data-svelte-h":!0}),m(wt)!=="svelte-e2bvtf"&&(wt.innerHTML=ua),en=a(Z),Mt=l(Z,"P",{"data-svelte-h":!0}),m(Mt)!=="svelte-1ydu1el"&&(Mt.innerHTML=ha),tn=a(Z),zt=l(Z,"P",{"data-svelte-h":!0}),m(zt)!=="svelte-9h4hrw"&&(zt.innerHTML=fa),on=a(Z),O=l(Z,"DIV",{class:!0});var oe=$(O);_(Ee.$$.fragment,oe),nn=a(oe),Ct=l(oe,"P",{"data-svelte-h":!0}),m(Ct)!=="svelte-ua5l2e"&&(Ct.innerHTML=_a),an=a(oe),_(me.$$.fragment,oe),oe.forEach(s),Z.forEach(s),bo=a(e),Ae=l(e,"P",{"data-svelte-h":!0}),m(Ae)!=="svelte-af2sa4"&&(Ae.textContent=ga),ko=a(e),ee=l(e,"DIV",{class:!0});var mt=$(ee);_(Be.$$.fragment,mt),sn=a(mt),A=l(mt,"DIV",{class:!0});var D=$(A);_(Ve.$$.fragment,D),rn=a(D),Gt=l(D,"P",{"data-svelte-h":!0}),m(Gt)!=="svelte-1s1ov0u"&&(Gt.innerHTML=ba),dn=a(D),_(pe.$$.fragment,D),ln=a(D),_(ue.$$.fragment,D),D.forEach(s),mt.forEach(s),vo=a(e),De=l(e,"P",{"data-svelte-h":!0}),m(De)!=="svelte-121974m"&&(De.textContent=ka),yo=a(e),G=l(e,"DIV",{class:!0});var j=$(G);_(Oe.$$.fragment,j),cn=a(j),Ft=l(j,"P",{"data-svelte-h":!0}),m(Ft)!=="svelte-1140lml"&&(Ft.textContent=va),mn=a(j),qt=l(j,"P",{"data-svelte-h":!0}),m(qt)!=="svelte-128gujh"&&(qt.innerHTML=ya),pn=a(j),Lt=l(j,"P",{"data-svelte-h":!0}),m(Lt)!=="svelte-10ugs3m"&&(Lt.innerHTML=Ta),un=a(j),Pt=l(j,"P",{"data-svelte-h":!0}),m(Pt)!=="svelte-1czo7a0"&&(Pt.innerHTML=xa),hn=a(j),jt=l(j,"P",{"data-svelte-h":!0}),m(jt)!=="svelte-1ydu1el"&&(jt.innerHTML=$a),fn=a(j),R=l(j,"DIV",{class:!0});var Yt=$(R);_(Re.$$.fragment,Yt),_n=a(Yt),It=l(Yt,"P",{"data-svelte-h":!0}),m(It)!=="svelte-x2e0rw"&&(It.innerHTML=wa),gn=a(Yt),_(he.$$.fragment,Yt),Yt.forEach(s),j.forEach(s),To=a(e),Xe=l(e,"P",{"data-svelte-h":!0}),m(Xe)!=="svelte-1sx48i4"&&(Xe.textContent=Ma),xo=a(e),W=l(e,"DIV",{class:!0});var Q=$(W);_(Qe.$$.fragment,Q),bn=a(Q),Wt=l(Q,"P",{"data-svelte-h":!0}),m(Wt)!=="svelte-1b4l2ay"&&(Wt.textContent=za),kn=a(Q),Ut=l(Q,"P",{"data-svelte-h":!0}),m(Ut)!=="svelte-1czo7a0"&&(Ut.innerHTML=Ca),vn=a(Q),Ht=l(Q,"P",{"data-svelte-h":!0}),m(Ht)!=="svelte-1ydu1el"&&(Ht.innerHTML=Ga),yn=a(Q),X=l(Q,"DIV",{class:!0});var Kt=$(X);_(Ye.$$.fragment,Kt),Tn=a(Kt),Jt=l(Kt,"P",{"data-svelte-h":!0}),m(Jt)!=="svelte-pw9pzy"&&(Jt.innerHTML=Fa),xn=a(Kt),_(fe.$$.fragment,Kt),Kt.forEach(s),Q.forEach(s),$o=a(e),Ke=l(e,"P",{"data-svelte-h":!0}),m(Ke)!=="svelte-c7wmve"&&(Ke.textContent=qa),wo=a(e),F=l(e,"DIV",{class:!0});var J=$(F);_(et.$$.fragment,J),$n=a(J),Nt=l(J,"P",{"data-svelte-h":!0}),m(Nt)!=="svelte-toiqik"&&(Nt.textContent=La),wn=a(J),St=l(J,"P",{"data-svelte-h":!0}),m(St)!=="svelte-1rgjioc"&&(St.innerHTML=Pa),Mn=a(J),Zt=l(J,"P",{"data-svelte-h":!0}),m(Zt)!=="svelte-idybz1"&&(Zt.innerHTML=ja),zn=a(J),Et=l(J,"P",{"data-svelte-h":!0}),m(Et)!=="svelte-1pplc4a"&&(Et.textContent=Ia),Cn=a(J),At=l(J,"UL",{"data-svelte-h":!0}),m(At)!=="svelte-m6h3rq"&&(At.innerHTML=Wa),Gn=a(J),U=l(J,"DIV",{class:!0});var Y=$(U);_(tt.$$.fragment,Y),Fn=a(Y),Bt=l(Y,"P",{"data-svelte-h":!0}),m(Bt)!=="svelte-1y60y2q"&&(Bt.innerHTML=Ua),qn=a(Y),_(_e.$$.fragment,Y),Ln=a(Y),_(ge.$$.fragment,Y),Pn=a(Y),_(be.$$.fragment,Y),Y.forEach(s),J.forEach(s),Mo=a(e),ot=l(e,"P",{"data-svelte-h":!0}),m(ot)!=="svelte-144m16m"&&(ot.textContent=Ha),zo=a(e),q=l(e,"DIV",{class:!0});var N=$(q);_(nt.$$.fragment,N),jn=a(N),Vt=l(N,"P",{"data-svelte-h":!0}),m(Vt)!=="svelte-3xz13p"&&(Vt.textContent=Ja),In=a(N),Dt=l(N,"P",{"data-svelte-h":!0}),m(Dt)!=="svelte-1rgjioc"&&(Dt.innerHTML=Na),Wn=a(N),Ot=l(N,"P",{"data-svelte-h":!0}),m(Ot)!=="svelte-idybz1"&&(Ot.innerHTML=Sa),Un=a(N),Rt=l(N,"P",{"data-svelte-h":!0}),m(Rt)!=="svelte-1pplc4a"&&(Rt.textContent=Za),Hn=a(N),Xt=l(N,"UL",{"data-svelte-h":!0}),m(Xt)!=="svelte-m6h3rq"&&(Xt.innerHTML=Ea),Jn=a(N),H=l(N,"DIV",{class:!0});var K=$(H);_(at.$$.fragment,K),Nn=a(K),Qt=l(K,"P",{"data-svelte-h":!0}),m(Qt)!=="svelte-1y60y2q"&&(Qt.innerHTML=Aa),Sn=a(K),_(ke.$$.fragment,K),Zn=a(K),_(ve.$$.fragment,K),En=a(K),_(ye.$$.fragment,K),K.forEach(s),N.forEach(s),Co=a(e),_(st.$$.fragment,e),Go=a(e),oo=l(e,"P",{}),$(oo).forEach(s),this.h()},h(){w(t,"name","hf:doc:metadata"),w(t,"content",ps),w(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(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(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(q,"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,i){o(document.head,t),c(e,h,i),c(e,r,i),c(e,u,i),g(T,e,i),c(e,p,i),g(x,e,i),c(e,no,i),c(e,xe,i),c(e,ao,i),c(e,$e,i),c(e,so,i),c(e,we,i),c(e,ro,i),c(e,Me,i),c(e,io,i),c(e,ze,i),c(e,lo,i),c(e,Ce,i),c(e,co,i),g(Ge,e,i),c(e,mo,i),c(e,B,i),g(Fe,B,null),o(B,qo),o(B,pt),o(B,Lo),g(ne,B,null),c(e,po,i),c(e,qe,i),c(e,uo,i),c(e,z,i),g(Le,z,null),o(z,Po),o(z,ut),o(z,jo),o(z,ae),g(Pe,ae,null),o(ae,Io),o(ae,ht),o(z,Wo),o(z,E),g(je,E,null),o(E,Uo),o(E,ft),o(E,Ho),g(se,E,null),o(E,Jo),o(E,_t),o(z,No),o(z,re),g(Ie,re,null),o(re,So),o(re,gt),o(z,Zo),o(z,ie),g(We,ie,null),o(ie,Eo),o(ie,bt),o(z,Ao),o(z,de),g(Ue,de,null),o(de,Bo),o(de,kt),c(e,ho,i),c(e,He,i),c(e,fo,i),c(e,C,i),g(Je,C,null),o(C,Vo),o(C,vt),o(C,Do),o(C,yt),o(C,Oo),g(le,C,null),o(C,Ro),o(C,Tt),o(C,Xo),o(C,xt),o(C,Qo),o(C,ce),g(Ne,ce,null),o(ce,Yo),o(ce,$t),c(e,_o,i),c(e,Se,i),c(e,go,i),c(e,I,i),g(Ze,I,null),o(I,Ko),o(I,wt),o(I,en),o(I,Mt),o(I,tn),o(I,zt),o(I,on),o(I,O),g(Ee,O,null),o(O,nn),o(O,Ct),o(O,an),g(me,O,null),c(e,bo,i),c(e,Ae,i),c(e,ko,i),c(e,ee,i),g(Be,ee,null),o(ee,sn),o(ee,A),g(Ve,A,null),o(A,rn),o(A,Gt),o(A,dn),g(pe,A,null),o(A,ln),g(ue,A,null),c(e,vo,i),c(e,De,i),c(e,yo,i),c(e,G,i),g(Oe,G,null),o(G,cn),o(G,Ft),o(G,mn),o(G,qt),o(G,pn),o(G,Lt),o(G,un),o(G,Pt),o(G,hn),o(G,jt),o(G,fn),o(G,R),g(Re,R,null),o(R,_n),o(R,It),o(R,gn),g(he,R,null),c(e,To,i),c(e,Xe,i),c(e,xo,i),c(e,W,i),g(Qe,W,null),o(W,bn),o(W,Wt),o(W,kn),o(W,Ut),o(W,vn),o(W,Ht),o(W,yn),o(W,X),g(Ye,X,null),o(X,Tn),o(X,Jt),o(X,xn),g(fe,X,null),c(e,$o,i),c(e,Ke,i),c(e,wo,i),c(e,F,i),g(et,F,null),o(F,$n),o(F,Nt),o(F,wn),o(F,St),o(F,Mn),o(F,Zt),o(F,zn),o(F,Et),o(F,Cn),o(F,At),o(F,Gn),o(F,U),g(tt,U,null),o(U,Fn),o(U,Bt),o(U,qn),g(_e,U,null),o(U,Ln),g(ge,U,null),o(U,Pn),g(be,U,null),c(e,Mo,i),c(e,ot,i),c(e,zo,i),c(e,q,i),g(nt,q,null),o(q,jn),o(q,Vt),o(q,In),o(q,Dt),o(q,Wn),o(q,Ot),o(q,Un),o(q,Rt),o(q,Hn),o(q,Xt),o(q,Jn),o(q,H),g(at,H,null),o(H,Nn),o(H,Qt),o(H,Sn),g(ke,H,null),o(H,Zn),g(ve,H,null),o(H,En),g(ye,H,null),c(e,Co,i),g(st,e,i),c(e,Go,i),c(e,oo,i),Fo=!0},p(e,[i]){const te={};i&2&&(te.$$scope={dirty:i,ctx:e}),ne.$set(te);const L={};i&2&&(L.$$scope={dirty:i,ctx:e}),se.$set(L);const rt={};i&2&&(rt.$$scope={dirty:i,ctx:e}),le.$set(rt);const V={};i&2&&(V.$$scope={dirty:i,ctx:e}),me.$set(V);const it={};i&2&&(it.$$scope={dirty:i,ctx:e}),pe.$set(it);const dt={};i&2&&(dt.$$scope={dirty:i,ctx:e}),ue.$set(dt);const lt={};i&2&&(lt.$$scope={dirty:i,ctx:e}),he.$set(lt);const P={};i&2&&(P.$$scope={dirty:i,ctx:e}),fe.$set(P);const ct={};i&2&&(ct.$$scope={dirty:i,ctx:e}),_e.$set(ct);const Z={};i&2&&(Z.$$scope={dirty:i,ctx:e}),ge.$set(Z);const oe={};i&2&&(oe.$$scope={dirty:i,ctx:e}),be.$set(oe);const mt={};i&2&&(mt.$$scope={dirty:i,ctx:e}),ke.$set(mt);const D={};i&2&&(D.$$scope={dirty:i,ctx:e}),ve.$set(D);const j={};i&2&&(j.$$scope={dirty:i,ctx:e}),ye.$set(j)},i(e){Fo||(b(T.$$.fragment,e),b(x.$$.fragment,e),b(Ge.$$.fragment,e),b(Fe.$$.fragment,e),b(ne.$$.fragment,e),b(Le.$$.fragment,e),b(Pe.$$.fragment,e),b(je.$$.fragment,e),b(se.$$.fragment,e),b(Ie.$$.fragment,e),b(We.$$.fragment,e),b(Ue.$$.fragment,e),b(Je.$$.fragment,e),b(le.$$.fragment,e),b(Ne.$$.fragment,e),b(Ze.$$.fragment,e),b(Ee.$$.fragment,e),b(me.$$.fragment,e),b(Be.$$.fragment,e),b(Ve.$$.fragment,e),b(pe.$$.fragment,e),b(ue.$$.fragment,e),b(Oe.$$.fragment,e),b(Re.$$.fragment,e),b(he.$$.fragment,e),b(Qe.$$.fragment,e),b(Ye.$$.fragment,e),b(fe.$$.fragment,e),b(et.$$.fragment,e),b(tt.$$.fragment,e),b(_e.$$.fragment,e),b(ge.$$.fragment,e),b(be.$$.fragment,e),b(nt.$$.fragment,e),b(at.$$.fragment,e),b(ke.$$.fragment,e),b(ve.$$.fragment,e),b(ye.$$.fragment,e),b(st.$$.fragment,e),Fo=!0)},o(e){k(T.$$.fragment,e),k(x.$$.fragment,e),k(Ge.$$.fragment,e),k(Fe.$$.fragment,e),k(ne.$$.fragment,e),k(Le.$$.fragment,e),k(Pe.$$.fragment,e),k(je.$$.fragment,e),k(se.$$.fragment,e),k(Ie.$$.fragment,e),k(We.$$.fragment,e),k(Ue.$$.fragment,e),k(Je.$$.fragment,e),k(le.$$.fragment,e),k(Ne.$$.fragment,e),k(Ze.$$.fragment,e),k(Ee.$$.fragment,e),k(me.$$.fragment,e),k(Be.$$.fragment,e),k(Ve.$$.fragment,e),k(pe.$$.fragment,e),k(ue.$$.fragment,e),k(Oe.$$.fragment,e),k(Re.$$.fragment,e),k(he.$$.fragment,e),k(Qe.$$.fragment,e),k(Ye.$$.fragment,e),k(fe.$$.fragment,e),k(et.$$.fragment,e),k(tt.$$.fragment,e),k(_e.$$.fragment,e),k(ge.$$.fragment,e),k(be.$$.fragment,e),k(nt.$$.fragment,e),k(at.$$.fragment,e),k(ke.$$.fragment,e),k(ve.$$.fragment,e),k(ye.$$.fragment,e),k(st.$$.fragment,e),Fo=!1},d(e){e&&(s(h),s(r),s(u),s(p),s(no),s(xe),s(ao),s($e),s(so),s(we),s(ro),s(Me),s(io),s(ze),s(lo),s(Ce),s(co),s(mo),s(B),s(po),s(qe),s(uo),s(z),s(ho),s(He),s(fo),s(C),s(_o),s(Se),s(go),s(I),s(bo),s(Ae),s(ko),s(ee),s(vo),s(De),s(yo),s(G),s(To),s(Xe),s(xo),s(W),s($o),s(Ke),s(wo),s(F),s(Mo),s(ot),s(zo),s(q),s(Co),s(Go),s(oo)),s(t),v(T,e),v(x,e),v(Ge,e),v(Fe),v(ne),v(Le),v(Pe),v(je),v(se),v(Ie),v(We),v(Ue),v(Je),v(le),v(Ne),v(Ze),v(Ee),v(me),v(Be),v(Ve),v(pe),v(ue),v(Oe),v(Re),v(he),v(Qe),v(Ye),v(fe),v(et),v(tt),v(_e),v(ge),v(be),v(nt),v(at),v(ke),v(ve),v(ye),v(st,e)}}}const ps='{"title":"Gemma","local":"gemma","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"GemmaConfig","local":"transformers.GemmaConfig","sections":[],"depth":2}],"depth":1}';function us(y){return Va(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ys extends Da{constructor(t){super(),Oa(this,t,us,ms,Ba,{})}}export{ys as component};
