import{s as it,o as lt,n as je}from"../chunks/scheduler.01eeda35.js";import{S as dt,i as ct,g as l,s,r as u,A as mt,h as d,f as n,c as r,j as ne,u as f,x as w,k as W,y as c,a,v as g,d as _,t as b,w as y}from"../chunks/index.6dd51b66.js";import{T as st}from"../chunks/Tip.de9bae2b.js";import{D as me}from"../chunks/Docstring.76e6b3cf.js";import{C as Ee}from"../chunks/CodeBlock.864da1b0.js";import{E as rt}from"../chunks/ExampleCodeBlock.6a36fb6b.js";import{H as pe,E as pt}from"../chunks/EditOnGithub.7faefd25.js";function ht(z){let o,p;return o=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdyYW5pdGVNb2RlbCUyQyUyMEdyYW5pdGVDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwR3Jhbml0ZSUyMGdyYW5pdGUtM2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwR3Jhbml0ZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMGdyYW5pdGUtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEdyYW5pdGVNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GraniteModel, GraniteConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Granite granite-3b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GraniteConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the granite-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GraniteModel(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(){u(o.$$.fragment)},l(i){f(o.$$.fragment,i)},m(i,h){g(o,i,h),p=!0},p:je,i(i){p||(_(o.$$.fragment,i),p=!0)},o(i){b(o.$$.fragment,i),p=!1},d(i){y(o,i)}}}function ut(z){let o,p=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=l("p"),o.innerHTML=p},l(i){o=d(i,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=p)},m(i,h){a(i,o,h)},p:je,d(i){i&&n(o)}}}function ft(z){let o,p=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){o=l("p"),o.innerHTML=p},l(i){o=d(i,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=p)},m(i,h){a(i,o,h)},p:je,d(i){i&&n(o)}}}function gt(z){let o,p="Example:",i,h,k;return h=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHcmFuaXRlRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMEdyYW5pdGVGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIybWV0YS1ncmFuaXRlJTJGR3Jhbml0ZS0yLTdiLWhmJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1ldGEtZ3Jhbml0ZSUyRkdyYW5pdGUtMi03Yi1oZiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GraniteForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GraniteForCausalLM.from_pretrained(<span class="hljs-string">&quot;meta-granite/Granite-2-7b-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;meta-granite/Granite-2-7b-hf&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){o=l("p"),o.textContent=p,i=s(),u(h.$$.fragment)},l(m){o=d(m,"P",{"data-svelte-h":!0}),w(o)!=="svelte-11lpom8"&&(o.textContent=p),i=r(m),f(h.$$.fragment,m)},m(m,G){a(m,o,G),a(m,i,G),g(h,m,G),k=!0},p:je,i(m){k||(_(h.$$.fragment,m),k=!0)},o(m){b(h.$$.fragment,m),k=!1},d(m){m&&(n(o),n(i)),y(h,m)}}}function _t(z){let o,p,i,h,k,m,G,Xe='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',he,Z,ue,P,Ve='The Granite model was proposed in <a href="https://arxiv.org/abs/2408.13359" rel="nofollow">Power Scheduler: A Batch Size and Token Number Agnostic Learning Rate Scheduler</a> by Yikang Shen, Matthew Stallone, Mayank Mishra, Gaoyuan Zhang, Shawn Tan, Aditya Prasad, Adriana Meza Soria, David D. Cox and Rameswar Panda.',fe,R,Ne="PowerLM-3B is a 3B state-of-the-art small language model trained with the Power learning rate scheduler. It is trained on a wide range of open-source and synthetic datasets with permissive licenses. PowerLM-3B has shown promising results compared to other models in the size categories across various benchmarks, including natural language multi-choices, code generation, and math reasoning.",ge,H,Ae="The abstract from the paper is the following:",_e,S,Ye=`<em>Finding the optimal learning rate for language model pretraining is a challenging task.
This is not only because there is a complicated correlation between learning rate, batch size, number of training tokens, model size, and other hyperparameters but also because it is prohibitively expensive to perform a hyperparameter search for large language models with Billions or Trillions of parameters. Recent studies propose using small proxy models and small corpus to perform hyperparameter searches and transposing the optimal parameters to large models and large corpus. While the zero-shot transferability is theoretically and empirically proven for model size related hyperparameters, like depth and width, the zero-shot transfer from small corpus to large corpus is underexplored.
In this paper, we study the correlation between optimal learning rate, batch size, and number of training tokens for the recently proposed WSD scheduler. After thousands of small experiments, we found a power-law relationship between variables and demonstrated its transferability across model sizes. Based on the observation, we propose a new learning rate scheduler, Power scheduler, that is agnostic about the number of training tokens and batch size. The experiment shows that combining the Power scheduler with Maximum Update Parameterization (\\mup) can consistently achieve impressive performance with one set of hyperparameters regardless of the number of training tokens, batch size, model size, and even model architecture. Our 3B dense and MoE models trained with the Power scheduler achieve comparable performance as state-of-the-art small language models.
We <a href="https://huggingface.co/collections/ibm/power-lm-66be64ae647ddf11b9808000" rel="nofollow">open source</a> these pretrained models.</em>`,be,q,Qe="Tips:",ye,E,we,X,De='This model was contributed by <a href="https://huggingface.co/mayank-mishra" rel="nofollow">mayank-mishra</a>.',Te,V,Me,M,N,Je,oe,Oe=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteModel">GraniteModel</a>. It is used to instantiate an Granite
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 Granite-3B.`,Ie,ae,Ke=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ue,I,ve,A,ke,T,Y,Be,se,et=`The bare Granite Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Le,re,tt=`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.`,Fe,ie,nt="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>GraniteDecoderLayer</code>",We,x,Q,Ze,le,ot='The <a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteModel">GraniteModel</a> forward method, overrides the <code>__call__</code> special method.',Pe,U,Ge,D,$e,j,O,Re,$,K,He,de,at='The <a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteForCausalLM">GraniteForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Se,B,qe,L,Ce,ee,ze,ce,xe;return k=new pe({props:{title:"Granite",local:"granite",headingTag:"h1"}}),Z=new pe({props:{title:"Overview",local:"overview",headingTag:"h2"}}),E=new Ee({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBJTBBbW9kZWxfcGF0aCUyMCUzRCUyMCUyMmlibSUyRlBvd2VyTE0tM2IlMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9wYXRoKSUwQSUwQSUyMyUyMGRyb3AlMjBkZXZpY2VfbWFwJTIwaWYlMjBydW5uaW5nJTIwb24lMjBDUFUlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChtb2RlbF9wYXRoJTJDJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIpJTBBbW9kZWwuZXZhbCgpJTBBJTBBJTIzJTIwY2hhbmdlJTIwaW5wdXQlMjB0ZXh0JTIwYXMlMjBkZXNpcmVkJTBBcHJvbXB0JTIwJTNEJTIwJTIyV3JpdGUlMjBhJTIwY29kZSUyMHRvJTIwZmluZCUyMHRoZSUyMG1heGltdW0lMjB2YWx1ZSUyMGluJTIwYSUyMGxpc3QlMjBvZiUyMG51bWJlcnMuJTIyJTBBJTBBJTIzJTIwdG9rZW5pemUlMjB0aGUlMjB0ZXh0JTBBaW5wdXRfdG9rZW5zJTIwJTNEJTIwdG9rZW5pemVyKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTIzJTIwZ2VuZXJhdGUlMjBvdXRwdXQlMjB0b2tlbnMlMEFvdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0X3Rva2VucyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTAwKSUwQSUyMyUyMGRlY29kZSUyMG91dHB1dCUyMHRva2VucyUyMGludG8lMjB0ZXh0JTBBb3V0cHV0JTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXQpJTBBJTIzJTIwbG9vcCUyMG92ZXIlMjB0aGUlMjBiYXRjaCUyMHRvJTIwcHJpbnQlMkMlMjBpbiUyMHRoaXMlMjBleGFtcGxlJTIwdGhlJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBZm9yJTIwaSUyMGluJTIwb3V0cHV0JTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoaSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer

model_path = <span class="hljs-string">&quot;ibm/PowerLM-3b&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(model_path)

<span class="hljs-comment"># drop device_map if running on CPU</span>
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=<span class="hljs-string">&quot;auto&quot;</span>)
model.<span class="hljs-built_in">eval</span>()

