import{s as Lo,o as Go,n as Ke}from"../chunks/scheduler.18a86fab.js";import{S as Bo,i as So,g as l,s as n,r as g,A as Eo,h as c,f as o,c as s,j as $,u as h,x as p,k as U,y as r,a as i,v as f,d as u,t as _,w as y}from"../chunks/index.98837b22.js";import{T as Vo}from"../chunks/Tip.77304350.js";import{D as N}from"../chunks/Docstring.6758ea23.js";import{C as et}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as Jt}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as G}from"../chunks/Heading.7e7e0c5b.js";import{E as Yo}from"../chunks/index.499f366c.js";function Ho(J){let d,I="Example:",b,m,M;return m=new et({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMElkZWZpY3MzTW9kZWwlMkMlMjBJZGVmaWNzM0NvbmZpZyUwQSUyMyUyMEluaXRpYWxpemluZyUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwSWRlZmljczNDb25maWcoKSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBJZGVmaWNzM01vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Idefics3Model, Idefics3Config
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Idefics3Config()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Idefics3Model(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(){d=l("p"),d.textContent=I,b=n(),g(m.$$.fragment)},l(a){d=c(a,"P",{"data-svelte-h":!0}),p(d)!=="svelte-11lpom8"&&(d.textContent=I),b=s(a),h(m.$$.fragment,a)},m(a,T){i(a,d,T),i(a,b,T),f(m,a,T),M=!0},p:Ke,i(a){M||(u(m.$$.fragment,a),M=!0)},o(a){_(m.$$.fragment,a),M=!1},d(a){a&&(o(d),o(b)),y(m,a)}}}function Qo(J){let d,I="Example:",b,m,M;return m=new et({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMuaWRlZmljczMubW9kZWxpbmdfaWRlZmljczMlMjBpbXBvcnQlMjBJZGVmaWNzM1Zpc2lvblRyYW5zZm9ybWVyJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMuaWRlZmljczMuY29uZmlndXJhdGlvbl9pZGVmaWNzMyUyMGltcG9ydCUyMElkZWZpY3MzVmlzaW9uQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMElkZWZpY3MzVmlzaW9uQ29uZmlnJTIwd2l0aCUyMGdvb2dsZSUyRnNpZ2xpcC1iYXNlLXBhdGNoMTYtMjI0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMElkZWZpY3MzVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwSWRlZmljczNWaXNpb25UcmFuc2Zvcm1lciUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZ29vZ2xlJTJGc2lnbGlwLWJhc2UtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMElkZWZpY3MzVmlzaW9uVHJhbnNmb3JtZXIoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.idefics3.modeling_idefics3 <span class="hljs-keyword">import</span> Idefics3VisionTransformer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.idefics3.configuration_idefics3 <span class="hljs-keyword">import</span> Idefics3VisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Idefics3VisionConfig with google/siglip-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Idefics3VisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Idefics3VisionTransformer (with random weights) from the google/siglip-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Idefics3VisionTransformer(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(){d=l("p"),d.textContent=I,b=n(),g(m.$$.fragment)},l(a){d=c(a,"P",{"data-svelte-h":!0}),p(d)!=="svelte-11lpom8"&&(d.textContent=I),b=s(a),h(m.$$.fragment,a)},m(a,T){i(a,d,T),i(a,b,T),f(m,a,T),M=!0},p:Ke,i(a){M||(u(m.$$.fragment,a),M=!0)},o(a){_(m.$$.fragment,a),M=!1},d(a){a&&(o(d),o(b)),y(m,a)}}}function Xo(J){let d,I=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=l("p"),d.innerHTML=I},l(b){d=c(b,"P",{"data-svelte-h":!0}),p(d)!=="svelte-fincs2"&&(d.innerHTML=I)},m(b,m){i(b,d,m)},p:Ke,d(b){b&&o(d)}}}function Ao(J){let d,I="Example:",b,m,M;return m=new et({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEF1dG9Nb2RlbEZvclZpc2lvbjJTZXElMEFmcm9tJTIwdHJhbnNmb3JtZXJzLmltYWdlX3V0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwcGFzc2luZyUyMHRoZSUyMGltYWdlJTIwdXJscyUyMChpbnN0ZWFkJTIwb2YlMjB0aGUlMjBhY3R1YWwlMjBwaWwlMjBpbWFnZXMpJTIwdG8lMjB0aGUlMjBwcm9jZXNzb3IlMjBpcyUyMGFsc28lMjBwb3NzaWJsZSUwQWltYWdlMSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZjZG4uYnJpdGFubmljYS5jb20lMkY2MSUyRjkzMDYxLTA1MC05OTE0N0RDRSUyRlN0YXR1ZS1vZi1MaWJlcnR5LUlzbGFuZC1OZXctWW9yay1CYXkuanBnJTIyKSUwQWltYWdlMiUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZjZG4uYnJpdGFubmljYS5jb20lMkY1OSUyRjk0NDU5LTA1MC1EQkE0MjQ2NyUyRlNreWxpbmUtQ2hpY2Fnby5qcGclMjIpJTBBaW1hZ2UzJTIwJTNEJTIwbG9hZF9pbWFnZSglMjJodHRwcyUzQSUyRiUyRmNkbi5icml0YW5uaWNhLmNvbSUyRjY4JTJGMTcwODY4LTA1MC04RERFODI2MyUyRkdvbGRlbi1HYXRlLUJyaWRnZS1TYW4tRnJhbmNpc2NvLmpwZyUyMiklMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJIdWdnaW5nRmFjZU00JTJGSWRlZmljczMtOEItTGxhbWEzJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yVmlzaW9uMlNlcS5mcm9tX3ByZXRyYWluZWQoJTIySHVnZ2luZ0ZhY2VNNCUyRklkZWZpY3MzLThCLUxsYW1hMyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMiklMEElMEElMjMlMjBDcmVhdGUlMjBpbnB1dHMlMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkluJTIwdGhpcyUyMGltYWdlJTJDJTIwd2UlMjBjYW4lMjBzZWUlMjB0aGUlMjBjaXR5JTIwb2YlMjBOZXclMjBZb3JrJTJDJTIwYW5kJTIwbW9yZSUyMHNwZWNpZmljYWxseSUyMHRoZSUyMFN0YXR1ZSUyMG9mJTIwTGliZXJ0eS4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIyaW1hZ2UlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIydGV4dCUyMiUyQyUyMCUyMnRleHQlMjIlM0ElMjAlMjJXaGF0JTIwY2FuJTIwd2UlMjBzZWUlMjBpbiUyMHRoaXMlMjBpbWFnZSUzRiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkluJTIwd2hpY2glMjBjaXR5JTIwaXMlMjB0aGF0JTIwYnJpZGdlJTIwbG9jYXRlZCUzRiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCU3RCUwQSU1RCUwQSUwQXByb21wdHMlMjAlM0QlMjAlNUJwcm9jZXNzb3IuYXBwbHlfY2hhdF90ZW1wbGF0ZSglNUJtZXNzYWdlJTVEJTJDJTIwYWRkX2dlbmVyYXRpb25fcHJvbXB0JTNEVHJ1ZSklMjBmb3IlMjBtZXNzYWdlJTIwaW4lMjBtZXNzYWdlcyU1RCUwQWltYWdlcyUyMCUzRCUyMCU1QiU1QmltYWdlMSUyQyUyMGltYWdlMiU1RCUyQyUyMCU1QmltYWdlMyU1RCU1RCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEcHJvbXB0cyUyQyUyMGltYWdlcyUzRGltYWdlcyUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8obW9kZWwuZGV2aWNlKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0QyNTYpJTBBZ2VuZXJhdGVkX3RleHRzJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTBBJTBBcHJpbnQoZ2VuZXJhdGVkX3RleHRzJTVCMCU1RCklMEElMEFwcmludChnZW5lcmF0ZWRfdGV4dHMlNUIxJTVEKQ==",highlighted:`<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">import</span> torch
<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><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForVision2Seq
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.image_utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that passing the image urls (instead of the actual pil images) to the processor is also possible</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image1 = load_image(<span class="hljs-string">&quot;https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image2 = load_image(<span class="hljs-string">&quot;https://cdn.britannica.com/59/94459-050-DBA42467/Skyline-Chicago.jpg&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image3 = load_image(<span class="hljs-string">&quot;https://cdn.britannica.com/68/170868-050-8DDE8263/Golden-Gate-Bridge-San-Francisco.jpg&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;HuggingFaceM4/Idefics3-8B-Llama3&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForVision2Seq.from_pretrained(<span class="hljs-string">&quot;HuggingFaceM4/Idefics3-8B-Llama3&quot;</span>, torch_dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;auto&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Create inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;content&quot;</span>: [
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;In this image, we can see the city of New York, and more specifically the Statue of Liberty.&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;What can we see in this image?&quot;</span>},
<span class="hljs-meta">... </span>        ]
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;content&quot;</span>: [
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;In which city is that bridge located?&quot;</span>},
<span class="hljs-meta">... </span>        ]
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>prompts = [processor.apply_chat_template([message], add_generation_prompt=<span class="hljs-literal">True</span>) <span class="hljs-keyword">for</span> message <span class="hljs-keyword">in</span> messages]
<span class="hljs-meta">&gt;&gt;&gt; </span>images = [[image1, image2], [image3]]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=prompts, images=images, padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(model.device)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">256</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_texts = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_texts[<span class="hljs-number">0</span>])
Assistant: There are buildings, trees, lights, <span class="hljs-keyword">and</span> water visible <span class="hljs-keyword">in</span> this image.

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_texts[<span class="hljs-number">1</span>])
Assistant: The bridge <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> San Francisco.`,wrap:!1}}),{c(){d=l("p"),d.textContent=I,b=n(),g(m.$$.fragment)},l(a){d=c(a,"P",{"data-svelte-h":!0}),p(d)!=="svelte-11lpom8"&&(d.textContent=I),b=s(a),h(m.$$.fragment,a)},m(a,T){i(a,d,T),i(a,b,T),f(m,a,T),M=!0},p:Ke,i(a){M||(u(m.$$.fragment,a),M=!0)},o(a){_(m.$$.fragment,a),M=!1},d(a){a&&(o(d),o(b)),y(m,a)}}}function Do(J){let d,I="Example:",b,m,M;return m=new et({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwSWRlZmljczNQcm9jZXNzb3IlMEFmcm9tJTIwdHJhbnNmb3JtZXJzLmltYWdlX3V0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMElkZWZpY3MzUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJIdWdnaW5nRmFjZU00JTJGSWRlZmljczMtOEItTGxhbWEzJTIyKSUwQXByb2Nlc3Nvci5pbWFnZV9wcm9jZXNzb3IuZG9faW1hZ2Vfc3BsaXR0aW5nJTIwJTNEJTIwRmFsc2UlMjAlMjAlMjMlMjBGb3JjZSUyMGFzJTIwRmFsc2UlMjB0byUyMHNpbXBsaWZ5JTIwdGhlJTIwZXhhbXBsZSUwQSUwQXVybDElMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmNkbi5icml0YW5uaWNhLmNvbSUyRjYxJTJGOTMwNjEtMDUwLTk5MTQ3RENFJTJGU3RhdHVlLW9mLUxpYmVydHktSXNsYW5kLU5ldy1Zb3JrLUJheS5qcGclMjIlMEF1cmwyJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZjZG4uYnJpdGFubmljYS5jb20lMkY1OSUyRjk0NDU5LTA1MC1EQkE0MjQ2NyUyRlNreWxpbmUtQ2hpY2Fnby5qcGclMjIlMEElMEFpbWFnZTElMkMlMjBpbWFnZTIlMjAlM0QlMjBsb2FkX2ltYWdlKHVybDEpJTJDJTIwbG9hZF9pbWFnZSh1cmwyKSUwQWltYWdlcyUyMCUzRCUyMCU1QiU1QmltYWdlMSU1RCUyQyUyMCU1QmltYWdlMiU1RCU1RCUwQSUwQXRleHQlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjIlM0NpbWFnZSUzRUluJTIwdGhpcyUyMGltYWdlJTJDJTIwd2UlMjBzZWUlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJibGElMjBibGElMjBibGElM0NpbWFnZSUzRSUyMiUyQyUwQSU1RCUwQW91dHB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2VzJTJDJTIwdGV4dCUzRHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBaW5wdXRfaWRzJTIwJTNEJTIwb3V0cHV0cy5pbnB1dF9pZHMlMEFpbnB1dF90b2tlbnMlMjAlM0QlMjBwcm9jZXNzb3IudG9rZW5pemVyLmJhdGNoX2RlY29kZShpbnB1dF9pZHMpJTBBcHJpbnQoaW5wdXRfdG9rZW5zKQ==",highlighted:`<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> transformers <span class="hljs-keyword">import</span> Idefics3Processor
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.image_utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Idefics3Processor.from_pretrained(<span class="hljs-string">&quot;HuggingFaceM4/Idefics3-8B-Llama3&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.image_processor.do_image_splitting = <span class="hljs-literal">False</span>  <span class="hljs-comment"># Force as False to simplify the example</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>url1 = <span class="hljs-string">&quot;https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url2 = <span class="hljs-string">&quot;https://cdn.britannica.com/59/94459-050-DBA42467/Skyline-Chicago.jpg&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>image1, image2 = load_image(url1), load_image(url2)
<span class="hljs-meta">&gt;&gt;&gt; </span>images = [[image1], [image2]]

<span class="hljs-meta">&gt;&gt;&gt; </span>text = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&lt;image&gt;In this image, we see&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;bla bla bla&lt;image&gt;&quot;</span>,
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = processor(images=images, text=text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = outputs.input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_tokens = processor.tokenizer.batch_decode(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(input_tokens)
[<span class="hljs-string">&#x27;&lt;|begin_of_text|&gt;&lt;fake_token_around_image&gt;&lt;global-img&gt;((&lt;image&gt;)*169)&lt;fake_token_around_image&gt; In this image, we see&#x27;</span>, <span class="hljs-string">&#x27;&lt;|reserved_special_token_0|&gt;&lt;|reserved_special_token_0|&gt;&lt;|reserved_special_token_0|&gt;&lt;|begin_of_text|&gt;bla bla bla&lt;fake_token_around_image&gt;&lt;global-img&gt;((&lt;image&gt;)*169)&lt;fake_token_around_image&gt;&#x27;</span>]`,wrap:!1}}),{c(){d=l("p"),d.textContent=I,b=n(),g(m.$$.fragment)},l(a){d=c(a,"P",{"data-svelte-h":!0}),p(d)!=="svelte-11lpom8"&&(d.textContent=I),b=s(a),h(m.$$.fragment,a)},m(a,T){i(a,d,T),i(a,b,T),f(m,a,T),M=!0},p:Ke,i(a){M||(u(m.$$.fragment,a),M=!0)},o(a){_(m.$$.fragment,a),M=!1},d(a){a&&(o(d),o(b)),y(m,a)}}}function Oo(J){let d,I,b,m,M,a,T,lo='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',tt,D,ot,O,co='The Idefics3 model was proposed in <a href="https://huggingface.co/papers/2408.12637" rel="nofollow">Building and better understanding vision-language models: insights and future directions</a> by Hugo Laurençon, Andrés Marafioti, Victor Sanh, and Léo Tronchon.',nt,K,mo="Idefics3 is an adaptation of the Idefics2 model with three main differences:",st,ee,po="<li>It uses Llama3 for the text model.</li> <li>It uses an updated processing logic for the images.</li> <li>It removes the perceiver.</li>",at,te,go="The abstract from the paper is the following:",it,oe,ho="<em>The field of vision-language models (VLMs), which take images and texts as inputs and output texts, is rapidly evolving and has yet to reach consensus on several key aspects of the development pipeline, including data, architecture, and training methods. This paper can be seen as a tutorial for building a VLM. We begin by providing a comprehensive overview of the current state-of-the-art approaches, highlighting the strengths and weaknesses of each, addressing the major challenges in the field, and suggesting promising research directions for underexplored areas. We then walk through the practical steps to build Idefics3-8B, a powerful VLM that significantly outperforms its predecessor Idefics2-8B, while being trained efficiently, exclusively on open datasets, and using a straightforward pipeline. These steps include the creation of Docmatix, a dataset for improving document understanding capabilities, which is 240 times larger than previously available datasets. We release the model along with the datasets created for its training.</em>",rt,ne,lt,se,fo="Input images are processed either by upsampling (if resizing is enabled) or at their original resolution. The resizing behavior depends on two parameters: do_resize and size.",ct,ae,uo="If <code>do_resize</code> is set to <code>True</code>, the model resizes images so that the longest edge is 4<em>364 pixels by default.\nThe default resizing behavior can be customized by passing a dictionary to the <code>size</code> parameter. For example, `{“longest_edge”: 4</em> 364}` is the default, but you can change it to a different value if needed.",dt,ie,_o="Here’s how to control resizing and set a custom size:",mt,re,pt,le,yo="Additionally, the <code>max_image_size</code> parameter, which controls the size of each square patch the image is decomposed into, is set to 364 by default but can be adjusted as needed. After resizing (if applicable), the image processor decomposes the images into square patches based on the <code>max_image_size</code> parameter.",gt,ce,bo='This model was contributed by <a href="https://huggingface.co/amyeroberts" rel="nofollow">amyeroberts</a> and <a href="https://huggingface.co/andito" rel="nofollow">andimarafioti</a>.',ht,de,ft,C,me,Wt,ke,Mo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Model">Idefics3Model</a>. It is used to instantiate a
Idefics3 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 model of the Idefics3
<a href="https://huggingface.co/HuggingFaceM4/Idefics3-8B-Llama3" rel="nofollow">HuggingFaceM4/Idefics3-8B-Llama3</a> architecture.`,Zt,$e,To=`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.`,qt,B,ut,pe,_t,j,ge,Ft,Je,Io=`This is the configuration class to store the configuration of a <code>Idefics3VisionModel</code>. It is used to instantiate a
Idefics3 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SigLIP checkpoint
<a href="https://huggingface.co/google/siglip-base-patch16-224" rel="nofollow">google/siglip-base-patch16-224</a> used in the Idefics3 model
<a href="https://huggingface.co/HuggingFaceM4/Idefics3-8B-Llama3" rel="nofollow">HuggingFaceM4/Idefics3-8B-Llama3</a>.`,Rt,We,wo=`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.`,Nt,S,yt,he,bt,z,fe,Pt,Ze,vo="The Idefics3 Vision Transformer Model outputting raw image embedding.",Lt,qe,Uo=`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.)`,Gt,Fe,Co=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Mt,ue,Tt,w,_e,Bt,Re,jo="Idefics3 model consisting of a SIGLIP vision encoder and Llama3 language decoder",St,Ne,zo=`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.)`,Et,Pe,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.`,Vt,E,ye,Yt,Le,ko=`Inputs fed to the model can have an arbitrary number of images. To account for this, pixel_values fed to
the model have image padding -> (batch_size, max_num_images, 3, max_heights, max_widths) where
max_num_images is the maximum number of images among the batch_size samples in the batch.
Padding images are not needed beyond padding the pixel_values at the entrance of the model.
For efficiency, we only pass through the vision_model’s forward the real images by
discarding the padding images i.e. pixel_values of size (image_batch_size, 3, height, width) where
image_batch_size would be 7 when num_images_per_sample=[1, 3, 1, 2] and max_num_images would be 3.`,It,be,wt,v,Me,Ht,Ge,$o="The Idefics3 Model with a language modeling head. It is made up a SigLIP vision encoder, with a language modeling head on top.",Qt,Be,Jo=`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.)`,Xt,Se,Wo=`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.`,At,W,Te,Dt,Ee,Zo='The <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3ForConditionalGeneration">Idefics3ForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Ot,V,Kt,Y,vt,Ie,Ut,Z,we,eo,Ve,qo="Constructs a Idefics3 image processor.",to,H,ve,oo,Ye,Fo="Preprocess a batch of images.",Ct,Ue,jt,x,Ce,no,He,Ro="Constructs a Idefics3 processor which wraps a LLama tokenizer and Idefics3 image processor into a single processor.",so,Qe,No=`<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Processor">Idefics3Processor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3ImageProcessor">Idefics3ImageProcessor</a> and <code>Idefics3TokenizerFast</code>. See
the docstring of <a href="/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsProcessor.__call__"><strong>call</strong>()</a> and <code>decode()</code> for more information.`,ao,P,je,io,Xe,Po="Processes the input prompts and returns a BatchEncoding.",ro,Q,zt,ze,xt,Oe,kt;return M=new G({props:{title:"Idefics3",local:"idefics3",headingTag:"h1"}}),D=new G({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ne=new G({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),re=new et({props:{code:"aW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwSWRlZmljczNJbWFnZVByb2Nlc3Nvcihkb19yZXNpemUlM0RUcnVlJTJDJTIwc2l6ZSUzRCU3QiUyMmxvbmdlc3RfZWRnZSUyMiUzQSUyMDIlMjAqJTIwMzY0JTdEJTJDJTIwbWF4X2ltYWdlX3NpemUlM0QzNjQp",highlighted:'image_processor = Idefics3ImageProcessor(do_resize=<span class="hljs-literal">True</span>, size={<span class="hljs-string">&quot;longest_edge&quot;</span>: <span class="hljs-number">2</span> * <span class="hljs-number">364</span>}, max_image_size=<span class="hljs-number">364</span>)',wrap:!1}}),de=new G({props:{title:"Idefics3Config",local:"transformers.Idefics3Config",headingTag:"h2"}}),me=new N({props:{name:"class transformers.Idefics3Config",anchor:"transformers.Idefics3Config",parameters:[{name:"use_cache",val:" = True"},{name:"image_token_id",val:" = 128257"},{name:"tie_word_embeddings",val:" = False"},{name:"vision_config",val:" = None"},{name:"text_config",val:" = None"},{name:"scale_factor",val:" = 2"},{name:"pad_token_id",val:" = 128002"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3Config.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 cache the key/value pairs of the attention mechanism. Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.Idefics3Config.image_token_id",description:`<strong>image_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 128257) &#x2014;
The id of the &#x201C;image&#x201D; token.`,name:"image_token_id"},{anchor:"transformers.Idefics3Config.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to tie the word embeddings with the token embeddings.`,name:"tie_word_embeddings"},{anchor:"transformers.Idefics3Config.vision_config",description:`<strong>vision_config</strong> (<code>IdeficsVisionConfig</code> or <code>dict</code>, <em>optional</em>, defaults to <code>IdeficsVisionConfig</code>) &#x2014;
Custom vision config or dict for the vision tower`,name:"vision_config"},{anchor:"transformers.Idefics3Config.text_config",description:`<strong>text_config</strong> (<code>PretrainedConfig</code> or <code>dict</code>, <em>optional</em>, defaults to <code>LlamaConfig</code>) &#x2014;
Custom text config or dict for the text model`,name:"text_config"},{anchor:"transformers.Idefics3Config.scale_factor",description:`<strong>scale_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The scale factor for the image encoder.`,name:"scale_factor"},{anchor:"transformers.Idefics3Config.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 128002) &#x2014;
The id of the padding token.`,name:"pad_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/configuration_idefics3.py#L109"}}),B=new Jt({props:{anchor:"transformers.Idefics3Config.example",$$slots:{default:[Ho]},$$scope:{ctx:J}}}),pe=new G({props:{title:"Idefics3VisionConfig",local:"transformers.Idefics3VisionConfig",headingTag:"h2"}}),ge=new N({props:{name:"class transformers.Idefics3VisionConfig",anchor:"transformers.Idefics3VisionConfig",parameters:[{name:"hidden_size",val:" = 1152"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'gelu_pytorch_tanh'"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3VisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1152) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Idefics3VisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Idefics3VisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Idefics3VisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Idefics3VisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input images.`,name:"num_channels"},{anchor:"transformers.Idefics3VisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.Idefics3VisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Idefics3VisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_pytorch_tanh&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Idefics3VisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Idefics3VisionConfig.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.Idefics3VisionConfig.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/idefics3/configuration_idefics3.py#L24"}}),S=new Jt({props:{anchor:"transformers.Idefics3VisionConfig.example",$$slots:{default:[Qo]},$$scope:{ctx:J}}}),he=new G({props:{title:"Idefics3VisionTransformer",local:"transformers.Idefics3VisionTransformer",headingTag:"h2"}}),fe=new N({props:{name:"class transformers.Idefics3VisionTransformer",anchor:"transformers.Idefics3VisionTransformer",parameters:[{name:"config",val:": Idefics3VisionConfig"}],parametersDescription:[{anchor:"transformers.Idefics3VisionTransformer.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3VisionConfig">Idefics3VisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L529"}}),ue=new G({props:{title:"Idefics3Model",local:"transformers.Idefics3Model",headingTag:"h2"}}),_e=new N({props:{name:"class transformers.Idefics3Model",anchor:"transformers.Idefics3Model",parameters:[{name:"config",val:": Idefics3Config"}],parametersDescription:[{anchor:"transformers.Idefics3Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Config">Idefics3Config</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L616"}}),ye=new N({props:{name:"forward",anchor:"transformers.Idefics3Model.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"image_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.modeling_flash_attention_utils.FlashAttentionKwargs]"}],parametersDescription:[{anchor:"transformers.Idefics3Model.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Idefics3Model.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>`,name:"attention_mask"},{anchor:"transformers.Idefics3Model.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.Idefics3Model.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Idefics3Model.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.Idefics3Model.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Idefics3Model.forward.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Idefics3Model.forward.image_hidden_states",description:`<strong>image_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>) &#x2014;
The hidden states of the image encoder after modality projection.`,name:"image_hidden_states"},{anchor:"transformers.Idefics3Model.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.Idefics3Model.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.Idefics3Model.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.Idefics3Model.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.Idefics3Model.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/idefics3/modeling_idefics3.py#L705",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.idefics3.modeling_idefics3.Idefics3BaseModelOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Config"
>Idefics3Config</a>) and inputs.</p>
<ul>
<li><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.
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.</li>
<li><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>.
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.</li>
<li><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>.
Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</li>
<li><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>.
Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</li>
<li><strong>image_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the image embeddings, <code>(batch_size, num_images, sequence_length, hidden_size)</code>.
image_hidden_states of the model produced by the vision encoder</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.idefics3.modeling_idefics3.Idefics3BaseModelOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new G({props:{title:"Idefics3ForConditionalGeneration",local:"transformers.Idefics3ForConditionalGeneration",headingTag:"h2"}}),Me=new N({props:{name:"class transformers.Idefics3ForConditionalGeneration",anchor:"transformers.Idefics3ForConditionalGeneration",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Idefics3ForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3ForConditionalGeneration">Idefics3ForConditionalGeneration</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L851"}}),Te=new N({props:{name:"forward",anchor:"transformers.Idefics3ForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"image_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"logits_to_keep",val:": typing.Union[int, torch.Tensor] = 0"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.idefics3.modeling_idefics3.KwargsForCausalLM]"}],parametersDescription:[{anchor:"transformers.Idefics3ForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Idefics3ForConditionalGeneration.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>`,name:"attention_mask"},{anchor:"transformers.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.BoolTensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.image_hidden_states",description:`<strong>image_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>) &#x2014;
The hidden states of the image encoder after modality projection.`,name:"image_hidden_states"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or <code>model.image_token_id</code> (where <code>model</code> is your instance of <code>Idefics3ForConditionalGeneration</code>).
Tokens with indices set to <code>model.image_token_id</code> are ignored (masked), the loss is only
computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.logits_to_keep",description:`<strong>logits_to_keep</strong> (<code>Union[int, torch.Tensor]</code>, defaults to <code>0</code>) &#x2014;
If an <code>int</code>, compute logits for the last <code>logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
If a <code>torch.Tensor</code>, must be 1D corresponding to the indices to keep in the sequence length dimension.
This is useful when using packed tensor format (single dimension for batch and sequence length).`,name:"logits_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L907",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.idefics3.modeling_idefics3.Idefics3CausalLMOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Config"
>Idefics3Config</a>) and inputs.</p>
<ul>
<li><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).</li>
<li><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).</li>
<li><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>)
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.</li>
<li><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>.
Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</li>
<li><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>.
Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</li>
<li><strong>image_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the image embeddings, <code>(batch_size, num_images, sequence_length, hidden_size)</code>.
image_hidden_states of the model produced by the vision encoder</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.idefics3.modeling_idefics3.Idefics3CausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),V=new Vo({props:{$$slots:{default:[Xo]},$$scope:{ctx:J}}}),Y=new Jt({props:{anchor:"transformers.Idefics3ForConditionalGeneration.forward.example",$$slots:{default:[Ao]},$$scope:{ctx:J}}}),Ie=new G({props:{title:"Idefics3ImageProcessor",local:"transformers.Idefics3ImageProcessor",headingTag:"h2"}}),we=new N({props:{name:"class transformers.Idefics3ImageProcessor",anchor:"transformers.Idefics3ImageProcessor",parameters:[{name:"do_convert_rgb",val:": bool = True"},{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = <Resampling.LANCZOS: 1>"},{name:"do_image_splitting",val:": bool = True"},{name:"max_image_size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": 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_pad",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3ImageProcessor.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. This is useful if the input image is of a different format e.g. RGBA.
Only has an effect if the input image is in the PIL format.`,name:"do_convert_rgb"},{anchor:"transformers.Idefics3ImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image. The longest edge of the image is resized to  be &lt;= <code>size[&quot;longest_edge&quot;]</code>, with the
shortest edge resized to keep the input aspect ratio.`,name:"do_resize"},{anchor:"transformers.Idefics3ImageProcessor.size",description:`<strong>size</strong> (<code>Dict</code>, <em>optional</em>, defaults to <code>{&quot;longest_edge&quot; -- 4 * 364}</code>):
Controls the size of the output image. This is a dictionary containing the key &#x201C;longest_edge&#x201D;.
The image will be resized such that the longest edge is &lt;= <code>size[&quot;longest_edge&quot;]</code> and the shortest edge is resized
to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.Idefics3ImageProcessor.resample",description:`<strong>resample</strong> (<code>Resampling</code>, <em>optional</em>, defaults to <code>Resampling.LANCZOS</code>) &#x2014;
Resampling filter to use when resizing the image.`,name:"resample"},{anchor:"transformers.Idefics3ImageProcessor.do_image_splitting",description:`<strong>do_image_splitting</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to split the image into sub-images concatenated with the original image. They are split into patches
such that each patch has a size of <code>max_image_size[&quot;height&quot;]</code> x <code>max_image_size[&quot;width&quot;]</code>.`,name:"do_image_splitting"},{anchor:"transformers.Idefics3ImageProcessor.max_image_size",description:`<strong>max_image_size</strong> (<code>Dict</code>, <em>optional</em>, defaults to <code>{&quot;longest_edge&quot; -- 364}</code>):
Maximum resolution of the patches of images accepted by the model. This is a dictionary containing the key &#x201C;longest_edge&#x201D;.`,name:"max_image_size"},{anchor:"transformers.Idefics3ImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image. If set to <code>True</code>, the image is rescaled to have pixel values between 0 and 1.`,name:"do_rescale"},{anchor:"transformers.Idefics3ImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1/255</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.Idefics3ImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. If set to <code>True</code>, the image is normalized to have a mean of <code>image_mean</code> and
a standard deviation of <code>image_std</code>.`,name:"do_normalize"},{anchor:"transformers.Idefics3ImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IDEFICS_STANDARD_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.Idefics3ImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IDEFICS_STANDARD_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.Idefics3ImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to pad the images to the largest height and width in the batch and number of images per
sample in the batch, such that the returned tensor is of shape (batch_size, max_num_images, num_channels, max_height, max_width).`,name:"do_pad"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/image_processing_idefics3.py#L251"}}),ve=new N({props:{name:"preprocess",anchor:"transformers.Idefics3ImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"do_convert_rgb",val:": typing.Optional[bool] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = None"},{name:"do_image_splitting",val:": typing.Optional[bool] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"max_image_size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[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_pad",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"return_row_col_info",val:": bool = False"},{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"}],parametersDescription:[{anchor:"transformers.Idefics3ImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
A list of images to preprocess.`,name:"images"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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. With the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.preprocess.do_image_splitting",description:`<strong>do_image_splitting</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_image_splitting</code>) &#x2014;
Whether to split the image into sub-images concatenated with the original image. They are split into patches
such that each patch has a size of <code>max_image_size[&quot;height&quot;]</code> x <code>max_image_size[&quot;width&quot;]</code>.`,name:"do_image_splitting"},{anchor:"transformers.Idefics3ImageProcessor.preprocess.max_image_size",description:`<strong>max_image_size</strong> (<code>Dict</code>, <em>optional</em>, defaults to <code>self.max_image_size</code>) &#x2014;
Maximum resolution of the images. If the image is larger than this size, the image is split into patches.`,name:"max_image_size"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_pad</code>) &#x2014;
Whether or not to pad the images to the largest height and width in the batch.`,name:"do_pad"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.preprocess.return_row_col_info",description:`<strong>return_row_col_info</strong> (<code>bool</code>, <em>optional</em>, default to <code>False</code>) &#x2014;
Whether to return the number of rows and columns of the split images. This is used for the
<code>Idefics3Processor</code> to generate prompt strings based on the number of rows and columns.`,name:"return_row_col_info"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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/idefics3/image_processing_idefics3.py#L602"}}),Ue=new G({props:{title:"Idefics3Processor",local:"transformers.Idefics3Processor",headingTag:"h2"}}),Ce=new N({props:{name:"class transformers.Idefics3Processor",anchor:"transformers.Idefics3Processor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:" = None"},{name:"image_seq_len",val:": int = 169"},{name:"chat_template",val:": typing.Optional[str] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3Processor.image_processor",description:`<strong>image_processor</strong> (<code>Idefics3ImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3ImageProcessor">Idefics3ImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.Idefics3Processor.tokenizer",description:`<strong>tokenizer</strong> (<code>PreTrainedTokenizerBase</code>, <em>optional</em>) &#x2014;
An instance of <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase">PreTrainedTokenizerBase</a>. This should correspond with the model&#x2019;s text model. The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.Idefics3Processor.image_seq_len",description:`<strong>image_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 169) &#x2014;
The length of the image sequence i.e. the number of <image> tokens per image in the input.
This parameter is used to build the string from the input prompt and image tokens and should match the
value the model used. It is computed as: image_seq_len = int(((image_size // patch_size) <strong> 2) / (scale_factor</strong>2))</image>`,name:"image_seq_len"},{anchor:"transformers.Idefics3Processor.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/processing_idefics3.py#L111"}}),je=new N({props:{name:"__call__",anchor:"transformers.Idefics3Processor.__call__",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor'], typing.List[typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]], typing.List[typing.List[typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]]]] = None"},{name:"text",val:": typing.Union[str, ForwardRef('PreTokenizedInput'), typing.List[str], typing.List[ForwardRef('PreTokenizedInput')]] = None"},{name:"audio",val:" = None"},{name:"videos",val:" = None"},{name:"image_seq_len",val:": typing.Optional[int] = None"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.idefics3.processing_idefics3.Idefics3ProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.Idefics3Processor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. If is of type <code>List[ImageInput]</code>, it&#x2019;s assumed that this is for a single prompt i.e. of batch size 1.`,name:"images"},{anchor:"transformers.Idefics3Processor.__call__.text",description:`<strong>text</strong> (<code>Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).
Wherever an image token, <code>&lt;image&gt;</code> is encountered it is expanded to
<code>&lt;fake_token_around_image&gt;</code> + <code>&lt;row_x_col_y&gt;</code> + <code>&lt;image&gt;</code> <em> <code>image_seq_len</code> </em> <fake_token_around_image>\`.</fake_token_around_image>`,name:"text"},{anchor:"transformers.Idefics3Processor.__call__.image_seq_len",description:`<strong>image_seq_len</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The length of the image sequence. If not provided, the default value of self.image_seq_len is used.
image_seq_len should be equal to int(((image_size // patch_size) <strong> 2) / (scale_factor</strong>2))`,name:"image_seq_len"},{anchor:"transformers.Idefics3Processor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>Union[str, TensorType]</code>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizerFast.<strong>call</strong>()</a> for more
information.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/processing_idefics3.py#L178"}}),Q=new Jt({props:{anchor:"transformers.Idefics3Processor.__call__.example",$$slots:{default:[Do]},$$scope:{ctx:J}}}),ze=new Yo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/idefics3.md"}}),{c(){d=l("meta"),I=n(),b=l("p"),m=n(),g(M.$$.fragment),a=n(),T=l("div"),T.innerHTML=lo,tt=n(),g(D.$$.fragment),ot=n(),O=l("p"),O.innerHTML=co,nt=n(),K=l("p"),K.textContent=mo,st=n(),ee=l("ul"),ee.innerHTML=po,at=n(),te=l("p"),te.textContent=go,it=n(),oe=l("p"),oe.innerHTML=ho,rt=n(),g(ne.$$.fragment),lt=n(),se=l("p"),se.textContent=fo,ct=n(),ae=l("p"),ae.innerHTML=uo,dt=n(),ie=l("p"),ie.textContent=_o,mt=n(),g(re.$$.fragment),pt=n(),le=l("p"),le.innerHTML=yo,gt=n(),ce=l("p"),ce.innerHTML=bo,ht=n(),g(de.$$.fragment),ft=n(),C=l("div"),g(me.$$.fragment),Wt=n(),ke=l("p"),ke.innerHTML=Mo,Zt=n(),$e=l("p"),$e.innerHTML=To,qt=n(),g(B.$$.fragment),ut=n(),g(pe.$$.fragment),_t=n(),j=l("div"),g(ge.$$.fragment),Ft=n(),Je=l("p"),Je.innerHTML=Io,Rt=n(),We=l("p"),We.innerHTML=wo,Nt=n(),g(S.$$.fragment),yt=n(),g(he.$$.fragment),bt=n(),z=l("div"),g(fe.$$.fragment),Pt=n(),Ze=l("p"),Ze.textContent=vo,Lt=n(),qe=l("p"),qe.innerHTML=Uo,Gt=n(),Fe=l("p"),Fe.innerHTML=Co,Mt=n(),g(ue.$$.fragment),Tt=n(),w=l("div"),g(_e.$$.fragment),Bt=n(),Re=l("p"),Re.textContent=jo,St=n(),Ne=l("p"),Ne.innerHTML=zo,Et=n(),Pe=l("p"),Pe.innerHTML=xo,Vt=n(),E=l("div"),g(ye.$$.fragment),Yt=n(),Le=l("p"),Le.textContent=ko,It=n(),g(be.$$.fragment),wt=n(),v=l("div"),g(Me.$$.fragment),Ht=n(),Ge=l("p"),Ge.textContent=$o,Qt=n(),Be=l("p"),Be.innerHTML=Jo,Xt=n(),Se=l("p"),Se.innerHTML=Wo,At=n(),W=l("div"),g(Te.$$.fragment),Dt=n(),Ee=l("p"),Ee.innerHTML=Zo,Ot=n(),g(V.$$.fragment),Kt=n(),g(Y.$$.fragment),vt=n(),g(Ie.$$.fragment),Ut=n(),Z=l("div"),g(we.$$.fragment),eo=n(),Ve=l("p"),Ve.textContent=qo,to=n(),H=l("div"),g(ve.$$.fragment),oo=n(),Ye=l("p"),Ye.textContent=Fo,Ct=n(),g(Ue.$$.fragment),jt=n(),x=l("div"),g(Ce.$$.fragment),no=n(),He=l("p"),He.textContent=Ro,so=n(),Qe=l("p"),Qe.innerHTML=No,ao=n(),P=l("div"),g(je.$$.fragment),io=n(),Xe=l("p"),Xe.textContent=Po,ro=n(),g(Q.$$.fragment),zt=n(),g(ze.$$.fragment),xt=n(),Oe=l("p"),this.h()},l(e){const t=Eo("svelte-u9bgzb",document.head);d=c(t,"META",{name:!0,content:!0}),t.forEach(o),I=s(e),b=c(e,"P",{}),$(b).forEach(o),m=s(e),h(M.$$.fragment,e),a=s(e),T=c(e,"DIV",{class:!0,"data-svelte-h":!0}),p(T)!=="svelte-b95w5j"&&(T.innerHTML=lo),tt=s(e),h(D.$$.fragment,e),ot=s(e),O=c(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-1m8d2ny"&&(O.innerHTML=co),nt=s(e),K=c(e,"P",{"data-svelte-h":!0}),p(K)!=="svelte-1ox6z7j"&&(K.textContent=mo),st=s(e),ee=c(e,"UL",{"data-svelte-h":!0}),p(ee)!=="svelte-1nmvj8w"&&(ee.innerHTML=po),at=s(e),te=c(e,"P",{"data-svelte-h":!0}),p(te)!=="svelte-vfdo9a"&&(te.textContent=go),it=s(e),oe=c(e,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-lkhlij"&&(oe.innerHTML=ho),rt=s(e),h(ne.$$.fragment,e),lt=s(e),se=c(e,"P",{"data-svelte-h":!0}),p(se)!=="svelte-ff9k4v"&&(se.textContent=fo),ct=s(e),ae=c(e,"P",{"data-svelte-h":!0}),p(ae)!=="svelte-y46b2t"&&(ae.innerHTML=uo),dt=s(e),ie=c(e,"P",{"data-svelte-h":!0}),p(ie)!=="svelte-1nkyanl"&&(ie.textContent=_o),mt=s(e),h(re.$$.fragment,e),pt=s(e),le=c(e,"P",{"data-svelte-h":!0}),p(le)!=="svelte-1f79iiu"&&(le.innerHTML=yo),gt=s(e),ce=c(e,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-18htqbw"&&(ce.innerHTML=bo),ht=s(e),h(de.$$.fragment,e),ft=s(e),C=c(e,"DIV",{class:!0});var q=$(C);h(me.$$.fragment,q),Wt=s(q),ke=c(q,"P",{"data-svelte-h":!0}),p(ke)!=="svelte-1j3s3yg"&&(ke.innerHTML=Mo),Zt=s(q),$e=c(q,"P",{"data-svelte-h":!0}),p($e)!=="svelte-o55m63"&&($e.innerHTML=To),qt=s(q),h(B.$$.fragment,q),q.forEach(o),ut=s(e),h(pe.$$.fragment,e),_t=s(e),j=c(e,"DIV",{class:!0});var F=$(j);h(ge.$$.fragment,F),Ft=s(F),Je=c(F,"P",{"data-svelte-h":!0}),p(Je)!=="svelte-1ullheb"&&(Je.innerHTML=Io),Rt=s(F),We=c(F,"P",{"data-svelte-h":!0}),p(We)!=="svelte-o55m63"&&(We.innerHTML=wo),Nt=s(F),h(S.$$.fragment,F),F.forEach(o),yt=s(e),h(he.$$.fragment,e),bt=s(e),z=c(e,"DIV",{class:!0});var R=$(z);h(fe.$$.fragment,R),Pt=s(R),Ze=c(R,"P",{"data-svelte-h":!0}),p(Ze)!=="svelte-1q31mhq"&&(Ze.textContent=vo),Lt=s(R),qe=c(R,"P",{"data-svelte-h":!0}),p(qe)!=="svelte-6pahdo"&&(qe.innerHTML=Uo),Gt=s(R),Fe=c(R,"P",{"data-svelte-h":!0}),p(Fe)!=="svelte-hswkmf"&&(Fe.innerHTML=Co),R.forEach(o),Mt=s(e),h(ue.$$.fragment,e),Tt=s(e),w=c(e,"DIV",{class:!0});var k=$(w);h(_e.$$.fragment,k),Bt=s(k),Re=c(k,"P",{"data-svelte-h":!0}),p(Re)!=="svelte-15y4y1x"&&(Re.textContent=jo),St=s(k),Ne=c(k,"P",{"data-svelte-h":!0}),p(Ne)!=="svelte-6pahdo"&&(Ne.innerHTML=zo),Et=s(k),Pe=c(k,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-hswkmf"&&(Pe.innerHTML=xo),Vt=s(k),E=c(k,"DIV",{class:!0});var xe=$(E);h(ye.$$.fragment,xe),Yt=s(xe),Le=c(xe,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-1opccf8"&&(Le.textContent=ko),xe.forEach(o),k.forEach(o),It=s(e),h(be.$$.fragment,e),wt=s(e),v=c(e,"DIV",{class:!0});var L=$(v);h(Me.$$.fragment,L),Ht=s(L),Ge=c(L,"P",{"data-svelte-h":!0}),p(Ge)!=="svelte-1y60j3m"&&(Ge.textContent=$o),Qt=s(L),Be=c(L,"P",{"data-svelte-h":!0}),p(Be)!=="svelte-6pahdo"&&(Be.innerHTML=Jo),Xt=s(L),Se=c(L,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-hswkmf"&&(Se.innerHTML=Wo),At=s(L),W=c(L,"DIV",{class:!0});var X=$(W);h(Te.$$.fragment,X),Dt=s(X),Ee=c(X,"P",{"data-svelte-h":!0}),p(Ee)!=="svelte-1jaxflt"&&(Ee.innerHTML=Zo),Ot=s(X),h(V.$$.fragment,X),Kt=s(X),h(Y.$$.fragment,X),X.forEach(o),L.forEach(o),vt=s(e),h(Ie.$$.fragment,e),Ut=s(e),Z=c(e,"DIV",{class:!0});var Ae=$(Z);h(we.$$.fragment,Ae),eo=s(Ae),Ve=c(Ae,"P",{"data-svelte-h":!0}),p(Ve)!=="svelte-1atvvs0"&&(Ve.textContent=qo),to=s(Ae),H=c(Ae,"DIV",{class:!0});var $t=$(H);h(ve.$$.fragment,$t),oo=s($t),Ye=c($t,"P",{"data-svelte-h":!0}),p(Ye)!=="svelte-1xds4wy"&&(Ye.textContent=Fo),$t.forEach(o),Ae.forEach(o),Ct=s(e),h(Ue.$$.fragment,e),jt=s(e),x=c(e,"DIV",{class:!0});var A=$(x);h(Ce.$$.fragment,A),no=s(A),He=c(A,"P",{"data-svelte-h":!0}),p(He)!=="svelte-1kh2zup"&&(He.textContent=Ro),so=s(A),Qe=c(A,"P",{"data-svelte-h":!0}),p(Qe)!=="svelte-19k6dku"&&(Qe.innerHTML=No),ao=s(A),P=c(A,"DIV",{class:!0});var De=$(P);h(je.$$.fragment,De),io=s(De),Xe=c(De,"P",{"data-svelte-h":!0}),p(Xe)!=="svelte-421t2f"&&(Xe.textContent=Po),ro=s(De),h(Q.$$.fragment,De),De.forEach(o),A.forEach(o),zt=s(e),h(ze.$$.fragment,e),xt=s(e),Oe=c(e,"P",{}),$(Oe).forEach(o),this.h()},h(){U(d,"name","hf:doc:metadata"),U(d,"content",Ko),U(T,"class","flex flex-wrap space-x-1"),U(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),U(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){r(document.head,d),i(e,I,t),i(e,b,t),i(e,m,t),f(M,e,t),i(e,a,t),i(e,T,t),i(e,tt,t),f(D,e,t),i(e,ot,t),i(e,O,t),i(e,nt,t),i(e,K,t),i(e,st,t),i(e,ee,t),i(e,at,t),i(e,te,t),i(e,it,t),i(e,oe,t),i(e,rt,t),f(ne,e,t),i(e,lt,t),i(e,se,t),i(e,ct,t),i(e,ae,t),i(e,dt,t),i(e,ie,t),i(e,mt,t),f(re,e,t),i(e,pt,t),i(e,le,t),i(e,gt,t),i(e,ce,t),i(e,ht,t),f(de,e,t),i(e,ft,t),i(e,C,t),f(me,C,null),r(C,Wt),r(C,ke),r(C,Zt),r(C,$e),r(C,qt),f(B,C,null),i(e,ut,t),f(pe,e,t),i(e,_t,t),i(e,j,t),f(ge,j,null),r(j,Ft),r(j,Je),r(j,Rt),r(j,We),r(j,Nt),f(S,j,null),i(e,yt,t),f(he,e,t),i(e,bt,t),i(e,z,t),f(fe,z,null),r(z,Pt),r(z,Ze),r(z,Lt),r(z,qe),r(z,Gt),r(z,Fe),i(e,Mt,t),f(ue,e,t),i(e,Tt,t),i(e,w,t),f(_e,w,null),r(w,Bt),r(w,Re),r(w,St),r(w,Ne),r(w,Et),r(w,Pe),r(w,Vt),r(w,E),f(ye,E,null),r(E,Yt),r(E,Le),i(e,It,t),f(be,e,t),i(e,wt,t),i(e,v,t),f(Me,v,null),r(v,Ht),r(v,Ge),r(v,Qt),r(v,Be),r(v,Xt),r(v,Se),r(v,At),r(v,W),f(Te,W,null),r(W,Dt),r(W,Ee),r(W,Ot),f(V,W,null),r(W,Kt),f(Y,W,null),i(e,vt,t),f(Ie,e,t),i(e,Ut,t),i(e,Z,t),f(we,Z,null),r(Z,eo),r(Z,Ve),r(Z,to),r(Z,H),f(ve,H,null),r(H,oo),r(H,Ye),i(e,Ct,t),f(Ue,e,t),i(e,jt,t),i(e,x,t),f(Ce,x,null),r(x,no),r(x,He),r(x,so),r(x,Qe),r(x,ao),r(x,P),f(je,P,null),r(P,io),r(P,Xe),r(P,ro),f(Q,P,null),i(e,zt,t),f(ze,e,t),i(e,xt,t),i(e,Oe,t),kt=!0},p(e,[t]){const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),B.$set(q);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),S.$set(F);const R={};t&2&&(R.$$scope={dirty:t,ctx:e}),V.$set(R);const k={};t&2&&(k.$$scope={dirty:t,ctx:e}),Y.$set(k);const xe={};t&2&&(xe.$$scope={dirty:t,ctx:e}),Q.$set(xe)},i(e){kt||(u(M.$$.fragment,e),u(D.$$.fragment,e),u(ne.$$.fragment,e),u(re.$$.fragment,e),u(de.$$.fragment,e),u(me.$$.fragment,e),u(B.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(S.$$.fragment,e),u(he.$$.fragment,e),u(fe.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(ye.$$.fragment,e),u(be.$$.fragment,e),u(Me.$$.fragment,e),u(Te.$$.fragment,e),u(V.$$.fragment,e),u(Y.$$.fragment,e),u(Ie.$$.fragment,e),u(we.$$.fragment,e),u(ve.$$.fragment,e),u(Ue.$$.fragment,e),u(Ce.$$.fragment,e),u(je.$$.fragment,e),u(Q.$$.fragment,e),u(ze.$$.fragment,e),kt=!0)},o(e){_(M.$$.fragment,e),_(D.$$.fragment,e),_(ne.$$.fragment,e),_(re.$$.fragment,e),_(de.$$.fragment,e),_(me.$$.fragment,e),_(B.$$.fragment,e),_(pe.$$.fragment,e),_(ge.$$.fragment,e),_(S.$$.fragment,e),_(he.$$.fragment,e),_(fe.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(ye.$$.fragment,e),_(be.$$.fragment,e),_(Me.$$.fragment,e),_(Te.$$.fragment,e),_(V.$$.fragment,e),_(Y.$$.fragment,e),_(Ie.$$.fragment,e),_(we.$$.fragment,e),_(ve.$$.fragment,e),_(Ue.$$.fragment,e),_(Ce.$$.fragment,e),_(je.$$.fragment,e),_(Q.$$.fragment,e),_(ze.$$.fragment,e),kt=!1},d(e){e&&(o(I),o(b),o(m),o(a),o(T),o(tt),o(ot),o(O),o(nt),o(K),o(st),o(ee),o(at),o(te),o(it),o(oe),o(rt),o(lt),o(se),o(ct),o(ae),o(dt),o(ie),o(mt),o(pt),o(le),o(gt),o(ce),o(ht),o(ft),o(C),o(ut),o(_t),o(j),o(yt),o(bt),o(z),o(Mt),o(Tt),o(w),o(It),o(wt),o(v),o(vt),o(Ut),o(Z),o(Ct),o(jt),o(x),o(zt),o(xt),o(Oe)),o(d),y(M,e),y(D,e),y(ne,e),y(re,e),y(de,e),y(me),y(B),y(pe,e),y(ge),y(S),y(he,e),y(fe),y(ue,e),y(_e),y(ye),y(be,e),y(Me),y(Te),y(V),y(Y),y(Ie,e),y(we),y(ve),y(Ue,e),y(Ce),y(je),y(Q),y(ze,e)}}}const Ko='{"title":"Idefics3","local":"idefics3","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Idefics3Config","local":"transformers.Idefics3Config","sections":[],"depth":2},{"title":"Idefics3VisionConfig","local":"transformers.Idefics3VisionConfig","sections":[],"depth":2},{"title":"Idefics3VisionTransformer","local":"transformers.Idefics3VisionTransformer","sections":[],"depth":2},{"title":"Idefics3Model","local":"transformers.Idefics3Model","sections":[],"depth":2},{"title":"Idefics3ForConditionalGeneration","local":"transformers.Idefics3ForConditionalGeneration","sections":[],"depth":2},{"title":"Idefics3ImageProcessor","local":"transformers.Idefics3ImageProcessor","sections":[],"depth":2},{"title":"Idefics3Processor","local":"transformers.Idefics3Processor","sections":[],"depth":2}],"depth":1}';function en(J){return Go(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dn extends Bo{constructor(d){super(),So(this,d,en,Oo,Lo,{})}}export{dn as component};
