import{s as wn,f as Mn,o as Cn,n as bo}from"../chunks/scheduler.25b97de1.js";import{S as Jn,i as kn,g as l,s as n,r as m,A as $n,h as d,f as t,c as a,j as z,u as h,x as _,k as v,y as r,a as s,v as p,d as u,t as f,w as g}from"../chunks/index.d9030fc9.js";import{T as Rt}from"../chunks/Tip.baa67368.js";import{D as U}from"../chunks/Docstring.e257edda.js";import{C as Se}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Pt}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as M,E as zn}from"../chunks/EditOnGithub.91d95064.js";function In(I){let i,T;return i=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvbk1vZGVsJTJDJTIwQ2hhbWVsZW9uQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMGNoYW1lbGVvbiUyMGNoYW1lbGVvbi03YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBDaGFtZWxlb25Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBjaGFtZWxlb24tN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonModel, ChameleonConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a chameleon chameleon-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChameleonConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the chameleon-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChameleonModel(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(){m(i.$$.fragment)},l(c){h(i.$$.fragment,c)},m(c,y){p(i,c,y),T=!0},p:bo,i(c){T||(u(i.$$.fragment,c),T=!0)},o(c){f(i.$$.fragment,c),T=!1},d(c){g(i,c)}}}function xn(I){let i,T=`Although the recipe for forward pass needs to be defined within
this function, one should call the <code>Module</code> instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=T},l(c){i=d(c,"P",{"data-svelte-h":!0}),_(i)!=="svelte-rqqap8"&&(i.innerHTML=T)},m(c,y){s(c,i,y)},p:bo,d(c){c&&t(i)}}}function jn(I){let i,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=T},l(c){i=d(c,"P",{"data-svelte-h":!0}),_(i)!=="svelte-fincs2"&&(i.innerHTML=T)},m(c,y){s(c,i,y)},p:bo,d(c){c&&t(i)}}}function Wn(I){let i,T="Example:",c,y,w;return y=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDaGFtZWxlb25Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWV0YSUyRmNoYW1lbGVvbi03YiUyMiklMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtZXRhJTJGY2hhbWVsZW9uLTdiJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ChameleonModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){i=l("p"),i.textContent=T,c=n(),m(y.$$.fragment)},l(b){i=d(b,"P",{"data-svelte-h":!0}),_(i)!=="svelte-11lpom8"&&(i.textContent=T),c=a(b),h(y.$$.fragment,b)},m(b,C){s(b,i,C),s(b,c,C),p(y,b,C),w=!0},p:bo,i(b){w||(u(y.$$.fragment,b),w=!0)},o(b){f(y.$$.fragment,b),w=!1},d(b){b&&(t(i),t(c)),g(y,b)}}}function Un(I){let i,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=T},l(c){i=d(c,"P",{"data-svelte-h":!0}),_(i)!=="svelte-fincs2"&&(i.innerHTML=T)},m(c,y){s(c,i,y)},p:bo,d(c){c&&t(i)}}}function Gn(I){let i,T="Example:",c,y,w;return y=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvblByb2Nlc3NvciUyQyUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZjaGFtZWxlb24tN2IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KSUwQXByb2Nlc3NvciUyMCUzRCUyMENoYW1lbGVvblByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZjaGFtZWxlb24tN2IlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySSUyMHVzZWQlMjB0byUyMGtub3clMjBhJTIwbG90JTIwYWJvdXQlMjBjb25zdGVsbGF0aW9ucyUyMHdoZW4lMjBJJTIwd2FzJTIweW91bmdlciUyQyUyMGJ1dCUyMGFzJTIwSSUyMGdyZXclMjBvbGRlciUyQyUyMEklMjBmb3Jnb3QlMjBtb3N0JTIwb2YlMjB3aGF0JTIwSSUyMGtuZXcuJTIwVGhlc2UlMjBhcmUlMjB0aGUlMjBvbmx5JTIwdHdvJTIwY29uc3RlbGxhdGlvbnMlMjB0aGF0JTIwSSUyMHJlYWxseSUyMHJlbWVtYmVyJTIwbm93LiUzQ2ltYWdlJTNFJTNDaW1hZ2UlM0VJJTIwd291bGQlMjBsaWtlJTIwZm9yJTIweW91JTIwdG8lMjB0ZWxsJTIwbWUlMjBhYm91dCUyMDMlMjBtb3JlJTIwY29uc3RlbGxhdGlvbnMlMjBhbmQlMjBnaXZlJTIwbWUlMjBhJTIwbGl0dGxlJTIwYml0JTIwb2YlMjBoaXN0b3J5JTIwYWJvdXQlMjB0aGUlMjBjb25zdGVsbGF0aW9uLiUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQoJTIyaHR0cHMlM0ElMkYlMkZuaW5lcGxhbmV0cy5vcmclMkZ3cC1jb250ZW50JTJGdXBsb2FkcyUyRjIwMjAlMkYxMiUyRnRoZS1iaWctZGlwcGVyLTEuanBnJTIyJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWltYWdlXzIlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCglMjJodHRwcyUzQSUyRiUyRnd3dy5reGFuLmNvbSUyRndwLWNvbnRlbnQlMkZ1cGxvYWRzJTJGc2l0ZXMlMkY0MCUyRjIwMjAlMkYxMCUyRk9SSU9OLmpwZyUyMiUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IocHJvbXB0JTJDJTIwaW1hZ2VzJTNEJTVCaW1hZ2UlMkMlMjBpbWFnZV8yJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8obW9kZWwuZGV2aWNlJTJDJTIwdG9yY2guYmZsb2F0MTYpJTBBJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0QxMDAlMkMlMjBkb19zYW1wbGUlM0RGYWxzZSklMEFwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlZF9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonProcessor, ChameleonForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, torch_dtype=torch.bfloat16)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ChameleonProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;I used to know a lot about constellations when I was younger, but as I grew older, I forgot most of what I knew. These are the only two constellations that I really remember now.&lt;image&gt;&lt;image&gt;I would like for you to tell me about 3 more constellations and give me a little bit of history about the constellation.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(<span class="hljs-string">&quot;https://nineplanets.org/wp-content/uploads/2020/12/the-big-dipper-1.jpg&quot;</span>, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_2 = Image.<span class="hljs-built_in">open</span>(requests.get(<span class="hljs-string">&quot;https://www.kxan.com/wp-content/uploads/sites/40/2020/10/ORION.jpg&quot;</span>, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(prompt, images=[image, image_2], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(model.device, torch.bfloat16)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">100</span>, do_sample=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){i=l("p"),i.textContent=T,c=n(),m(y.$$.fragment)},l(b){i=d(b,"P",{"data-svelte-h":!0}),_(i)!=="svelte-11lpom8"&&(i.textContent=T),c=a(b),h(y.$$.fragment,b)},m(b,C){s(b,i,C),s(b,c,C),p(y,b,C),w=!0},p:bo,i(b){w||(u(y.$$.fragment,b),w=!0)},o(b){f(y.$$.fragment,b),w=!1},d(b){b&&(t(i),t(c)),g(y,b)}}}function Zn(I){let i,T,c,y,w,b,C,To,ne,qt='The Chameleon model was proposed in <a href="https://arxiv.org/abs/2405.09818v1" rel="nofollow">Chameleon: Mixed-Modal Early-Fusion Foundation Models</a> by META AI Chameleon Team. Chameleon is a Vision-Language Model that use vector quantization to tokenize images which enables the model to generate multimodal output. The model takes images and texts as input, including an interleaved format, and generates textual response. Image generation module is not released yet.',vo,ae,Ht="The abstract from the paper is the following:",wo,se,Et=`<em>We present Chameleon, a family of early-fusion token-based mixed-modal models capable of understanding and generating images and text in any arbitrary sequence. We outline a stable training
approach from inception, an alignment recipe, and an architectural parameterization tailored for the
early-fusion, token-based, mixed-modal setting. The models are evaluated on a comprehensive range
of tasks, including visual question answering, image captioning, text generation, image generation, and
long-form mixed modal generation. Chameleon demonstrates broad and general capabilities, including
state-of-the-art performance in image captioning tasks, outperforms Llama-2 in text-only tasks while
being competitive with models such as Mixtral 8x7B and Gemini-Pro, and performs non-trivial image
generation, all in a single model. It also matches or exceeds the performance of much larger models,
including Gemini Pro and GPT-4V, according to human judgments on a new long-form mixed-modal
generation evaluation, where either the prompt or outputs contain mixed sequences of both images and
text. Chameleon marks a significant step forward in unified modeling of full multimodal documents</em>`,Mo,H,Yt,Co,re,Lt='Chameleon incorporates a vector quantizer module to transform images into discrete tokens. That also enables image generation using an auto-regressive transformer. Taken from the <a href="https://arxiv.org/abs/2405.09818v1">original paper.</a>',Jo,ie,Qt=`This model was contributed by <a href="https://huggingface.co/joaogante" rel="nofollow">joaogante</a> and <a href="https://huggingface.co/RaushanTurganbay" rel="nofollow">RaushanTurganbay</a>.
The original code can be found <a href="https://github.com/facebookresearch/chameleon" rel="nofollow">here</a>.`,ko,le,$o,de,Xt="<li><p>We advise users to use <code>padding_side=&quot;left&quot;</code> when computing batched generation as it leads to more accurate results. Simply make sure to set <code>processor.tokenizer.padding_side = &quot;left&quot;</code> before generating.</p></li> <li><p>Note that Chameleon was tuned for safety alignment. If the model is refusing to answer, consider asking a more concrete question, instead of an open question.</p></li> <li><p>Chameleon generates in chat format which means that the generated text will always be the “assistant’s turn”. You can enable a text completion generation by passing <code>return_for_text_completion=True</code> when calling the processor.</p></li>",zo,ce,St=`<p>[!NOTE]
Chameleon implementation in Transformers uses a special image token to indicate where to merge image embeddings. For special image token we didn’t add a new one but used one of the reserved tokens: <code>&lt;reserved08707&gt;</code>. You have to add <code>&lt;image&gt;</code> to your prompt in the place where the image should be embedded for correct generation.</p>`,Io,me,xo,he,jo,pe,At=`Chameleon is a gated model so make sure to have access and login to Hugging Face Hub using a token.
Here’s how to load the model and perform inference in half-precision (<code>torch.bfloat16</code>):`,Wo,ue,Uo,fe,Go,ge,Dt="Chameleon can perform inference with multiple images as input, where images either belong to the same prompt or different prompts (in batched inference). Here is how you can do it:",Zo,_e,Vo,be,Bo,ye,Fo,Te,Ot="The model can be loaded in 8 or 4 bits, greatly reducing the memory requirements while maintaining the performance of the original model. First make sure to install bitsandbytes, <code>pip install bitsandbytes</code> and make sure to have access to a CUDA compatible GPU device. Simply change the snippet above with:",No,ve,Ro,we,Po,Me,Kt='The models supports both, Flash-Attention 2 and PyTorch’s <a href="https://pytorch.org/docs/master/generated/torch.nn.functional.scaled_dot_product_attention.html" rel="nofollow"><code>torch.nn.functional.scaled_dot_product_attention</code></a> which can be enables for optimization. SDPA is the default options when you load the model, If you want to switch for Flash Attention 2, first make sure to install flash-attn. Refer to the <a href="https://github.com/Dao-AILab/flash-attention" rel="nofollow">original repository</a> regarding that package installation. Simply change the snippet above with:',qo,Ce,Ho,Je,Eo,x,ke,it,Ae,en=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonModel">ChameleonModel</a>. It is used to instantiate a
chameleon 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
<a href="https://huggingface.co/meta/chameleon-7B" rel="nofollow">meta/chameleon-7B</a>.`,lt,De,on=`Configuration objects inherit from <a href="/docs/transformers/pr_30962/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_30962/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,dt,E,Yo,$e,Lo,P,ze,ct,Oe,tn=`This is the configuration class to store the configuration of a <code>ChameleonVQModel</code>. It is used to instantiate a
<code>ChameleonVQModel</code> according to the specified arguments, defining the model architecture.
Configuration objects inherit from <a href="/docs/transformers/pr_30962/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_30962/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information. Instantiating a
configuration with the defaults will yield a similar configuration to the VQModel of the
<a href="https://huggingface.co/meta/chameleon-7B" rel="nofollow">meta/chameleon-7B</a>.`,Qo,Ie,Xo,J,xe,mt,Ke,nn=`Constructs a Chameleon processor which wraps a Chameleon image processor and a Chameleon tokenizer into a single
processor.`,ht,eo,an=`<a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonProcessor">ChameleonProcessor</a> offers all the functionalities of <a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonImageProcessor">ChameleonImageProcessor</a> and <a href="/docs/transformers/pr_30962/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>.
See the <code>__call__()</code> and <a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonProcessor.decode">decode()</a> for more information.`,pt,Y,je,ut,oo,sn=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/pr_30962/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,ft,L,We,gt,to,rn=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/pr_30962/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,So,Ue,Ao,B,Ge,_t,no,ln="Constructs a Chameleon image processor.",bt,Q,Ze,yt,ao,dn="Preprocess an image or batch of images.",Do,Ve,Oo,k,Be,Tt,so,cn=`The VQ-VAE model used in Chameleon for encoding/decoding images into discrete tokens.
This model follows the “Make-a-scene: Scene-based text-to-image generation with human priors” paper from
<a href="https://arxiv.org/abs/2203.13131" rel="nofollow">Oran Gafni, Adam Polyak, Oron Ashual, Shelly Sheynin, Devi Parikh, and Yaniv Taigman</a>.`,vt,ro,mn=`This model inherits from <a href="/docs/transformers/pr_30962/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.)`,wt,io,hn=`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.`,Mt,G,Fe,Ct,lo,pn="Define the computation performed at every call.",Jt,co,un="Should be overridden by all subclasses.",kt,X,Ko,Ne,et,$,Re,$t,mo,fn=`The bare chameleon Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/pr_30962/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.)`,zt,ho,gn=`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.`,It,po,_n="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>ChameleonDecoderLayer</code>",xt,Z,Pe,jt,uo,bn='The <a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonModel">ChameleonModel</a> forward method, overrides the <code>__call__</code> special method.',Wt,S,Ut,A,ot,qe,tt,j,He,Gt,fo,yn=`Chameleon Model with a head on top used for outputting logits for next token prediction.
This model inherits from <a href="/docs/transformers/pr_30962/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.)`,Zt,go,Tn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Vt,V,Ee,Bt,_o,vn='The <a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonForConditionalGeneration">ChameleonForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Ft,D,Nt,O,nt,Ye,at,yo,st;return w=new M({props:{title:"Chameleon",local:"chameleon",headingTag:"h1"}}),C=new M({props:{title:"Overview",local:"overview",headingTag:"h2"}}),le=new M({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),me=new M({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),he=new M({props:{title:"Single image inference",local:"single-image-inference",headingTag:"h3"}}),ue=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvblByb2Nlc3NvciUyQyUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBDaGFtZWxlb25Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGY2hhbWVsZW9uLTdiJTIyKSUwQW1vZGVsJTIwJTNEJTIwQ2hhbWVsZW9uRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmNoYW1lbGVvbi03YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyY3VkYSUyMiklMEElMEElMjMlMjBwcmVwYXJlJTIwaW1hZ2UlMjBhbmQlMjB0ZXh0JTIwcHJvbXB0JTBBdXJsJTIwJTNEJTIwJ2h0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGcnJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBcHJvbXB0JTIwJTNEJTIwJTIyV2hhdCUyMGRvJTIweW91JTIwc2VlJTIwaW4lMjB0aGlzJTIwaW1hZ2UlM0YlM0NpbWFnZSUzRSUyMiUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcihwcm9tcHQlMkMlMjBpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnRvKG1vZGVsLmRldmljZSklMEElMEElMjMlMjBhdXRvcmVncmVzc2l2ZWx5JTIwY29tcGxldGUlMjBwcm9tcHQlMEFvdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMG1heF9uZXdfdG9rZW5zJTNENTApJTBBcHJpbnQocHJvY2Vzc29yLmRlY29kZShvdXRwdXQlNUIwJTVEJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonProcessor, ChameleonForConditionalGeneration
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests

processor = ChameleonProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>)
model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, torch_dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># prepare image and text prompt</span>
url = <span class="hljs-string">&#x27;http://images.cocodataset.org/val2017/000000039769.jpg&#x27;</span>
image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
prompt = <span class="hljs-string">&quot;What do you see in this image?&lt;image&gt;&quot;</span>

inputs = processor(prompt, image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(model.device)

<span class="hljs-comment"># autoregressively complete prompt</span>
output = model.generate(**inputs, max_new_tokens=<span class="hljs-number">50</span>)
<span class="hljs-built_in">print</span>(processor.decode(output[<span class="hljs-number">0</span>], skip_special_tokens=<span class="hljs-literal">True</span>))`,wrap:!1}}),fe=new M({props:{title:"Multi image inference",local:"multi-image-inference",headingTag:"h3"}}),_e=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvblByb2Nlc3NvciUyQyUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBDaGFtZWxlb25Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGY2hhbWVsZW9uLTdiJTIyKSUwQSUwQW1vZGVsJTIwJTNEJTIwQ2hhbWVsZW9uRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmNoYW1lbGVvbi03YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyY3VkYSUyMiklMEElMEElMjMlMjBHZXQlMjB0aHJlZSUyMGRpZmZlcmVudCUyMGltYWdlcyUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGd3d3LmlsYW5rZWxtYW4ub3JnJTJGc3RvcHNpZ25zJTJGYXVzdHJhbGlhLmpwZyUyMiUwQWltYWdlX3N0b3AlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlX2NhdHMlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRm1pY3Jvc29mdCUyRmtvc21vcy0yLXBhdGNoMTQtMjI0JTJGcmVzb2x2ZSUyRm1haW4lMkZzbm93bWFuLmpwZyUyMiUwQWltYWdlX3Nub3dtYW4lMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBJTIzJTIwUHJlcGFyZSUyMGElMjBiYXRjaGVkJTIwcHJvbXB0JTJDJTIwd2hlcmUlMjB0aGUlMjBmaXJzdCUyMG9uZSUyMGlzJTIwYSUyMG11bHRpLWltYWdlJTIwcHJvbXB0JTIwYW5kJTIwdGhlJTIwc2Vjb25kJTIwaXMlMjBub3QlMEFwcm9tcHRzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIyV2hhdCUyMGRvJTIwdGhlc2UlMjBpbWFnZXMlMjBoYXZlJTIwaW4lMjBjb21tb24lM0YlM0NpbWFnZSUzRSUzQ2ltYWdlJTNFJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyJTNDaW1hZ2UlM0VXaGF0JTIwaXMlMjBzaG93biUyMGluJTIwdGhpcyUyMGltYWdlJTNGJTIyJTBBJTVEJTBBJTBBJTIzJTIwV2UlMjBjYW4lMjBzaW1wbHklMjBmZWVkJTIwaW1hZ2VzJTIwaW4lMjB0aGUlMjBvcmRlciUyMHRoZXklMjBoYXZlJTIwdG8lMjBiZSUyMHVzZWQlMjBpbiUyMHRoZSUyMHRleHQlMjBwcm9tcHQlMEElMjMlMjBFYWNoJTIwJTIyJTNDaW1hZ2UlM0UlMjIlMjB0b2tlbiUyMHVzZXMlMjBvbmUlMjBpbWFnZSUyMGxlYXZpbmclMjB0aGUlMjBuZXh0JTIwZm9yJTIwdGhlJTIwc3Vic2VxdWVudCUyMCUyMiUzQ2ltYWdlJTNFJTIyJTIwdG9rZW5zJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0Rwcm9tcHRzJTJDJTIwaW1hZ2VzJTNEJTVCaW1hZ2Vfc3RvcCUyQyUyMGltYWdlX2NhdHMlMkMlMjBpbWFnZV9zbm93bWFuJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhkZXZpY2UlM0QlMjJjdWRhJTIyJTJDJTIwZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEElMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0Q1MCklMEFwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonProcessor, ChameleonForConditionalGeneration
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests

processor = ChameleonProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>)

model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, torch_dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># Get three different images</span>
url = <span class="hljs-string">&quot;https://www.ilankelman.org/stopsigns/australia.jpg&quot;</span>
image_stop = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
image_cats = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

url = <span class="hljs-string">&quot;https://huggingface.co/microsoft/kosmos-2-patch14-224/resolve/main/snowman.jpg&quot;</span>
image_snowman = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-comment"># Prepare a batched prompt, where the first one is a multi-image prompt and the second is not</span>
prompts = [
    <span class="hljs-string">&quot;What do these images have in common?&lt;image&gt;&lt;image&gt;&quot;</span>,
    <span class="hljs-string">&quot;&lt;image&gt;What is shown in this image?&quot;</span>
]

<span class="hljs-comment"># We can simply feed images in the order they have to be used in the text prompt</span>
<span class="hljs-comment"># Each &quot;&lt;image&gt;&quot; token uses one image leaving the next for the subsequent &quot;&lt;image&gt;&quot; tokens</span>
inputs = processor(text=prompts, images=[image_stop, image_cats, image_snowman], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device=<span class="hljs-string">&quot;cuda&quot;</span>, dtype=torch.bfloat16)

<span class="hljs-comment"># Generate</span>
generate_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">50</span>)
processor.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)`,wrap:!1}}),be=new M({props:{title:"Model optimization",local:"model-optimization",headingTag:"h2"}}),ye=new M({props:{title:"Quantization using Bitsandbytes",local:"quantization-using-bitsandbytes",headingTag:"h3"}}),ve=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUyQyUyMEJpdHNBbmRCeXRlc0NvbmZpZyUwQSUwQSUyMyUyMHNwZWNpZnklMjBob3clMjB0byUyMHF1YW50aXplJTIwdGhlJTIwbW9kZWwlMEFxdWFudGl6YXRpb25fY29uZmlnJTIwJTNEJTIwQml0c0FuZEJ5dGVzQ29uZmlnKCUwQSUyMCUyMCUyMCUyMGxvYWRfaW5fNGJpdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBibmJfNGJpdF9xdWFudF90eXBlJTNEJTIybmY0JTIyJTJDJTBBJTIwJTIwJTIwJTIwYm5iXzRiaXRfY29tcHV0ZV9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTBBKSUwQSUwQW1vZGVsJTIwJTNEJTIwQ2hhbWVsZW9uRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmNoYW1lbGVvbi03YiUyMiUyQyUyMHF1YW50aXphdGlvbl9jb25maWclM0RxdWFudGl6YXRpb25fY29uZmlnJTJDJTIwZGV2aWNlX21hcCUzRCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonForConditionalGeneration, BitsAndBytesConfig

