import{s as nt,f as it,o as lt,n as st}from"../chunks/scheduler.25b97de1.js";import{S as ct,i as dt,g as i,s as r,r as m,A as mt,h as l,f as t,c as a,j as I,u as p,x as d,k as P,y as n,a as s,v as h,d as g,t as f,w as u}from"../chunks/index.d9030fc9.js";import{T as pt}from"../chunks/Tip.baa67368.js";import{D as q}from"../chunks/Docstring.ffac8efa.js";import{C as qo}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ht}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as D,E as gt}from"../chunks/EditOnGithub.91d95064.js";function ft(_e){let c,J="Example:",x,M,w;return M=new qo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBpeHRyYWxWaXNpb25Nb2RlbCUyQyUyMFBpeHRyYWxWaXNpb25Db25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwUGl4dHJhbC0xMkIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWclMjAlM0QlMjBQaXh0cmFsVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbWx5JTIwaW5pdGlhbGl6ZWQlMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBQaXh0cmFsVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PixtralVisionModel, PixtralVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Pixtral-12B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = PixtralVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with randomly initialized weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PixtralVisionModel(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(){c=i("p"),c.textContent=J,x=r(),m(M.$$.fragment)},l(_){c=l(_,"P",{"data-svelte-h":!0}),d(c)!=="svelte-11lpom8"&&(c.textContent=J),x=a(_),p(M.$$.fragment,_)},m(_,z){s(_,c,z),s(_,x,z),h(M,_,z),w=!0},p:st,i(_){w||(g(M.$$.fragment,_),w=!0)},o(_){f(M.$$.fragment,_),w=!1},d(_){_&&(t(c),t(x)),u(M,_)}}}function ut(_e){let c,J=`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(){c=i("p"),c.innerHTML=J},l(x){c=l(x,"P",{"data-svelte-h":!0}),d(c)!=="svelte-fincs2"&&(c.innerHTML=J)},m(x,M){s(x,c,M)},p:st,d(x){x&&t(c)}}}function _t(_e){let c,J,x,M,w,_,z,Ve,S,Ro='The Pixtral model was released by the Mistral AI team in a <a href="https://mistral.ai/news/pixtral-12b/" rel="nofollow">blog post</a>. Pixtral is a multimodal version of <a href="mistral">Mistral</a>, incorporating a 400 million parameter vision encoder trained from scratch.',Le,E,Vo="The intro from the blog says the following:",Fe,B,Lo="<em>Pixtral is trained to understand both natural images and documents, achieving 52.5% on the MMMU reasoning benchmark, surpassing a number of larger models. The model shows strong abilities in tasks such as chart and figure understanding, document question answering, multimodal reasoning and instruction following. Pixtral is able to ingest images at their natural resolution and aspect ratio, giving the user flexibility on the number of tokens used to process an image. Pixtral is also able to process any number of images in its long context window of 128K tokens. Unlike previous open-source models, Pixtral does not compromise on text benchmark performance to excel in multimodal tasks.</em>",Ne,R,Fo,Ge,H,No='Pixtral architecture. Taken from the <a href="https://mistral.ai/news/pixtral-12b/">blog post.</a>',We,Z,Go="Tips:",De,Q,Wo='<li>Pixtral is a multimodal model, taking images and text as input, and producing text as output.</li> <li>This model follows the <a href="llava">Llava</a> architecture. The model uses <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionModel">PixtralVisionModel</a> for its vision encoder, and <a href="/docs/transformers/main/en/model_doc/mistral#transformers.MistralForCausalLM">MistralForCausalLM</a> for its language decoder.</li> <li>The main contribution is the 2d ROPE (rotary position embeddings) on the images, and support for arbitrary image sizes (the images are not padded together nor are they resized).</li> <li>Similar to <a href="llava">Llava</a>, the model internally replaces the <code>[IMG]</code> token placeholders by image embeddings from the vision encoder. The format for one or multiple prompts is the following:</li>',Se,X,Ee,A,Do='Then, the processor will replace each <code>[IMG]</code> token with a number of <code>[IMG]</code> tokens that depend on the height and the width of each image. Each <em>row</em> of the image is separated by an <code>[IMG_BREAK]</code> token, and each image is separated by an <code>[IMG_END]</code> token. It’s advised to use the <code>apply_chat_template</code> method of the processor, which takes care of all of this and formats the text for you. If you’re using <code>transformers&gt;=4.49.0</code>, you can also get a vectorized output from <code>apply_chat_template</code>. See the <a href="#usage">usage section</a> for more info.',Be,Y,So='This model was contributed by <a href="https://huggingface.co/amyeroberts" rel="nofollow">amyeroberts</a> and <a href="https://huggingface.co/ArthurZ" rel="nofollow">ArthurZ</a>. The original code can be found <a href="https://github.com/vllm-project/vllm/pull/8377" rel="nofollow">here</a>.',He,O,Ze,K,Eo="At inference time, it’s advised to use the processor’s <code>apply_chat_template</code> method, which correctly formats the prompt for the model:",Qe,ee,Xe,oe,Ae,b,te,ho,xe,Bo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionModel">PixtralVisionModel</a>. It is used to instantiate an
Pixtral vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to the vision encoder used by Pixtral-12B.`,go,be,Ho='e.g. <a href="https://huggingface.co/pixtral-hf/pixtral-9b" rel="nofollow">pixtral-hf/pixtral-9b</a>',fo,ye,Zo=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,uo,V,Ye,re,Oe,v,ae,_o,Pe,Qo=`The bare Pixtral vision encoder outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,xo,Me,Xo=`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.`,bo,j,se,yo,ve,Ao='The <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionModel">PixtralVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Po,L,Ke,ne,eo,C,ie,Mo,Te,Yo="Constructs a Pixtral image processor.",vo,F,le,To,we,Oo="Preprocess an image or batch of images.",oo,ce,to,$,de,wo,Ie,Ko="Constructs a fast ConvNeXT image processor.",Io,N,me,zo,ze,et="Preprocess an image or batch of images.",ro,pe,ao,y,he,Co,Ce,ot="Constructs a Pixtral processor which wraps a Pixtral image processor and a Pixtral tokenizer into a single processor.",$o,$e,tt=`<a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralProcessor">PixtralProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/llama#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralProcessor.decode">decode()</a> for more information.`,Uo,G,ge,Jo,Ue,rt=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,jo,W,fe,ko,Je,at=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,so,ue,no,Re,io;return w=new D({props:{title:"Pixtral",local:"pixtral",headingTag:"h1"}}),z=new D({props:{title:"Overview",local:"overview",headingTag:"h2"}}),X=new qo({props:{code:"JTIyJTNDcyUzRSU1QklOU1QlNUQlNUJJTUclNUQlNUNuV2hhdCUyMGFyZSUyMHRoZSUyMHRoaW5ncyUyMEklMjBzaG91bGQlMjBiZSUyMGNhdXRpb3VzJTIwYWJvdXQlMjB3aGVuJTIwSSUyMHZpc2l0JTIwdGhpcyUyMHBsYWNlJTNGJTVCJTJGSU5TVCU1RCUyMg==",highlighted:'&quot;&lt;s&gt;<span class="hljs-selector-attr">[INST]</span><span class="hljs-selector-attr">[IMG]</span>\\nWhat are the things <span class="hljs-selector-tag">I</span> should be cautious about when <span class="hljs-selector-tag">I</span> visit this place?<span class="hljs-selector-attr">[/INST]</span>&quot;',wrap:!1}}),O=new D({props:{title:"Usage",local:"usage",headingTag:"h2"}}),ee=new qo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBMbGF2YUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybWlzdHJhbC1jb21tdW5pdHklMkZwaXh0cmFsLTEyYiUyMiUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkKSUwQW1vZGVsJTIwJTNEJTIwTGxhdmFGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwZGV2aWNlX21hcCUzRCUyMmN1ZGElMjIpJTBBJTBBY2hhdCUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkNhbiUyMHRoaXMlMjBhbmltYWwlMjIlN0QlMkMlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIyaW1hZ2UlMjIlMkMlMjAlMjJ1cmwlMjIlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnBpY3N1bS5waG90b3MlMkZpZCUyRjIzNyUyRjIwMCUyRjMwMCUyMiU3RCUyQyUyMCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMmxpdmUlMjBoZXJlJTNGJTIyJTdEJTJDJTIwJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMmltYWdlJTIyJTJDJTIwJTIydXJsJTIyJTNBJTIwJTIyaHR0cHMlM0ElMkYlMkZwaWNzdW0ucGhvdG9zJTJGc2VlZCUyRnBpY3N1bSUyRjIwMCUyRjMwMCUyMiU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCU3RCUwQSU1RCUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvci5hcHBseV9jaGF0X3RlbXBsYXRlKCUwQSUyMCUyMCUyMCUyMGNoYXQlMkMlMEElMjAlMjAlMjAlMjBhZGRfZ2VuZXJhdGlvbl9wcm9tcHQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX2RpY3QlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSkudG8obW9kZWwuZGV2aWNlKSUwQSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0Q1MDApJTBBb3V0cHV0JTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, LlavaForConditionalGeneration

model_id = <span class="hljs-string">&quot;mistral-community/pixtral-12b&quot;</span>
processor = AutoProcessor.from_pretrained(model_id)
model = LlavaForConditionalGeneration.from_pretrained(model_id, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)

chat = [
    {
      <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Can this animal&quot;</span>}, 
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;https://picsum.photos/id/237/200/300&quot;</span>}, 
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;live here?&quot;</span>}, 
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;https://picsum.photos/seed/picsum/200/300&quot;</span>}
      ]
    }
]

inputs = processor.apply_chat_template(
    chat,
    add_generation_prompt=<span class="hljs-literal">True</span>,
    tokenize=<span class="hljs-literal">True</span>,
    return_dict=<span class="hljs-literal">True</span>,
    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
).to(model.device)

generate_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">500</span>)
output = processor.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]`,wrap:!1}}),oe=new D({props:{title:"PixtralVisionConfig",local:"transformers.PixtralVisionConfig",headingTag:"h2"}}),te=new q({props:{name:"class transformers.PixtralVisionConfig",anchor:"transformers.PixtralVisionConfig",parameters:[{name:"hidden_size",val:" = 1024"},{name:"intermediate_size",val:" = 4096"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 1024"},{name:"patch_size",val:" = 16"},{name:"hidden_act",val:" = 'gelu'"},{name:"attention_dropout",val:" = 0.0"},{name:"rope_theta",val:" = 10000.0"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.PixtralVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.PixtralVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.PixtralVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.PixtralVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of input channels in the input images.`,name:"num_channels"},{anchor:"transformers.PixtralVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Max dimension of the input images.`,name:"image_size"},{anchor:"transformers.PixtralVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Size of the image patches.`,name:"patch_size"},{anchor:"transformers.PixtralVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
Activation function used in the hidden layers.`,name:"hidden_act"},{anchor:"transformers.PixtralVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Dropout probability for the attention layers.`,name:"attention_dropout"},{anchor:"transformers.PixtralVisionConfig.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.PixtralVisionConfig.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/main/src/transformers/models/pixtral/configuration_pixtral.py#L23"}}),V=new ht({props:{anchor:"transformers.PixtralVisionConfig.example",$$slots:{default:[ft]},$$scope:{ctx:_e}}}),re=new D({props:{title:"PixtralVisionModel",local:"transformers.PixtralVisionModel",headingTag:"h2"}}),ae=new q({props:{name:"class transformers.PixtralVisionModel",anchor:"transformers.PixtralVisionModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PixtralVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionConfig">PixtralVisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the vision encoder. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/modeling_pixtral.py#L456"}}),se=new q({props:{name:"forward",anchor:"transformers.PixtralVisionModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"image_sizes",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>AutoImageProcessor.__call__()</code>
for details.`,name:"pixel_values"},{anchor:"transformers.PixtralVisionModel.forward.image_sizes",description:`<strong>image_sizes</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2)</code>, <em>optional</em>) &#x2014;
The sizes of the images in the batch, being (height, width) for each image.`,name:"image_sizes"},{anchor:"transformers.PixtralVisionModel.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.PixtralVisionModel.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.PixtralVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/modeling_pixtral.py#L483",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>tensor of token features for
all tokens of all images of shape (N_toks, D)</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>pixel_values</p>
`}}),L=new pt({props:{$$slots:{default:[ut]},$$scope:{ctx:_e}}}),ne=new D({props:{title:"PixtralImageProcessor",local:"transformers.PixtralImageProcessor",headingTag:"h2"}}),ie=new q({props:{name:"class transformers.PixtralImageProcessor",anchor:"transformers.PixtralImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"patch_size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralImageProcessor.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.PixtralImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;longest_edge&quot; -- 1024}</code>):
Size of the maximum dimension of either the height or width dimension of the image. Used to control how
images are resized. If either the height or width are greater than <code>size[&quot;longest_edge&quot;]</code> then both the height and width are rescaled by <code>height / ratio</code>, <code>width /ratio</code> where <code>ratio = max(height / longest_edge, width / longest_edge)</code>`,name:"size"},{anchor:"transformers.PixtralImageProcessor.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 16, &quot;width&quot;: 16}</code>):
Size of the patches in the model, used to calculate the output image size. Can be overridden by <code>patch_size</code> in the <code>preprocess</code> method.`,name:"patch_size"},{anchor:"transformers.PixtralImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BICUBIC</code>) &#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.PixtralImageProcessor.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.PixtralImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#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.PixtralImageProcessor.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.PixtralImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.48145466, 0.4578275, 0.40821073]</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.PixtralImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.26862954, 0.26130258, 0.27577711]</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.PixtralImageProcessor.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/main/src/transformers/models/pixtral/image_processing_pixtral.py#L138"}}),le=new q({props:{name:"preprocess",anchor:"transformers.PixtralImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"patch_size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.PixtralImageProcessor.preprocess.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.patch_size</code>) &#x2014;
Patch size in the model. Used to calculate the image after resizing.`,name:"patch_size"},{anchor:"transformers.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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.PixtralImageProcessor.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/main/src/transformers/models/pixtral/image_processing_pixtral.py#L318"}}),ce=new D({props:{title:"PixtralImageProcessorFast",local:"transformers.PixtralImageProcessorFast",headingTag:"h2"}}),de=new q({props:{name:"class transformers.PixtralImageProcessorFast",anchor:"transformers.PixtralImageProcessorFast",parameters:[{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.pixtral.image_processing_pixtral_fast.PixtralFastImageProcessorInitKwargs]"}],parametersDescription:[{anchor:"transformers.PixtralImageProcessorFast.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&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.PixtralImageProcessorFast.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.PixtralImageProcessorFast.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.default_to_square</code>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.PixtralImageProcessorFast.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. Can be
overridden by the <code>resample</code> parameter in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.PixtralImageProcessorFast.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 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.PixtralImageProcessorFast.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 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.PixtralImageProcessorFast.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 by the specified scale <code>rescale_factor</code>. Can be overridden by the
<code>do_rescale</code> parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.PixtralImageProcessorFast.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Scale factor to use if rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.PixtralImageProcessorFast.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. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.PixtralImageProcessorFast.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;
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. Can be
overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.PixtralImageProcessorFast.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;
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.PixtralImageProcessorFast.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.PixtralImageProcessorFast.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 16, &quot;width&quot;: 16}</code>):
Size of the patches in the model, used to calculate the output image size. Can be overridden by <code>patch_size</code> in the <code>preprocess</code> method.`,name:"patch_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/image_processing_pixtral_fast.py#L72"}}),me=new q({props:{name:"preprocess",anchor:"transformers.PixtralImageProcessorFast.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.pixtral.image_processing_pixtral_fast.PixtralFastImageProcessorPreprocessKwargs]"}],parametersDescription:[{anchor:"transformers.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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.PixtralImageProcessorFast.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> or <code>InterpolationMode</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.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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 output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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.PixtralImageProcessorFast.preprocess.return_tensors",description:"<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.PixtralImageProcessorFast.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.PixtralImageProcessorFast.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"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 16, &quot;width&quot;: 16}</code>):
Size of the patches in the model, used to calculate the output image size. Can be overridden by <code>patch_size</code> in the <code>preprocess</code> method.`,name:"patch_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/image_processing_pixtral_fast.py#L97"}}),pe=new D({props:{title:"PixtralProcessor",local:"transformers.PixtralProcessor",headingTag:"h2"}}),he=new q({props:{name:"class transformers.PixtralProcessor",anchor:"transformers.PixtralProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"patch_size",val:": int = 16"},{name:"chat_template",val:" = None"},{name:"image_token",val:" = '[IMG]'"},{name:"image_break_token",val:" = '[IMG_BREAK]'"},{name:"image_end_token",val:" = '[IMG_END]'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralImageProcessor">PixtralImageProcessor</a>, <em>optional</em>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.PixtralProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/llama#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.PixtralProcessor.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Patch size from the vision tower.`,name:"patch_size"},{anchor:"transformers.PixtralProcessor.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) &#x2014; A Jinja template which will be used to convert lists of messages
in a chat into a tokenizable string.`,name:"chat_template"},{anchor:"transformers.PixtralProcessor.image_token",description:`<strong>image_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[IMG]&quot;</code>) &#x2014;
Special token used to denote image location.`,name:"image_token"},{anchor:"transformers.PixtralProcessor.image_break_token",description:`<strong>image_break_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[IMG_BREAK]&quot;</code>) &#x2014;
Special token used to denote the end of a line of pixels in an image.`,name:"image_break_token"},{anchor:"transformers.PixtralProcessor.image_end_token",description:`<strong>image_end_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[IMG_END]&quot;</code>) &#x2014;
Special token used to denote the end of an image input.`,name:"image_end_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/processing_pixtral.py#L53"}}),ge=new q({props:{name:"batch_decode",anchor:"transformers.PixtralProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/processing_pixtral.py#L213"}}),fe=new q({props:{name:"decode",anchor:"transformers.PixtralProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/processing_pixtral.py#L221"}}),ue=new gt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/pixtral.md"}}),{c(){c=i("meta"),J=r(),x=i("p"),M=r(),m(w.$$.fragment),_=r(),m(z.$$.fragment),Ve=r(),S=i("p"),S.innerHTML=Ro,Le=r(),E=i("p"),E.textContent=Vo,Fe=r(),B=i("p"),B.innerHTML=Lo,Ne=r(),R=i("img"),Ge=r(),H=i("small"),H.innerHTML=No,We=r(),Z=i("p"),Z.textContent=Go,De=r(),Q=i("ul"),Q.innerHTML=Wo,Se=r(),m(X.$$.fragment),Ee=r(),A=i("p"),A.innerHTML=Do,Be=r(),Y=i("p"),Y.innerHTML=So,He=r(),m(O.$$.fragment),Ze=r(),K=i("p"),K.innerHTML=Eo,Qe=r(),m(ee.$$.fragment),Xe=r(),m(oe.$$.fragment),Ae=r(),b=i("div"),m(te.$$.fragment),ho=r(),xe=i("p"),xe.innerHTML=Bo,go=r(),be=i("p"),be.innerHTML=Ho,fo=r(),ye=i("p"),ye.innerHTML=Zo,uo=r(),m(V.$$.fragment),Ye=r(),m(re.$$.fragment),Oe=r(),v=i("div"),m(ae.$$.fragment),_o=r(),Pe=i("p"),Pe.innerHTML=Qo,xo=r(),Me=i("p"),Me.innerHTML=Xo,bo=r(),j=i("div"),m(se.$$.fragment),yo=r(),ve=i("p"),ve.innerHTML=Ao,Po=r(),m(L.$$.fragment),Ke=r(),m(ne.$$.fragment),eo=r(),C=i("div"),m(ie.$$.fragment),Mo=r(),Te=i("p"),Te.textContent=Yo,vo=r(),F=i("div"),m(le.$$.fragment),To=r(),we=i("p"),we.textContent=Oo,oo=r(),m(ce.$$.fragment),to=r(),$=i("div"),m(de.$$.fragment),wo=r(),Ie=i("p"),Ie.textContent=Ko,Io=r(),N=i("div"),m(me.$$.fragment),zo=r(),ze=i("p"),ze.textContent=et,ro=r(),m(pe.$$.fragment),ao=r(),y=i("div"),m(he.$$.fragment),Co=r(),Ce=i("p"),Ce.textContent=ot,$o=r(),$e=i("p"),$e.innerHTML=tt,Uo=r(),G=i("div"),m(ge.$$.fragment),Jo=r(),Ue=i("p"),Ue.innerHTML=rt,jo=r(),W=i("div"),m(fe.$$.fragment),ko=r(),Je=i("p"),Je.innerHTML=at,so=r(),m(ue.$$.fragment),no=r(),Re=i("p"),this.h()},l(e){const o=mt("svelte-u9bgzb",document.head);c=l(o,"META",{name:!0,content:!0}),o.forEach(t),J=a(e),x=l(e,"P",{}),I(x).forEach(t),M=a(e),p(w.$$.fragment,e),_=a(e),p(z.$$.fragment,e),Ve=a(e),S=l(e,"P",{"data-svelte-h":!0}),d(S)!=="svelte-tgqlpw"&&(S.innerHTML=Ro),Le=a(e),E=l(e,"P",{"data-svelte-h":!0}),d(E)!=="svelte-3te1w2"&&(E.textContent=Vo),Fe=a(e),B=l(e,"P",{"data-svelte-h":!0}),d(B)!=="svelte-1y5kg5k"&&(B.innerHTML=Lo),Ne=a(e),R=l(e,"IMG",{src:!0,alt:!0,width:!0}),Ge=a(e),H=l(e,"SMALL",{"data-svelte-h":!0}),d(H)!=="svelte-10jofpl"&&(H.innerHTML=No),We=a(e),Z=l(e,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-axv494"&&(Z.textContent=Go),De=a(e),Q=l(e,"UL",{"data-svelte-h":!0}),d(Q)!=="svelte-rknnv7"&&(Q.innerHTML=Wo),Se=a(e),p(X.$$.fragment,e),Ee=a(e),A=l(e,"P",{"data-svelte-h":!0}),d(A)!=="svelte-n0o11w"&&(A.innerHTML=Do),Be=a(e),Y=l(e,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-1fxleij"&&(Y.innerHTML=So),He=a(e),p(O.$$.fragment,e),Ze=a(e),K=l(e,"P",{"data-svelte-h":!0}),d(K)!=="svelte-orhe3n"&&(K.innerHTML=Eo),Qe=a(e),p(ee.$$.fragment,e),Xe=a(e),p(oe.$$.fragment,e),Ae=a(e),b=l(e,"DIV",{class:!0});var T=I(b);p(te.$$.fragment,T),ho=a(T),xe=l(T,"P",{"data-svelte-h":!0}),d(xe)!=="svelte-1xxf4yy"&&(xe.innerHTML=Bo),go=a(T),be=l(T,"P",{"data-svelte-h":!0}),d(be)!=="svelte-l0qt95"&&(be.innerHTML=Ho),fo=a(T),ye=l(T,"P",{"data-svelte-h":!0}),d(ye)!=="svelte-o55m63"&&(ye.innerHTML=Zo),uo=a(T),p(V.$$.fragment,T),T.forEach(t),Ye=a(e),p(re.$$.fragment,e),Oe=a(e),v=l(e,"DIV",{class:!0});var U=I(v);p(ae.$$.fragment,U),_o=a(U),Pe=l(U,"P",{"data-svelte-h":!0}),d(Pe)!=="svelte-ybvejp"&&(Pe.innerHTML=Qo),xo=a(U),Me=l(U,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-hswkmf"&&(Me.innerHTML=Xo),bo=a(U),j=l(U,"DIV",{class:!0});var je=I(j);p(se.$$.fragment,je),yo=a(je),ve=l(je,"P",{"data-svelte-h":!0}),d(ve)!=="svelte-1mwzfrr"&&(ve.innerHTML=Ao),Po=a(je),p(L.$$.fragment,je),je.forEach(t),U.forEach(t),Ke=a(e),p(ne.$$.fragment,e),eo=a(e),C=l(e,"DIV",{class:!0});var ke=I(C);p(ie.$$.fragment,ke),Mo=a(ke),Te=l(ke,"P",{"data-svelte-h":!0}),d(Te)!=="svelte-1eqw4iw"&&(Te.textContent=Yo),vo=a(ke),F=l(ke,"DIV",{class:!0});var lo=I(F);p(le.$$.fragment,lo),To=a(lo),we=l(lo,"P",{"data-svelte-h":!0}),d(we)!=="svelte-1x3yxsa"&&(we.textContent=Oo),lo.forEach(t),ke.forEach(t),oo=a(e),p(ce.$$.fragment,e),to=a(e),$=l(e,"DIV",{class:!0});var qe=I($);p(de.$$.fragment,qe),wo=a(qe),Ie=l(qe,"P",{"data-svelte-h":!0}),d(Ie)!=="svelte-1bn0s7p"&&(Ie.textContent=Ko),Io=a(qe),N=l(qe,"DIV",{class:!0});var co=I(N);p(me.$$.fragment,co),zo=a(co),ze=l(co,"P",{"data-svelte-h":!0}),d(ze)!=="svelte-1x3yxsa"&&(ze.textContent=et),co.forEach(t),qe.forEach(t),ro=a(e),p(pe.$$.fragment,e),ao=a(e),y=l(e,"DIV",{class:!0});var k=I(y);p(he.$$.fragment,k),Co=a(k),Ce=l(k,"P",{"data-svelte-h":!0}),d(Ce)!=="svelte-1i1eb5d"&&(Ce.textContent=ot),$o=a(k),$e=l(k,"P",{"data-svelte-h":!0}),d($e)!=="svelte-6p9so9"&&($e.innerHTML=tt),Uo=a(k),G=l(k,"DIV",{class:!0});var mo=I(G);p(ge.$$.fragment,mo),Jo=a(mo),Ue=l(mo,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-1o9eza"&&(Ue.innerHTML=rt),mo.forEach(t),jo=a(k),W=l(k,"DIV",{class:!0});var po=I(W);p(fe.$$.fragment,po),ko=a(po),Je=l(po,"P",{"data-svelte-h":!0}),d(Je)!=="svelte-kk16qw"&&(Je.innerHTML=at),po.forEach(t),k.forEach(t),so=a(e),p(ue.$$.fragment,e),no=a(e),Re=l(e,"P",{}),I(Re).forEach(t),this.h()},h(){P(c,"name","hf:doc:metadata"),P(c,"content",xt),it(R.src,Fo="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/pixtral_architecture.webp")||P(R,"src",Fo),P(R,"alt","drawing"),P(R,"width","600"),P(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),P(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){n(document.head,c),s(e,J,o),s(e,x,o),s(e,M,o),h(w,e,o),s(e,_,o),h(z,e,o),s(e,Ve,o),s(e,S,o),s(e,Le,o),s(e,E,o),s(e,Fe,o),s(e,B,o),s(e,Ne,o),s(e,R,o),s(e,Ge,o),s(e,H,o),s(e,We,o),s(e,Z,o),s(e,De,o),s(e,Q,o),s(e,Se,o),h(X,e,o),s(e,Ee,o),s(e,A,o),s(e,Be,o),s(e,Y,o),s(e,He,o),h(O,e,o),s(e,Ze,o),s(e,K,o),s(e,Qe,o),h(ee,e,o),s(e,Xe,o),h(oe,e,o),s(e,Ae,o),s(e,b,o),h(te,b,null),n(b,ho),n(b,xe),n(b,go),n(b,be),n(b,fo),n(b,ye),n(b,uo),h(V,b,null),s(e,Ye,o),h(re,e,o),s(e,Oe,o),s(e,v,o),h(ae,v,null),n(v,_o),n(v,Pe),n(v,xo),n(v,Me),n(v,bo),n(v,j),h(se,j,null),n(j,yo),n(j,ve),n(j,Po),h(L,j,null),s(e,Ke,o),h(ne,e,o),s(e,eo,o),s(e,C,o),h(ie,C,null),n(C,Mo),n(C,Te),n(C,vo),n(C,F),h(le,F,null),n(F,To),n(F,we),s(e,oo,o),h(ce,e,o),s(e,to,o),s(e,$,o),h(de,$,null),n($,wo),n($,Ie),n($,Io),n($,N),h(me,N,null),n(N,zo),n(N,ze),s(e,ro,o),h(pe,e,o),s(e,ao,o),s(e,y,o),h(he,y,null),n(y,Co),n(y,Ce),n(y,$o),n(y,$e),n(y,Uo),n(y,G),h(ge,G,null),n(G,Jo),n(G,Ue),n(y,jo),n(y,W),h(fe,W,null),n(W,ko),n(W,Je),s(e,so,o),h(ue,e,o),s(e,no,o),s(e,Re,o),io=!0},p(e,[o]){const T={};o&2&&(T.$$scope={dirty:o,ctx:e}),V.$set(T);const U={};o&2&&(U.$$scope={dirty:o,ctx:e}),L.$set(U)},i(e){io||(g(w.$$.fragment,e),g(z.$$.fragment,e),g(X.$$.fragment,e),g(O.$$.fragment,e),g(ee.$$.fragment,e),g(oe.$$.fragment,e),g(te.$$.fragment,e),g(V.$$.fragment,e),g(re.$$.fragment,e),g(ae.$$.fragment,e),g(se.$$.fragment,e),g(L.$$.fragment,e),g(ne.$$.fragment,e),g(ie.$$.fragment,e),g(le.$$.fragment,e),g(ce.$$.fragment,e),g(de.$$.fragment,e),g(me.$$.fragment,e),g(pe.$$.fragment,e),g(he.$$.fragment,e),g(ge.$$.fragment,e),g(fe.$$.fragment,e),g(ue.$$.fragment,e),io=!0)},o(e){f(w.$$.fragment,e),f(z.$$.fragment,e),f(X.$$.fragment,e),f(O.$$.fragment,e),f(ee.$$.fragment,e),f(oe.$$.fragment,e),f(te.$$.fragment,e),f(V.$$.fragment,e),f(re.$$.fragment,e),f(ae.$$.fragment,e),f(se.$$.fragment,e),f(L.$$.fragment,e),f(ne.$$.fragment,e),f(ie.$$.fragment,e),f(le.$$.fragment,e),f(ce.$$.fragment,e),f(de.$$.fragment,e),f(me.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(ge.$$.fragment,e),f(fe.$$.fragment,e),f(ue.$$.fragment,e),io=!1},d(e){e&&(t(J),t(x),t(M),t(_),t(Ve),t(S),t(Le),t(E),t(Fe),t(B),t(Ne),t(R),t(Ge),t(H),t(We),t(Z),t(De),t(Q),t(Se),t(Ee),t(A),t(Be),t(Y),t(He),t(Ze),t(K),t(Qe),t(Xe),t(Ae),t(b),t(Ye),t(Oe),t(v),t(Ke),t(eo),t(C),t(oo),t(to),t($),t(ro),t(ao),t(y),t(so),t(no),t(Re)),t(c),u(w,e),u(z,e),u(X,e),u(O,e),u(ee,e),u(oe,e),u(te),u(V),u(re,e),u(ae),u(se),u(L),u(ne,e),u(ie),u(le),u(ce,e),u(de),u(me),u(pe,e),u(he),u(ge),u(fe),u(ue,e)}}}const xt='{"title":"Pixtral","local":"pixtral","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage","local":"usage","sections":[],"depth":2},{"title":"PixtralVisionConfig","local":"transformers.PixtralVisionConfig","sections":[],"depth":2},{"title":"PixtralVisionModel","local":"transformers.PixtralVisionModel","sections":[],"depth":2},{"title":"PixtralImageProcessor","local":"transformers.PixtralImageProcessor","sections":[],"depth":2},{"title":"PixtralImageProcessorFast","local":"transformers.PixtralImageProcessorFast","sections":[],"depth":2},{"title":"PixtralProcessor","local":"transformers.PixtralProcessor","sections":[],"depth":2}],"depth":1}';function bt(_e){return lt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zt extends ct{constructor(c){super(),dt(this,c,bt,_t,nt,{})}}export{zt as component};