<span class="hljs-comment"># change input text as desired</span>
prompt = <span class="hljs-string">&quot;Write a code to find the maximum value in a list of numbers.&quot;</span>

<span class="hljs-comment"># tokenize the text</span>
input_tokens = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-comment"># generate output tokens</span>
output = model.generate(**input_tokens, max_new_tokens=<span class="hljs-number">100</span>)
<span class="hljs-comment"># decode output tokens into text</span>
output = tokenizer.batch_decode(output)
<span class="hljs-comment"># loop over the batch to print, in this example the batch size is 1</span>
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> output:
    <span class="hljs-built_in">print</span>(i)`,wrap:!1}}),V=new pe({props:{title:"GraniteConfig",local:"transformers.GraniteConfig",headingTag:"h2"}}),N=new me({props:{name:"class transformers.GraniteConfig",anchor:"transformers.GraniteConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 11008"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = None"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 2048"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = None"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{name:"mlp_bias",val:" = False"},{name:"embedding_multiplier",val:" = 1.0"},{name:"logits_scaling",val:" = 1.0"},{name:"residual_multiplier",val:" = 1.0"},{name:"attention_multiplier",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GraniteConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the Granite model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteModel">GraniteModel</a>`,name:"vocab_size"},{anchor:"transformers.GraniteConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.GraniteConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.GraniteConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.GraniteConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.GraniteConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1</code> the model will use Multi Query Attention (MQA) otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
by meanpooling all the original heads within that group. For more details checkout <a href="https://arxiv.org/pdf/2305.13245.pdf" rel="nofollow">this
paper</a>. If it is not specified, will default to
<code>num_attention_heads</code>.`,name:"num_key_value_heads"},{anchor:"transformers.GraniteConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.GraniteConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.GraniteConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.GraniteConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.GraniteConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.GraniteConfig.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.GraniteConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
<code>{&quot;type&quot;: strategy name, &quot;factor&quot;: scaling factor}</code>. When using this flag, don&#x2019;t update
<code>max_position_embeddings</code> to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
<a href="https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/" rel="nofollow">https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/</a>. This is an
experimental feature, subject to breaking API changes in future versions.`,name:"rope_scaling"},{anchor:"transformers.GraniteConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</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.GraniteConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.GraniteConfig.mlp_bias",description:`<strong>mlp_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in up_proj, down_proj and gate_proj layers in the MLP layers.`,name:"mlp_bias"},{anchor:"transformers.GraniteConfig.embedding_multiplier",description:"<strong>embedding_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; embedding multiplier",name:"embedding_multiplier"},{anchor:"transformers.GraniteConfig.logits_scaling",description:"<strong>logits_scaling</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; divisor for output logits",name:"logits_scaling"},{anchor:"transformers.GraniteConfig.residual_multiplier",description:"<strong>residual_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; residual multiplier",name:"residual_multiplier"},{anchor:"transformers.GraniteConfig.attention_multiplier",description:"<strong>attention_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; attention multiplier",name:"attention_multiplier"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/configuration_granite.py#L30"}}),I=new rt({props:{anchor:"transformers.GraniteConfig.example",$$slots:{default:[ht]},$$scope:{ctx:z}}}),A=new pe({props:{title:"GraniteModel",local:"transformers.GraniteModel",headingTag:"h2"}}),Y=new me({props:{name:"class transformers.GraniteModel",anchor:"transformers.GraniteModel",parameters:[{name:"config",val:": GraniteConfig"}],parametersDescription:[{anchor:"transformers.GraniteModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteConfig">GraniteConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.GraniteModel.config",description:"<strong>config</strong> &#x2014; GraniteConfig",name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L502"}}),Q=new me({props:{name:"forward",anchor:"transformers.GraniteModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"**flash_attn_kwargs",val:": typing_extensions.Unpack[transformers.modeling_flash_attention_utils.FlashAttentionKwargs]"}],parametersDescription:[{anchor:"transformers.GraniteModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.GraniteModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>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.GraniteModel.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.GraniteModel.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/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our
<a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</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.GraniteModel.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.GraniteModel.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.GraniteModel.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.GraniteModel.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.GraniteModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GraniteModel.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/main/src/transformers/models/granite/modeling_granite.py#L537"}}),U=new st({props:{$$slots:{default:[ut]},$$scope:{ctx:z}}}),D=new pe({props:{title:"GraniteForCausalLM",local:"transformers.GraniteForCausalLM",headingTag:"h2"}}),O=new me({props:{name:"class transformers.GraniteForCausalLM",anchor:"transformers.GraniteForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L778"}}),K=new me({props:{name:"forward",anchor:"transformers.GraniteForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.List[torch.FloatTensor], NoneType] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"logits_to_keep",val:": typing.Union[int, torch.Tensor] = 0"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.granite.modeling_granite.KwargsForCausalLM]"}],parametersDescription:[{anchor:"transformers.GraniteForCausalLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.GraniteForCausalLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>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.GraniteForCausalLM.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.GraniteForCausalLM.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/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our
<a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GraniteForCausalLM.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.GraniteForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
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:"labels"},{anchor:"transformers.GraniteForCausalLM.forward.logits_to_keep",description:`<strong>logits_to_keep</strong> (<code>int</code> or <code>torch.Tensor</code>, <em>optional</em>) &#x2014;
If an <code>int</code>, compute logits for the last <code>logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
If a <code>torch.Tensor</code>, must be 1D corresponding to the indices to keep in the sequence length dimension.
This is useful when using packed tensor format (single dimension for batch and sequence length).`,name:"logits_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L810",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/granite#transformers.GraniteConfig"
>GraniteConfig</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/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),B=new st({props:{$$slots:{default:[ft]},$$scope:{ctx:z}}}),L=new rt({props:{anchor:"transformers.GraniteForCausalLM.forward.example",$$slots:{default:[gt]},$$scope:{ctx:z}}}),ee=new pt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/granite.md"}}),{c(){o=l("meta"),p=s(),i=l("p"),h=s(),u(k.$$.fragment),m=s(),G=l("div"),G.innerHTML=Xe,he=s(),u(Z.$$.fragment),ue=s(),P=l("p"),P.innerHTML=Ve,fe=s(),R=l("p"),R.textContent=Ne,ge=s(),H=l("p"),H.textContent=Ae,_e=s(),S=l("p"),S.innerHTML=Ye,be=s(),q=l("p"),q.textContent=Qe,ye=s(),u(E.$$.fragment),we=s(),X=l("p"),X.innerHTML=De,Te=s(),u(V.$$.fragment),Me=s(),M=l("div"),u(N.$$.fragment),Je=s(),oe=l("p"),oe.innerHTML=Oe,Ie=s(),ae=l("p"),ae.innerHTML=Ke,Ue=s(),u(I.$$.fragment),ve=s(),u(A.$$.fragment),ke=s(),T=l("div"),u(Y.$$.fragment),Be=s(),se=l("p"),se.innerHTML=et,Le=s(),re=l("p"),re.innerHTML=tt,Fe=s(),ie=l("p"),ie.innerHTML=nt,We=s(),x=l("div"),u(Q.$$.fragment),Ze=s(),le=l("p"),le.innerHTML=ot,Pe=s(),u(U.$$.fragment),Ge=s(),u(D.$$.fragment),$e=s(),j=l("div"),u(O.$$.fragment),Re=s(),$=l("div"),u(K.$$.fragment),He=s(),de=l("p"),de.innerHTML=at,Se=s(),u(B.$$.fragment),qe=s(),u(L.$$.fragment),Ce=s(),u(ee.$$.fragment),ze=s(),ce=l("p"),this.h()},l(e){const t=mt("svelte-u9bgzb",document.head);o=d(t,"META",{name:!0,content:!0}),t.forEach(n),p=r(e),i=d(e,"P",{}),ne(i).forEach(n),h=r(e),f(k.$$.fragment,e),m=r(e),G=d(e,"DIV",{class:!0,"data-svelte-h":!0}),w(G)!=="svelte-b95w5j"&&(G.innerHTML=Xe),he=r(e),f(Z.$$.fragment,e),ue=r(e),P=d(e,"P",{"data-svelte-h":!0}),w(P)!=="svelte-1jwf5c3"&&(P.innerHTML=Ve),fe=r(e),R=d(e,"P",{"data-svelte-h":!0}),w(R)!=="svelte-1hugs36"&&(R.textContent=Ne),ge=r(e),H=d(e,"P",{"data-svelte-h":!0}),w(H)!=="svelte-vfdo9a"&&(H.textContent=Ae),_e=r(e),S=d(e,"P",{"data-svelte-h":!0}),w(S)!=="svelte-16cvzw6"&&(S.innerHTML=Ye),be=r(e),q=d(e,"P",{"data-svelte-h":!0}),w(q)!=="svelte-axv494"&&(q.textContent=Qe),ye=r(e),f(E.$$.fragment,e),we=r(e),X=d(e,"P",{"data-svelte-h":!0}),w(X)!=="svelte-xzc2lh"&&(X.innerHTML=De),Te=r(e),f(V.$$.fragment,e),Me=r(e),M=d(e,"DIV",{class:!0});var C=ne(M);f(N.$$.fragment,C),Je=r(C),oe=d(C,"P",{"data-svelte-h":!0}),w(oe)!=="svelte-1lacj8j"&&(oe.innerHTML=Oe),Ie=r(C),ae=d(C,"P",{"data-svelte-h":!0}),w(ae)!=="svelte-o55m63"&&(ae.innerHTML=Ke),Ue=r(C),f(I.$$.fragment,C),C.forEach(n),ve=r(e),f(A.$$.fragment,e),ke=r(e),T=d(e,"DIV",{class:!0});var v=ne(T);f(Y.$$.fragment,v),Be=r(v),se=d(v,"P",{"data-svelte-h":!0}),w(se)!=="svelte-u6vuei"&&(se.innerHTML=et),Le=r(v),re=d(v,"P",{"data-svelte-h":!0}),w(re)!=="svelte-hswkmf"&&(re.innerHTML=tt),Fe=r(v),ie=d(v,"P",{"data-svelte-h":!0}),w(ie)!=="svelte-v5sw3z"&&(ie.innerHTML=nt),We=r(v),x=d(v,"DIV",{class:!0});var J=ne(x);f(Q.$$.fragment,J),Ze=r(J),le=d(J,"P",{"data-svelte-h":!0}),w(le)!=="svelte-m4rpo3"&&(le.innerHTML=ot),Pe=r(J),f(U.$$.fragment,J),J.forEach(n),v.forEach(n),Ge=r(e),f(D.$$.fragment,e),$e=r(e),j=d(e,"DIV",{class:!0});var te=ne(j);f(O.$$.fragment,te),Re=r(te),$=d(te,"DIV",{class:!0});var F=ne($);f(K.$$.fragment,F),He=r(F),de=d(F,"P",{"data-svelte-h":!0}),w(de)!=="svelte-1iuckjj"&&(de.innerHTML=at),Se=r(F),f(B.$$.fragment,F),qe=r(F),f(L.$$.fragment,F),F.forEach(n),te.forEach(n),Ce=r(e),f(ee.$$.fragment,e),ze=r(e),ce=d(e,"P",{}),ne(ce).forEach(n),this.h()},h(){W(o,"name","hf:doc:metadata"),W(o,"content",bt),W(G,"class","flex flex-wrap space-x-1"),W(M,"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(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),W(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){c(document.head,o),a(e,p,t),a(e,i,t),a(e,h,t),g(k,e,t),a(e,m,t),a(e,G,t),a(e,he,t),g(Z,e,t),a(e,ue,t),a(e,P,t),a(e,fe,t),a(e,R,t),a(e,ge,t),a(e,H,t),a(e,_e,t),a(e,S,t),a(e,be,t),a(e,q,t),a(e,ye,t),g(E,e,t),a(e,we,t),a(e,X,t),a(e,Te,t),g(V,e,t),a(e,Me,t),a(e,M,t),g(N,M,null),c(M,Je),c(M,oe),c(M,Ie),c(M,ae),c(M,Ue),g(I,M,null),a(e,ve,t),g(A,e,t),a(e,ke,t),a(e,T,t),g(Y,T,null),c(T,Be),c(T,se),c(T,Le),c(T,re),c(T,Fe),c(T,ie),c(T,We),c(T,x),g(Q,x,null),c(x,Ze),c(x,le),c(x,Pe),g(U,x,null),a(e,Ge,t),g(D,e,t),a(e,$e,t),a(e,j,t),g(O,j,null),c(j,Re),c(j,$),g(K,$,null),c($,He),c($,de),c($,Se),g(B,$,null),c($,qe),g(L,$,null),a(e,Ce,t),g(ee,e,t),a(e,ze,t),a(e,ce,t),xe=!0},p(e,[t]){const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),I.$set(C);const v={};t&2&&(v.$$scope={dirty:t,ctx:e}),U.$set(v);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),B.$set(J);const te={};t&2&&(te.$$scope={dirty:t,ctx:e}),L.$set(te)},i(e){xe||(_(k.$$.fragment,e),_(Z.$$.fragment,e),_(E.$$.fragment,e),_(V.$$.fragment,e),_(N.$$.fragment,e),_(I.$$.fragment,e),_(A.$$.fragment,e),_(Y.$$.fragment,e),_(Q.$$.fragment,e),_(U.$$.fragment,e),_(D.$$.fragment,e),_(O.$$.fragment,e),_(K.$$.fragment,e),_(B.$$.fragment,e),_(L.$$.fragment,e),_(ee.$$.fragment,e),xe=!0)},o(e){b(k.$$.fragment,e),b(Z.$$.fragment,e),b(E.$$.fragment,e),b(V.$$.fragment,e),b(N.$$.fragment,e),b(I.$$.fragment,e),b(A.$$.fragment,e),b(Y.$$.fragment,e),b(Q.$$.fragment,e),b(U.$$.fragment,e),b(D.$$.fragment,e),b(O.$$.fragment,e),b(K.$$.fragment,e),b(B.$$.fragment,e),b(L.$$.fragment,e),b(ee.$$.fragment,e),xe=!1},d(e){e&&(n(p),n(i),n(h),n(m),n(G),n(he),n(ue),n(P),n(fe),n(R),n(ge),n(H),n(_e),n(S),n(be),n(q),n(ye),n(we),n(X),n(Te),n(Me),n(M),n(ve),n(ke),n(T),n(Ge),n($e),n(j),n(Ce),n(ze),n(ce)),n(o),y(k,e),y(Z,e),y(E,e),y(V,e),y(N),y(I),y(A,e),y(Y),y(Q),y(U),y(D,e),y(O),y(K),y(B),y(L),y(ee,e)}}}const bt='{"title":"Granite","local":"granite","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"GraniteConfig","local":"transformers.GraniteConfig","sections":[],"depth":2},{"title":"GraniteModel","local":"transformers.GraniteModel","sections":[],"depth":2},{"title":"GraniteForCausalLM","local":"transformers.GraniteForCausalLM","sections":[],"depth":2}],"depth":1}';function yt(z){return lt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ct extends dt{constructor(o){super(),ct(this,o,yt,_t,it,{})}}export{Ct as component};