<span class="hljs-comment"># specify how to quantize the model</span>
quantization_config = BitsAndBytesConfig(
    load_in_4bit=<span class="hljs-literal">True</span>,
    bnb_4bit_quant_type=<span class="hljs-string">&quot;nf4&quot;</span>,
    bnb_4bit_compute_dtype=torch.bfloat16,
)

model = ChameleonForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>, quantization_config=quantization_config, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),we=new M({props:{title:"Use Flash-Attention 2 and SDPA to further speed-up generation",local:"use-flash-attention-2-and-sdpa-to-further-speed-up-generation",headingTag:"h3"}}),Ce=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyZmFjZWJvb2slMkZjaGFtZWxlb24tN2IlMjIlMEFtb2RlbCUyMCUzRCUyMENoYW1lbGVvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlMkMlMjAlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTIwJTBBJTIwJTIwJTIwJTIwbG93X2NwdV9tZW1fdXNhZ2UlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYXR0bl9pbXBsZW1lbnRhdGlvbiUzRCUyMmZsYXNoX2F0dGVudGlvbl8yJTIyJTBBKS50bygwKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChameleonForConditionalGeneration

model_id = <span class="hljs-string">&quot;facebook/chameleon-7b&quot;</span>
model = ChameleonForConditionalGeneration.from_pretrained(
    model_id, 
    torch_dtype=torch.bfloat16, 
    low_cpu_mem_usage=<span class="hljs-literal">True</span>,
    attn_implementation=<span class="hljs-string">&quot;flash_attention_2&quot;</span>
).to(<span class="hljs-number">0</span>)`,wrap:!1}}),Je=new M({props:{title:"ChameleonConfig",local:"transformers.ChameleonConfig",headingTag:"h2"}}),ke=new U({props:{name:"class transformers.ChameleonConfig",anchor:"transformers.ChameleonConfig",parameters:[{name:"vocab_size",val:" = 65536"},{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:" = 32"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 4096"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-05"},{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:"model_parallel_size",val:" = 1"},{name:"swin_norm",val:" = False"},{name:"vq_config",val:" = None"},{name:"vocabulary_map",val:" = None"},{name:"mlp_bias",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChameleonConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 65536) &#x2014;
Vocabulary size of the chameleon 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_30962/en/model_doc/chameleon#transformers.ChameleonModel">ChameleonModel</a>; this includes text and image tokens.`,name:"vocab_size"},{anchor:"transformers.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#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.ChameleonConfig.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.ChameleonConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
The maximum sequence length that this model might ever be used with. Chameleon supports up to 4096 tokens.`,name:"max_position_embeddings"},{anchor:"transformers.ChameleonConfig.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.ChameleonConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.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/Localchameleon/comments/14mrgpr/dynamically_scaled_rope_further_increases/" rel="nofollow">https://www.reddit.com/r/Localchameleon/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.ChameleonConfig.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.ChameleonConfig.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.ChameleonConfig.model_parallel_size",description:`<strong>model_parallel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of shards used when training the model. This will be used in qk layernorm because the original Chameleon inference
doesn&#x2019;t do reduction in those layers and each rank has its own biases.`,name:"model_parallel_size"},{anchor:"transformers.ChameleonConfig.swin_norm",description:`<strong>swin_norm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Use Swin Transformer normalization.`,name:"swin_norm"},{anchor:"transformers.ChameleonConfig.vq_config",description:`<strong>vq_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
ChameleonVQConfig instance containing the configuration for the VQ-VAE model.`,name:"vq_config"},{anchor:"transformers.ChameleonConfig.vocabulary_map",description:`<strong>vocabulary_map</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A dictionary containing the vocabulary map from the tokenizer. Used to obtain tokens from the image inputs.`,name:"vocabulary_map"},{anchor:"transformers.ChameleonConfig.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"}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/configuration_chameleon.py#L99"}}),E=new Pt({props:{anchor:"transformers.ChameleonConfig.example",$$slots:{default:[In]},$$scope:{ctx:I}}}),$e=new M({props:{title:"ChameleonVQVAEConfig",local:"transformers.ChameleonVQVAEConfig",headingTag:"h2"}}),ze=new U({props:{name:"class transformers.ChameleonVQVAEConfig",anchor:"transformers.ChameleonVQVAEConfig",parameters:[{name:"embed_dim",val:": int = 256"},{name:"num_embeddings",val:": int = 8192"},{name:"double_latent",val:": bool = False"},{name:"latent_channels",val:": int = 256"},{name:"resolution",val:": int = 512"},{name:"in_channels",val:": int = 3"},{name:"base_channels",val:": int = 128"},{name:"channel_multiplier",val:": List = [1, 1, 2, 2, 4]"},{name:"num_res_blocks",val:": int = 2"},{name:"attn_resolutions",val:": List = None"},{name:"dropout",val:": float = 0.0"},{name:"attn_type",val:": str = 'vanilla'"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChameleonVQVAEConfig.embed_dim",description:`<strong>embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Dimensionality of each embedding vector.`,name:"embed_dim"},{anchor:"transformers.ChameleonVQVAEConfig.num_embeddings",description:`<strong>num_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Number of codebook embeddings.`,name:"num_embeddings"},{anchor:"transformers.ChameleonVQVAEConfig.double_latent",description:`<strong>double_latent</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use double z channels.`,name:"double_latent"},{anchor:"transformers.ChameleonVQVAEConfig.latent_channels",description:`<strong>latent_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
Number of channels for the latent space.`,name:"latent_channels"},{anchor:"transformers.ChameleonVQVAEConfig.resolution",description:`<strong>resolution</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Resolution of the input images.`,name:"resolution"},{anchor:"transformers.ChameleonVQVAEConfig.in_channels",description:`<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of input channels.`,name:"in_channels"},{anchor:"transformers.ChameleonVQVAEConfig.base_channels",description:`<strong>base_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
Base channel count.`,name:"base_channels"},{anchor:"transformers.ChameleonVQVAEConfig.channel_multiplier",description:`<strong>channel_multiplier</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 1, 2, 2, 4]</code>) &#x2014;
Channel multipliers for each resolution.`,name:"channel_multiplier"},{anchor:"transformers.ChameleonVQVAEConfig.num_res_blocks",description:`<strong>num_res_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of residual blocks.`,name:"num_res_blocks"},{anchor:"transformers.ChameleonVQVAEConfig.attn_resolutions",description:`<strong>attn_resolutions</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Resolutions to apply attention.`,name:"attn_resolutions"},{anchor:"transformers.ChameleonVQVAEConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Dropout rate.`,name:"dropout"},{anchor:"transformers.ChameleonVQVAEConfig.attn_type",description:`<strong>attn_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;vanilla&quot;</code>) &#x2014;
Attention type used in VQ-GAN encoder. Can be &#x201C;vanilla&#x201D; or None.`,name:"attn_type"},{anchor:"transformers.ChameleonVQVAEConfig.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"}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/configuration_chameleon.py#L26"}}),Ie=new M({props:{title:"ChameleonProcessor",local:"transformers.ChameleonProcessor",headingTag:"h2"}}),xe=new U({props:{name:"class transformers.ChameleonProcessor",anchor:"transformers.ChameleonProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""},{name:"image_seq_length",val:": int = 1024"},{name:"image_token",val:": str = '<image>'"}],parametersDescription:[{anchor:"transformers.ChameleonProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonImageProcessor">ChameleonImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.ChameleonProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/pr_30962/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.ChameleonProcessor.image_seq_length",description:`<strong>image_seq_length</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Sequence length of one image embedding.`,name:"image_seq_length"},{anchor:"transformers.ChameleonProcessor.image_token",description:`<strong>image_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;image&gt;&quot;</code>) &#x2014;
The special token used to indicate image in the text.`,name:"image_token"}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/processing_chameleon.py#L28"}}),je=new U({props:{name:"batch_decode",anchor:"transformers.ChameleonProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/processing_chameleon.py#L142"}}),We=new U({props:{name:"decode",anchor:"transformers.ChameleonProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/processing_chameleon.py#L150"}}),Ue=new M({props:{title:"ChameleonImageProcessor",local:"transformers.ChameleonImageProcessor",headingTag:"h2"}}),Ge=new U({props:{name:"class transformers.ChameleonImageProcessor",anchor:"transformers.ChameleonImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = 1"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": Dict = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.0078"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChameleonImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ChameleonImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 512}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.ChameleonImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to 1) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ChameleonImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.ChameleonImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to {&#x201C;height&#x201D; &#x2014; 512, &#x201C;width&#x201D;: 512}):
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.ChameleonImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.ChameleonImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 0.0078) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.ChameleonImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.ChameleonImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[1.0, 1.0, 1.0]</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ChameleonImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[1.0, 1.0, 1.0]</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.ChameleonImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/image_processing_chameleon.py#L70"}}),Ze=new U({props:{name:"preprocess",anchor:"transformers.ChameleonImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": bool = None"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Optional = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"}],parametersDescription:[{anchor:"transformers.ChameleonImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ChameleonImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.ChameleonImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.ChameleonImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ChameleonImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ChameleonImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ChameleonImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.ChameleonImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ChameleonImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.ChameleonImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.ChameleonImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/image_processing_chameleon.py#L194"}}),Ve=new M({props:{title:"ChameleonVQVAE",local:"transformers.ChameleonVQVAE",headingTag:"h2"}}),Be=new U({props:{name:"class transformers.ChameleonVQVAE",anchor:"transformers.ChameleonVQVAE",parameters:[{name:"config",val:": ChameleonVQVAEConfig"}],parametersDescription:[{anchor:"transformers.ChameleonVQVAE.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonVQVAEConfig">ChameleonVQVAEConfig</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_30962/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_30962/src/transformers/models/chameleon/modeling_chameleon.py#L1044"}}),Fe=new U({props:{name:"_forward_unimplemented",anchor:"transformers.ChameleonVQVAE.forward",parameters:[{name:"*input",val:": Any"}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/torch/nn/modules/module.py#L341"}}),X=new Rt({props:{$$slots:{default:[xn]},$$scope:{ctx:I}}}),Ne=new M({props:{title:"ChameleonModel",local:"transformers.ChameleonModel",headingTag:"h2"}}),Re=new U({props:{name:"class transformers.ChameleonModel",anchor:"transformers.ChameleonModel",parameters:[{name:"config",val:": ChameleonConfig"}],parametersDescription:[{anchor:"transformers.ChameleonModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonConfig">ChameleonConfig</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_30962/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; ChameleonConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30962/src/transformers/models/chameleon/modeling_chameleon.py#L1247"}}),Pe=new U({props:{name:"forward",anchor:"transformers.ChameleonModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"pixel_values",val:": FloatTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.ChameleonModel.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_30962/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30962/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30962/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.ChameleonModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape \`(batch_size, num_channels, image_size, image_size)) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_30962/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30962/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">ChameleonImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChameleonModel.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_30962/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30962/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30962/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.ChameleonModel.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.ChameleonModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</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>Should always be a <a href="/docs/transformers/pr_30962/en/internal/generation_utils#transformers.Cache">Cache</a> instance and the model will output the same cache instance.
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.ChameleonModel.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.ChameleonModel.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.ChameleonModel.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.ChameleonModel.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.ChameleonModel.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_30962/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ChameleonModel.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_30962/src/transformers/models/chameleon/modeling_chameleon.py#L1299",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30962/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</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_30962/en/model_doc/chameleon#transformers.ChameleonConfig"
>ChameleonConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</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>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-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_30962/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),S=new Rt({props:{$$slots:{default:[jn]},$$scope:{ctx:I}}}),A=new Pt({props:{anchor:"transformers.ChameleonModel.forward.example",$$slots:{default:[Wn]},$$scope:{ctx:I}}}),qe=new M({props:{title:"ChameleonForConditionalGeneration",local:"transformers.ChameleonForConditionalGeneration",headingTag:"h2"}}),He=new U({props:{name:"class transformers.ChameleonForConditionalGeneration",anchor:"transformers.ChameleonForConditionalGeneration",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ChameleonForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30962/en/model_doc/chameleon#transformers.ChameleonConfig">ChameleonConfig</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_30962/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_30962/src/transformers/models/chameleon/modeling_chameleon.py#L1500"}}),Ee=new U({props:{name:"forward",anchor:"transformers.ChameleonForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"pixel_values",val:": FloatTensor = 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"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.ChameleonForConditionalGeneration.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_30962/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30962/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30962/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.ChameleonForConditionalGeneration.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape \`(batch_size, num_channels, image_size, image_size)) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<a href="/docs/transformers/pr_30962/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30962/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__">ChameleonImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChameleonForConditionalGeneration.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_30962/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30962/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30962/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.ChameleonForConditionalGeneration.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.ChameleonForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</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>Should always be a <a href="/docs/transformers/pr_30962/en/internal/generation_utils#transformers.Cache">Cache</a> instance and the model will output the same cache instance.
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.ChameleonForConditionalGeneration.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.ChameleonForConditionalGeneration.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.ChameleonForConditionalGeneration.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.ChameleonForConditionalGeneration.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.ChameleonForConditionalGeneration.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_30962/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ChameleonForConditionalGeneration.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_30962/src/transformers/models/chameleon/modeling_chameleon.py#L1534",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/pr_30962/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_30962/en/model_doc/chameleon#transformers.ChameleonConfig"
>ChameleonConfig</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_30962/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new Rt({props:{$$slots:{default:[Un]},$$scope:{ctx:I}}}),O=new Pt({props:{anchor:"transformers.ChameleonForConditionalGeneration.forward.example",$$slots:{default:[Gn]},$$scope:{ctx:I}}}),Ye=new zn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/chameleon.md"}}),{c(){i=l("meta"),T=n(),c=l("p"),y=n(),m(w.$$.fragment),b=n(),m(C.$$.fragment),To=n(),ne=l("p"),ne.innerHTML=qt,vo=n(),ae=l("p"),ae.textContent=Ht,wo=n(),se=l("p"),se.innerHTML=Et,Mo=n(),H=l("img"),Co=n(),re=l("small"),re.innerHTML=Lt,Jo=n(),ie=l("p"),ie.innerHTML=Qt,ko=n(),m(le.$$.fragment),$o=n(),de=l("ul"),de.innerHTML=Xt,zo=n(),ce=l("blockquote"),ce.innerHTML=St,Io=n(),m(me.$$.fragment),xo=n(),m(he.$$.fragment),jo=n(),pe=l("p"),pe.innerHTML=At,Wo=n(),m(ue.$$.fragment),Uo=n(),m(fe.$$.fragment),Go=n(),ge=l("p"),ge.textContent=Dt,Zo=n(),m(_e.$$.fragment),Vo=n(),m(be.$$.fragment),Bo=n(),m(ye.$$.fragment),Fo=n(),Te=l("p"),Te.innerHTML=Ot,No=n(),m(ve.$$.fragment),Ro=n(),m(we.$$.fragment),Po=n(),Me=l("p"),Me.innerHTML=Kt,qo=n(),m(Ce.$$.fragment),Ho=n(),m(Je.$$.fragment),Eo=n(),x=l("div"),m(ke.$$.fragment),it=n(),Ae=l("p"),Ae.innerHTML=en,lt=n(),De=l("p"),De.innerHTML=on,dt=n(),m(E.$$.fragment),Yo=n(),m($e.$$.fragment),Lo=n(),P=l("div"),m(ze.$$.fragment),ct=n(),Oe=l("p"),Oe.innerHTML=tn,Qo=n(),m(Ie.$$.fragment),Xo=n(),J=l("div"),m(xe.$$.fragment),mt=n(),Ke=l("p"),Ke.textContent=nn,ht=n(),eo=l("p"),eo.innerHTML=an,pt=n(),Y=l("div"),m(je.$$.fragment),ut=n(),oo=l("p"),oo.innerHTML=sn,ft=n(),L=l("div"),m(We.$$.fragment),gt=n(),to=l("p"),to.innerHTML=rn,So=n(),m(Ue.$$.fragment),Ao=n(),B=l("div"),m(Ge.$$.fragment),_t=n(),no=l("p"),no.textContent=ln,bt=n(),Q=l("div"),m(Ze.$$.fragment),yt=n(),ao=l("p"),ao.textContent=dn,Do=n(),m(Ve.$$.fragment),Oo=n(),k=l("div"),m(Be.$$.fragment),Tt=n(),so=l("p"),so.innerHTML=cn,vt=n(),ro=l("p"),ro.innerHTML=mn,wt=n(),io=l("p"),io.innerHTML=hn,Mt=n(),G=l("div"),m(Fe.$$.fragment),Ct=n(),lo=l("p"),lo.textContent=pn,Jt=n(),co=l("p"),co.textContent=un,kt=n(),m(X.$$.fragment),Ko=n(),m(Ne.$$.fragment),et=n(),$=l("div"),m(Re.$$.fragment),$t=n(),mo=l("p"),mo.innerHTML=fn,zt=n(),ho=l("p"),ho.innerHTML=gn,It=n(),po=l("p"),po.innerHTML=_n,xt=n(),Z=l("div"),m(Pe.$$.fragment),jt=n(),uo=l("p"),uo.innerHTML=bn,Wt=n(),m(S.$$.fragment),Ut=n(),m(A.$$.fragment),ot=n(),m(qe.$$.fragment),tt=n(),j=l("div"),m(He.$$.fragment),Gt=n(),fo=l("p"),fo.innerHTML=yn,Zt=n(),go=l("p"),go.innerHTML=Tn,Vt=n(),V=l("div"),m(Ee.$$.fragment),Bt=n(),_o=l("p"),_o.innerHTML=vn,Ft=n(),m(D.$$.fragment),Nt=n(),m(O.$$.fragment),nt=n(),m(Ye.$$.fragment),at=n(),yo=l("p"),this.h()},l(e){const o=$n("svelte-u9bgzb",document.head);i=d(o,"META",{name:!0,content:!0}),o.forEach(t),T=a(e),c=d(e,"P",{}),z(c).forEach(t),y=a(e),h(w.$$.fragment,e),b=a(e),h(C.$$.fragment,e),To=a(e),ne=d(e,"P",{"data-svelte-h":!0}),_(ne)!=="svelte-nqrocv"&&(ne.innerHTML=qt),vo=a(e),ae=d(e,"P",{"data-svelte-h":!0}),_(ae)!=="svelte-vfdo9a"&&(ae.textContent=Ht),wo=a(e),se=d(e,"P",{"data-svelte-h":!0}),_(se)!=="svelte-b403ub"&&(se.innerHTML=Et),Mo=a(e),H=d(e,"IMG",{src:!0,alt:!0,width:!0}),Co=a(e),re=d(e,"SMALL",{"data-svelte-h":!0}),_(re)!=="svelte-tuggwl"&&(re.innerHTML=Lt),Jo=a(e),ie=d(e,"P",{"data-svelte-h":!0}),_(ie)!=="svelte-18is37e"&&(ie.innerHTML=Qt),ko=a(e),h(le.$$.fragment,e),$o=a(e),de=d(e,"UL",{"data-svelte-h":!0}),_(de)!=="svelte-1xww0u5"&&(de.innerHTML=Xt),zo=a(e),ce=d(e,"BLOCKQUOTE",{"data-svelte-h":!0}),_(ce)!=="svelte-1buypb9"&&(ce.innerHTML=St),Io=a(e),h(me.$$.fragment,e),xo=a(e),h(he.$$.fragment,e),jo=a(e),pe=d(e,"P",{"data-svelte-h":!0}),_(pe)!=="svelte-1mp252t"&&(pe.innerHTML=At),Wo=a(e),h(ue.$$.fragment,e),Uo=a(e),h(fe.$$.fragment,e),Go=a(e),ge=d(e,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-55qtep"&&(ge.textContent=Dt),Zo=a(e),h(_e.$$.fragment,e),Vo=a(e),h(be.$$.fragment,e),Bo=a(e),h(ye.$$.fragment,e),Fo=a(e),Te=d(e,"P",{"data-svelte-h":!0}),_(Te)!=="svelte-1ieu1in"&&(Te.innerHTML=Ot),No=a(e),h(ve.$$.fragment,e),Ro=a(e),h(we.$$.fragment,e),Po=a(e),Me=d(e,"P",{"data-svelte-h":!0}),_(Me)!=="svelte-131jlth"&&(Me.innerHTML=Kt),qo=a(e),h(Ce.$$.fragment,e),Ho=a(e),h(Je.$$.fragment,e),Eo=a(e),x=d(e,"DIV",{class:!0});var F=z(x);h(ke.$$.fragment,F),it=a(F),Ae=d(F,"P",{"data-svelte-h":!0}),_(Ae)!=="svelte-11eckly"&&(Ae.innerHTML=en),lt=a(F),De=d(F,"P",{"data-svelte-h":!0}),_(De)!=="svelte-lbfgjz"&&(De.innerHTML=on),dt=a(F),h(E.$$.fragment,F),F.forEach(t),Yo=a(e),h($e.$$.fragment,e),Lo=a(e),P=d(e,"DIV",{class:!0});var Le=z(P);h(ze.$$.fragment,Le),ct=a(Le),Oe=d(Le,"P",{"data-svelte-h":!0}),_(Oe)!=="svelte-5105or"&&(Oe.innerHTML=tn),Le.forEach(t),Qo=a(e),h(Ie.$$.fragment,e),Xo=a(e),J=d(e,"DIV",{class:!0});var W=z(J);h(xe.$$.fragment,W),mt=a(W),Ke=d(W,"P",{"data-svelte-h":!0}),_(Ke)!=="svelte-8u0vzv"&&(Ke.textContent=nn),ht=a(W),eo=d(W,"P",{"data-svelte-h":!0}),_(eo)!=="svelte-19kdxer"&&(eo.innerHTML=an),pt=a(W),Y=d(W,"DIV",{class:!0});var Qe=z(Y);h(je.$$.fragment,Qe),ut=a(Qe),oo=d(Qe,"P",{"data-svelte-h":!0}),_(oo)!=="svelte-1ws4ksw"&&(oo.innerHTML=sn),Qe.forEach(t),ft=a(W),L=d(W,"DIV",{class:!0});var Xe=z(L);h(We.$$.fragment,Xe),gt=a(Xe),to=d(Xe,"P",{"data-svelte-h":!0}),_(to)!=="svelte-vy4wd6"&&(to.innerHTML=rn),Xe.forEach(t),W.forEach(t),So=a(e),h(Ue.$$.fragment,e),Ao=a(e),B=d(e,"DIV",{class:!0});var q=z(B);h(Ge.$$.fragment,q),_t=a(q),no=d(q,"P",{"data-svelte-h":!0}),_(no)!=="svelte-p2ya4c"&&(no.textContent=ln),bt=a(q),Q=d(q,"DIV",{class:!0});var rt=z(Q);h(Ze.$$.fragment,rt),yt=a(rt),ao=d(rt,"P",{"data-svelte-h":!0}),_(ao)!=="svelte-1x3yxsa"&&(ao.textContent=dn),rt.forEach(t),q.forEach(t),Do=a(e),h(Ve.$$.fragment,e),Oo=a(e),k=d(e,"DIV",{class:!0});var N=z(k);h(Be.$$.fragment,N),Tt=a(N),so=d(N,"P",{"data-svelte-h":!0}),_(so)!=="svelte-1yzmrhf"&&(so.innerHTML=cn),vt=a(N),ro=d(N,"P",{"data-svelte-h":!0}),_(ro)!=="svelte-tz21u6"&&(ro.innerHTML=mn),wt=a(N),io=d(N,"P",{"data-svelte-h":!0}),_(io)!=="svelte-hswkmf"&&(io.innerHTML=hn),Mt=a(N),G=d(N,"DIV",{class:!0});var K=z(G);h(Fe.$$.fragment,K),Ct=a(K),lo=d(K,"P",{"data-svelte-h":!0}),_(lo)!=="svelte-1q5ym45"&&(lo.textContent=pn),Jt=a(K),co=d(K,"P",{"data-svelte-h":!0}),_(co)!=="svelte-w8wo9i"&&(co.textContent=un),kt=a(K),h(X.$$.fragment,K),K.forEach(t),N.forEach(t),Ko=a(e),h(Ne.$$.fragment,e),et=a(e),$=d(e,"DIV",{class:!0});var R=z($);h(Re.$$.fragment,R),$t=a(R),mo=d(R,"P",{"data-svelte-h":!0}),_(mo)!=="svelte-p26ey0"&&(mo.innerHTML=fn),zt=a(R),ho=d(R,"P",{"data-svelte-h":!0}),_(ho)!=="svelte-hswkmf"&&(ho.innerHTML=gn),It=a(R),po=d(R,"P",{"data-svelte-h":!0}),_(po)!=="svelte-18w1z2r"&&(po.innerHTML=_n),xt=a(R),Z=d(R,"DIV",{class:!0});var ee=z(Z);h(Pe.$$.fragment,ee),jt=a(ee),uo=d(ee,"P",{"data-svelte-h":!0}),_(uo)!=="svelte-1fn1c0h"&&(uo.innerHTML=bn),Wt=a(ee),h(S.$$.fragment,ee),Ut=a(ee),h(A.$$.fragment,ee),ee.forEach(t),R.forEach(t),ot=a(e),h(qe.$$.fragment,e),tt=a(e),j=d(e,"DIV",{class:!0});var oe=z(j);h(He.$$.fragment,oe),Gt=a(oe),fo=d(oe,"P",{"data-svelte-h":!0}),_(fo)!=="svelte-ep2bez"&&(fo.innerHTML=yn),Zt=a(oe),go=d(oe,"P",{"data-svelte-h":!0}),_(go)!=="svelte-hswkmf"&&(go.innerHTML=Tn),Vt=a(oe),V=d(oe,"DIV",{class:!0});var te=z(V);h(Ee.$$.fragment,te),Bt=a(te),_o=d(te,"P",{"data-svelte-h":!0}),_(_o)!=="svelte-uyc1yf"&&(_o.innerHTML=vn),Ft=a(te),h(D.$$.fragment,te),Nt=a(te),h(O.$$.fragment,te),te.forEach(t),oe.forEach(t),nt=a(e),h(Ye.$$.fragment,e),at=a(e),yo=d(e,"P",{}),z(yo).forEach(t),this.h()},h(){v(i,"name","hf:doc:metadata"),v(i,"content",Vn),Mn(H.src,Yt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/chameleon_arch.png")||v(H,"src",Yt),v(H,"alt","drawing"),v(H,"width","600"),v(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(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,o){r(document.head,i),s(e,T,o),s(e,c,o),s(e,y,o),p(w,e,o),s(e,b,o),p(C,e,o),s(e,To,o),s(e,ne,o),s(e,vo,o),s(e,ae,o),s(e,wo,o),s(e,se,o),s(e,Mo,o),s(e,H,o),s(e,Co,o),s(e,re,o),s(e,Jo,o),s(e,ie,o),s(e,ko,o),p(le,e,o),s(e,$o,o),s(e,de,o),s(e,zo,o),s(e,ce,o),s(e,Io,o),p(me,e,o),s(e,xo,o),p(he,e,o),s(e,jo,o),s(e,pe,o),s(e,Wo,o),p(ue,e,o),s(e,Uo,o),p(fe,e,o),s(e,Go,o),s(e,ge,o),s(e,Zo,o),p(_e,e,o),s(e,Vo,o),p(be,e,o),s(e,Bo,o),p(ye,e,o),s(e,Fo,o),s(e,Te,o),s(e,No,o),p(ve,e,o),s(e,Ro,o),p(we,e,o),s(e,Po,o),s(e,Me,o),s(e,qo,o),p(Ce,e,o),s(e,Ho,o),p(Je,e,o),s(e,Eo,o),s(e,x,o),p(ke,x,null),r(x,it),r(x,Ae),r(x,lt),r(x,De),r(x,dt),p(E,x,null),s(e,Yo,o),p($e,e,o),s(e,Lo,o),s(e,P,o),p(ze,P,null),r(P,ct),r(P,Oe),s(e,Qo,o),p(Ie,e,o),s(e,Xo,o),s(e,J,o),p(xe,J,null),r(J,mt),r(J,Ke),r(J,ht),r(J,eo),r(J,pt),r(J,Y),p(je,Y,null),r(Y,ut),r(Y,oo),r(J,ft),r(J,L),p(We,L,null),r(L,gt),r(L,to),s(e,So,o),p(Ue,e,o),s(e,Ao,o),s(e,B,o),p(Ge,B,null),r(B,_t),r(B,no),r(B,bt),r(B,Q),p(Ze,Q,null),r(Q,yt),r(Q,ao),s(e,Do,o),p(Ve,e,o),s(e,Oo,o),s(e,k,o),p(Be,k,null),r(k,Tt),r(k,so),r(k,vt),r(k,ro),r(k,wt),r(k,io),r(k,Mt),r(k,G),p(Fe,G,null),r(G,Ct),r(G,lo),r(G,Jt),r(G,co),r(G,kt),p(X,G,null),s(e,Ko,o),p(Ne,e,o),s(e,et,o),s(e,$,o),p(Re,$,null),r($,$t),r($,mo),r($,zt),r($,ho),r($,It),r($,po),r($,xt),r($,Z),p(Pe,Z,null),r(Z,jt),r(Z,uo),r(Z,Wt),p(S,Z,null),r(Z,Ut),p(A,Z,null),s(e,ot,o),p(qe,e,o),s(e,tt,o),s(e,j,o),p(He,j,null),r(j,Gt),r(j,fo),r(j,Zt),r(j,go),r(j,Vt),r(j,V),p(Ee,V,null),r(V,Bt),r(V,_o),r(V,Ft),p(D,V,null),r(V,Nt),p(O,V,null),s(e,nt,o),p(Ye,e,o),s(e,at,o),s(e,yo,o),st=!0},p(e,[o]){const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),E.$set(F);const Le={};o&2&&(Le.$$scope={dirty:o,ctx:e}),X.$set(Le);const W={};o&2&&(W.$$scope={dirty:o,ctx:e}),S.$set(W);const Qe={};o&2&&(Qe.$$scope={dirty:o,ctx:e}),A.$set(Qe);const Xe={};o&2&&(Xe.$$scope={dirty:o,ctx:e}),D.$set(Xe);const q={};o&2&&(q.$$scope={dirty:o,ctx:e}),O.$set(q)},i(e){st||(u(w.$$.fragment,e),u(C.$$.fragment,e),u(le.$$.fragment,e),u(me.$$.fragment,e),u(he.$$.fragment,e),u(ue.$$.fragment,e),u(fe.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(ye.$$.fragment,e),u(ve.$$.fragment,e),u(we.$$.fragment,e),u(Ce.$$.fragment,e),u(Je.$$.fragment,e),u(ke.$$.fragment,e),u(E.$$.fragment,e),u($e.$$.fragment,e),u(ze.$$.fragment,e),u(Ie.$$.fragment,e),u(xe.$$.fragment,e),u(je.$$.fragment,e),u(We.$$.fragment,e),u(Ue.$$.fragment,e),u(Ge.$$.fragment,e),u(Ze.$$.fragment,e),u(Ve.$$.fragment,e),u(Be.$$.fragment,e),u(Fe.$$.fragment,e),u(X.$$.fragment,e),u(Ne.$$.fragment,e),u(Re.$$.fragment,e),u(Pe.$$.fragment,e),u(S.$$.fragment,e),u(A.$$.fragment,e),u(qe.$$.fragment,e),u(He.$$.fragment,e),u(Ee.$$.fragment,e),u(D.$$.fragment,e),u(O.$$.fragment,e),u(Ye.$$.fragment,e),st=!0)},o(e){f(w.$$.fragment,e),f(C.$$.fragment,e),f(le.$$.fragment,e),f(me.$$.fragment,e),f(he.$$.fragment,e),f(ue.$$.fragment,e),f(fe.$$.fragment,e),f(_e.$$.fragment,e),f(be.$$.fragment,e),f(ye.$$.fragment,e),f(ve.$$.fragment,e),f(we.$$.fragment,e),f(Ce.$$.fragment,e),f(Je.$$.fragment,e),f(ke.$$.fragment,e),f(E.$$.fragment,e),f($e.$$.fragment,e),f(ze.$$.fragment,e),f(Ie.$$.fragment,e),f(xe.$$.fragment,e),f(je.$$.fragment,e),f(We.$$.fragment,e),f(Ue.$$.fragment,e),f(Ge.$$.fragment,e),f(Ze.$$.fragment,e),f(Ve.$$.fragment,e),f(Be.$$.fragment,e),f(Fe.$$.fragment,e),f(X.$$.fragment,e),f(Ne.$$.fragment,e),f(Re.$$.fragment,e),f(Pe.$$.fragment,e),f(S.$$.fragment,e),f(A.$$.fragment,e),f(qe.$$.fragment,e),f(He.$$.fragment,e),f(Ee.$$.fragment,e),f(D.$$.fragment,e),f(O.$$.fragment,e),f(Ye.$$.fragment,e),st=!1},d(e){e&&(t(T),t(c),t(y),t(b),t(To),t(ne),t(vo),t(ae),t(wo),t(se),t(Mo),t(H),t(Co),t(re),t(Jo),t(ie),t(ko),t($o),t(de),t(zo),t(ce),t(Io),t(xo),t(jo),t(pe),t(Wo),t(Uo),t(Go),t(ge),t(Zo),t(Vo),t(Bo),t(Fo),t(Te),t(No),t(Ro),t(Po),t(Me),t(qo),t(Ho),t(Eo),t(x),t(Yo),t(Lo),t(P),t(Qo),t(Xo),t(J),t(So),t(Ao),t(B),t(Do),t(Oo),t(k),t(Ko),t(et),t($),t(ot),t(tt),t(j),t(nt),t(at),t(yo)),t(i),g(w,e),g(C,e),g(le,e),g(me,e),g(he,e),g(ue,e),g(fe,e),g(_e,e),g(be,e),g(ye,e),g(ve,e),g(we,e),g(Ce,e),g(Je,e),g(ke),g(E),g($e,e),g(ze),g(Ie,e),g(xe),g(je),g(We),g(Ue,e),g(Ge),g(Ze),g(Ve,e),g(Be),g(Fe),g(X),g(Ne,e),g(Re),g(Pe),g(S),g(A),g(qe,e),g(He),g(Ee),g(D),g(O),g(Ye,e)}}}const Vn='{"title":"Chameleon","local":"chameleon","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Usage example","local":"usage-example","sections":[{"title":"Single image inference","local":"single-image-inference","sections":[],"depth":3},{"title":"Multi image inference","local":"multi-image-inference","sections":[],"depth":3}],"depth":2},{"title":"Model optimization","local":"model-optimization","sections":[{"title":"Quantization using Bitsandbytes","local":"quantization-using-bitsandbytes","sections":[],"depth":3},{"title":"Use Flash-Attention 2 and SDPA to further speed-up generation","local":"use-flash-attention-2-and-sdpa-to-further-speed-up-generation","sections":[],"depth":3}],"depth":2},{"title":"ChameleonConfig","local":"transformers.ChameleonConfig","sections":[],"depth":2},{"title":"ChameleonVQVAEConfig","local":"transformers.ChameleonVQVAEConfig","sections":[],"depth":2},{"title":"ChameleonProcessor","local":"transformers.ChameleonProcessor","sections":[],"depth":2},{"title":"ChameleonImageProcessor","local":"transformers.ChameleonImageProcessor","sections":[],"depth":2},{"title":"ChameleonVQVAE","local":"transformers.ChameleonVQVAE","sections":[],"depth":2},{"title":"ChameleonModel","local":"transformers.ChameleonModel","sections":[],"depth":2},{"title":"ChameleonForConditionalGeneration","local":"transformers.ChameleonForConditionalGeneration","sections":[],"depth":2}],"depth":1}';function Bn(I){return Cn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yn extends Jn{constructor(i){super(),kn(this,i,Bn,Zn,wn,{})}}export{Yn as component};
