import{s as vn,o as bn,n as ie}from"../chunks/scheduler.9bc65507.js";import{S as yn,i as Tn,g as a,s as i,u as v,A as In,h as r,f as o,c as d,j as u,v as b,y as f,k as h,o as n,a as m,w as y,d as T,t as I,x as M}from"../chunks/index.78c82d43.js";import{T as Uo}from"../chunks/Tip.87d55b76.js";import{D as H}from"../chunks/Docstring.4e7352e2.js";import{C as yt}from"../chunks/CodeBlock.73e038be.js";import{I as Je}from"../chunks/IconCopyLink.bedaa44d.js";import{E as bt}from"../chunks/ExampleCodeBlock.872b014d.js";function Mn($){let s,w="Idefics modeling code in Transformers is for finetuning and inferencing the pre-trained Idefics models.",p,c,g="To train a new Idefics model from scratch use the m4 codebase (a link will be provided once it’s made public)";return{c(){s=a("p"),s.textContent=w,p=i(),c=a("p"),c.textContent=g},l(t){s=r(t,"P",{"data-svelte-h":!0}),f(s)!=="svelte-34c9bw"&&(s.textContent=w),p=d(t),c=r(t,"P",{"data-svelte-h":!0}),f(c)!=="svelte-bofl57"&&(c.textContent=g)},m(t,_){m(t,s,_),m(t,p,_),m(t,c,_)},p:ie,d(t){t&&(o(s),o(p),o(c))}}}function wn($){let s,w="Example:",p,c,g;return c=new yt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMElkZWZpY3NNb2RlbCUyQyUyMElkZWZpY3NDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwSWRlZmljcyUyMGlkZWZpY3MtOWIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwSWRlZmljc0NvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMGlkZWZpY3MtOWIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMElkZWZpY3NNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> IdeficsModel, IdeficsConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Idefics idefics-9b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = IdeficsConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the idefics-9b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IdeficsModel(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(){s=a("p"),s.textContent=w,p=i(),v(c.$$.fragment)},l(t){s=r(t,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=w),p=d(t),b(c.$$.fragment,t)},m(t,_){m(t,s,_),m(t,p,_),y(c,t,_),g=!0},p:ie,i(t){g||(T(c.$$.fragment,t),g=!0)},o(t){I(c.$$.fragment,t),g=!1},d(t){t&&(o(s),o(p)),M(c,t)}}}function xn($){let s,w=`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(){s=a("p"),s.innerHTML=w},l(p){s=r(p,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=w)},m(p,c){m(p,s,c)},p:ie,d(p){p&&o(s)}}}function kn($){let s,w=`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(){s=a("p"),s.innerHTML=w},l(p){s=r(p,"P",{"data-svelte-h":!0}),f(s)!=="svelte-fincs2"&&(s.innerHTML=w)},m(p,c){m(p,s,c)},p:ie,d(p){p&&o(s)}}}function $n($){let s,w="Example:",p,c,g;return c=new yt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBJZGVmaWNzRm9yVmlzaW9uVGV4dDJUZXh0JTBBJTBBbW9kZWwlMjAlM0QlMjBJZGVmaWNzRm9yVmlzaW9uVGV4dDJUZXh0LmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9XRUlHSFRTKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKFBBVEhfVE9fQ09OVkVSVEVEX1RPS0VOSVpFUiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXJzJTNGJTIwQ2FuJTIweW91JTIwdGFsayUyMHRvJTIwbWUlM0YlMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbGVuZ3RoJTNEMzApJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, IdeficsForVisionText2Text

<span class="hljs-meta">&gt;&gt;&gt; </span>model = IdeficsForVisionText2Text.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you consciours? Can you talk to me?\\nI&#x27;m not consciours, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){s=a("p"),s.textContent=w,p=i(),v(c.$$.fragment)},l(t){s=r(t,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=w),p=d(t),b(c.$$.fragment,t)},m(t,_){m(t,s,_),m(t,p,_),y(c,t,_),g=!0},p:ie,i(t){g||(T(c.$$.fragment,t),g=!0)},o(t){I(c.$$.fragment,t),g=!1},d(t){t&&(o(s),o(p)),M(c,t)}}}function Cn($){let s,w="Example:",p,c,g;return c=new yt({props:{code:"Y2hlY2twb2ludCUyMCUzRCUyMCUyMkh1Z2dpbmdGYWNlTTQlMkZpZGVmaWNzLTliJTIyJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCklMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmhpcHMuaGVhcnN0YXBwcy5jb20lMkZobWctcHJvZCUyRmltYWdlcyUyRmN1dGUtcGhvdG9zLW9mLWNhdHMtaW4tZ3Jhc3MtMTU5MzE4NDc3Ny5qcGclMjIlMEFpbWclMjAlM0QlMjBwcm9jZXNzb3IuaW1hZ2VfcHJvY2Vzc29yLmZldGNoX2ltYWdlcyglNUJ1cmwlNUQpJTVCMCU1RCUwQSUwQXByb21wdHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjJVc2VyJTNBJTIyJTJDJTBBJTIwJTIwJTIwJTIwaW1nJTJDJTBBJTIwJTIwJTIwJTIwJTIyRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTBBdCUzQSUyMEFuJTIwaW1hZ2UlMjBvZiUyMHR3byUyMGtpdHRlbnMlMjBpbiUyMGdyYXNzLiUwQSUwQSUyMCUyMCUyMCUyMCUyMlVzZXIlM0ElMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhpcHMuaGVhcnN0YXBwcy5jb20lMkZobWctcHJvZCUyRmltYWdlcyUyRmRvZy1wdW5zLTE1ODE3MDgyMDguanBnJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTBBdCUzQSUyMiUyQyUwQSU1RCUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcihwcm9tcHRzJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbGVuZ3RoJTNEMTAwKSUwQWdlbmVyYXRlZF90ZXh0JTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RA==",highlighted:`checkpoint = <span class="hljs-string">&quot;HuggingFaceM4/idefics-9b&quot;</span>
processor = AutoProcessor.from_pretrained(checkpoint)
url = <span class="hljs-string">&quot;https://hips.hearstapps.com/hmg-prod/images/cute-photos-of-cats-in-grass-1593184777.jpg&quot;</span>
img = processor.image_processor.fetch_images([url])[<span class="hljs-number">0</span>]

prompts = [
    <span class="hljs-string">&quot;User:&quot;</span>,
    img,
    <span class="hljs-string">&quot;Describe this image.
t: An image of two kittens in grass.

    &quot;</span>User:<span class="hljs-string">&quot;,
    &quot;</span>https://hips.hearstapps.com/hmg-prod/images/dog-puns-<span class="hljs-number">1581708208.j</span>pg<span class="hljs-string">&quot;,
    &quot;</span>Describe this image.
t:<span class="hljs-string">&quot;,
]

inputs = processor(prompts, return_tensors=&quot;</span>pt<span class="hljs-string">&quot;)
generated_ids = model.generate(**inputs, max_length=100)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]</span>`,wrap:!1}}),{c(){s=a("p"),s.textContent=w,p=i(),v(c.$$.fragment)},l(t){s=r(t,"P",{"data-svelte-h":!0}),f(s)!=="svelte-11lpom8"&&(s.textContent=w),p=d(t),b(c.$$.fragment,t)},m(t,_){m(t,s,_),m(t,p,_),y(c,t,_),g=!0},p:ie,i(t){g||(T(c.$$.fragment,t),g=!0)},o(t){I(c.$$.fragment,t),g=!1},d(t){t&&(o(s),o(p)),M(c,t)}}}function zn($){let s,w="In this example the <code>prompts</code> will be converted into:",p,c,g;return c=new yt({props:{code:"JTNDcyUzRVVzZXIlM0ElM0NmYWtlX3Rva2VuX2Fyb3VuZF9pbWFnZSUzRSUzQ2ltYWdlJTNFJTNDZmFrZV90b2tlbl9hcm91bmRfaW1hZ2UlM0VEZXNjcmliZSUyMHRoaXMlMjBpbWFnZS4lMEFBc3Npc3RhbnQlM0ElMjBBbiUyMGltYWdlJTIwb2YlMjB0d28lMjBraXR0ZW5zJTIwaW4lMjBncmFzcy4lMEFVc2VyJTNBJTNDZmFrZV90b2tlbl9hcm91bmRfaW1hZ2UlM0UlM0NpbWFnZSUzRSUzQ2Zha2VfdG9rZW5fYXJvdW5kX2ltYWdlJTNFRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTBBQXNzaXN0YW50JTNBJw==",highlighted:`&lt;s&gt;<span class="hljs-title class_">User</span><span class="hljs-symbol">:&lt;fake_token_around_image&gt;&lt;image&gt;&lt;fake_token_around_image&gt;Describe</span> this image.
<span class="hljs-title class_">Assistant</span>: <span class="hljs-title class_">An</span> image of two kittens <span class="hljs-keyword">in</span> grass.
<span class="hljs-title class_">User</span><span class="hljs-symbol">:&lt;fake_token_around_image&gt;&lt;image&gt;&lt;fake_token_around_image&gt;Describe</span> this image.
<span class="hljs-title class_">Assistant</span><span class="hljs-symbol">:<span class="hljs-string">&#x27;</span></span>`,wrap:!1}}),{c(){s=a("p"),s.innerHTML=w,p=i(),v(c.$$.fragment)},l(t){s=r(t,"P",{"data-svelte-h":!0}),f(s)!=="svelte-c8byn"&&(s.innerHTML=w),p=d(t),b(c.$$.fragment,t)},m(t,_){m(t,s,_),m(t,p,_),y(c,t,_),g=!0},p:ie,i(t){g||(T(c.$$.fragment,t),g=!0)},o(t){I(c.$$.fragment,t),g=!1},d(t){t&&(o(s),o(p)),M(c,t)}}}function Un($){let s,w="To do training do:",p,c,g;return c=new yt({props:{code:"aW1hZ2VfdHJhbnNmb3JtJTIwJTNEJTIwdHJhbnNmb3Jtcy5Db21wb3NlKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRyYW5zZm9ybXMuUmFuZG9tUmVzaXplZENyb3AoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKHclMkMlMjBoKSUyQyUyMHNjYWxlJTNEKDAuOSUyQyUyMDEuMCklMkMlMjBpbnRlcnBvbGF0aW9uJTNEdHJhbnNmb3Jtcy5JbnRlcnBvbGF0aW9uTW9kZS5CSUNVQklDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRyYW5zZm9ybXMuVG9UZW5zb3IoKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRyYW5zZm9ybXMuTm9ybWFsaXplKG1lYW4lM0RzZWxmLmltYWdlX21lYW4lMkMlMjBzdGQlM0RzZWxmLmltYWdlX3N0ZCklMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHByb21wdHMlMkMlMjB0cmFuc2Zvcm0lM0RpbWFnZV90cmFuc2Zvcm0lMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKQ==",highlighted:`image_transform = transforms.Compose(
    [
        transforms.RandomResizedCrop(
            (w, h), scale=(<span class="hljs-number">0.9</span>, <span class="hljs-number">1.0</span>), interpolation=transforms.InterpolationMode.BICUBIC
        ),
        transforms.ToTensor(),
        transforms.Normalize(mean=self.image_mean, std=self.image_std),
    ]
)
inputs = processor(prompts, transform=image_transform, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`,wrap:!1}}),{c(){s=a("p"),s.textContent=w,p=i(),v(c.$$.fragment)},l(t){s=r(t,"P",{"data-svelte-h":!0}),f(s)!=="svelte-1jbe3nb"&&(s.textContent=w),p=d(t),b(c.$$.fragment,t)},m(t,_){m(t,s,_),m(t,p,_),y(c,t,_),g=!0},p:ie,i(t){g||(T(c.$$.fragment,t),g=!0)},o(t){I(c.$$.fragment,t),g=!1},d(t){t&&(o(s),o(p)),M(c,t)}}}function Jn($){let s,w,p,c,g,t,_,de,Bt,Ne,Jo="IDEFICS",Tt,W,A,it,le,Dt,Fe,No="Overview",It,ce,Fo='The IDEFICS model was proposed in <a href="https://huggingface.co/papers/2306.16527" rel="nofollow">OBELICS: An Open Web-Scale Filtered Dataset of Interleaved Image-Text Documents</a> by Hugo Laurençon, Lucile Saulnier, Léo Tronchon, Stas Bekman, Amanpreet Singh, Anton Lozhkov, Thomas Wang, Siddharth Karamcheti, Alexander M. Rush, Douwe Kiela, Matthieu Cord, Victor Sanh',Mt,me,Po="The abstract from the paper is the following:",wt,pe,jo="<em>Large multimodal models trained on natural documents, which interleave images and text, outperform models trained on image-text pairs on various multimodal benchmarks that require reasoning over one or multiple images to generate a text. However, the datasets used to train these models have not been released, and the collection process has not been fully specified. We introduce the OBELICS dataset, an open web-scale filtered dataset of interleaved image-text documents comprising 141 million web pages extracted from Common Crawl, 353 million associated images, and 115 billion text tokens. We describe the dataset creation process, present comprehensive filtering rules, and provide an analysis of the dataset’s content. To show the viability of OBELISC, we train an 80 billion parameters vision and language model on the dataset and obtain competitive performance on various multimodal benchmarks. We release the code to reproduce the dataset along with the dataset itself.</em>",xt,fe,Wo='This model was contributed by <a href="https://huggingface.co/HuggingFaceM4" rel="nofollow">HuggingFaceM4</a>. The original code can be found <a href="INSERT%20LINK%20TO%20GITHUB%20REPO%20HERE">here</a>. (TODO: don’t have a public link yet).',kt,B,$t,E,D,dt,he,qt,Pe,Eo="IdeficsConfig",Ct,C,ge,Gt,je,Zo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsModel">IdeficsModel</a>. It is used to instantiate an
Idefics 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 Idefics-9B.`,Xt,We,Vo='e.g. <a href="https://huggingface.co/HuggingFaceM4/idefics-9b" rel="nofollow">HuggingFaceM4/idefics-9b</a>',Ot,Ee,Lo=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/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/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Yt,q,zt,Z,G,lt,ue,Qt,Ze,So="IdeficsModel",Ut,z,_e,Kt,Ve,Ro=`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.34.0/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.)`,eo,Le,Ho=`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.`,to,Se,Ao="Transformer decoder consisting of <code>config.num_hidden_layers</code> layers. Each layer is a <code>IdeficsDecoderLayer</code>",oo,F,ve,no,Re,Bo='The <a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsModel">IdeficsModel</a> forward method, overrides the <code>__call__</code> special method.',so,X,Jt,V,O,ct,be,ao,He,Do="IdeficsForVisionText2Text",Nt,L,ye,ro,J,Te,io,Ae,qo='The <a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsForVisionText2Text">IdeficsForVisionText2Text</a> forward method, overrides the <code>__call__</code> special method.',lo,Y,co,Q,Ft,S,K,mt,Ie,mo,Be,Go="IdeficsImageProcessor",Pt,N,Me,po,De,Xo="Constructs a Idefics image processor.",fo,ee,we,ho,qe,Oo="Preprocess a batch of images.",jt,R,te,pt,xe,go,Ge,Yo="IdeficsProcessor",Wt,U,ke,uo,Xe,Qo="Constructs a IDEFICS processor which wraps a LLama tokenizer and IDEFICS image processor into a single processor.",_o,Oe,Ko=`<a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsProcessor">IdeficsProcessor</a> offers all the functionalities of <a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsImageProcessor">IdeficsImageProcessor</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>. See
the docstring of <a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsProcessor.__call__"><strong>call</strong>()</a> and <code>decode()</code> for more information.`,vo,x,$e,bo,Ye,en=`This method takes batched or non-batched prompts made of text and images and converts them into prompts that
the model was trained on and prepares the image pixel values for the model to process.`,yo,Qe,tn="Detailed explanation:",To,Ke,on="Each entry in <code>prompts</code> is either a text to be passed as is or an image that will be processed.",Io,et,nn="An image can be either an image object (<code>PIL.Image</code>) or a url from which the image can be retrieved.",Mo,tt,sn=`When the processor encounters an image it’ll inject <code>&lt;fake_token_around_image&gt;&lt;image&gt;&lt;fake_token_around_image&gt;</code>
entry into the prompt.`,wo,oe,xo,ne,ko,ot,an=`and the two images will be massaged using <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">IdeficsImageProcessor.<strong>call</strong>()</a> method and placed inside the
<code>pixel_values</code> dict entry of the return value.`,$o,nt,rn=`This example also examplifies that images can be passed as objects or as text urls. It can be seen that the
first image is passed as object and the second one as a url.`,Co,se,zo,st,dn="In order to help debug prompt generation enable <code>debug=True</code> which will show you what’s happening.",Et,ft,Zt;return de=new Je({}),le=new Je({}),B=new Uo({props:{warning:!0,$$slots:{default:[Mn]},$$scope:{ctx:$}}}),he=new Je({}),ge=new H({props:{name:"class transformers.IdeficsConfig",anchor:"transformers.IdeficsConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"additional_vocab_size",val:" = 0"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 11008"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"dropout",val:" = 0.0"},{name:"hidden_act",val:" = 'silu'"},{name:"initializer_range",val:" = 0.02"},{name:"alpha_initializer",val:" = 'zeros'"},{name:"alphas_initializer_range",val:" = 0.0"},{name:"alpha_type",val:" = 'float'"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"cross_layer_interval",val:" = 1"},{name:"qk_layer_norms",val:" = False"},{name:"freeze_text_layers",val:" = True"},{name:"freeze_text_module_exceptions",val:" = []"},{name:"freeze_lm_head",val:" = False"},{name:"freeze_vision_layers",val:" = True"},{name:"freeze_vision_module_exceptions",val:" = []"},{name:"use_resampler",val:" = False"},{name:"vision_config",val:" = None"},{name:"perceiver_config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsConfig.additional_vocab_size",description:`<strong>additional_vocab_size</strong> (<code>int</code>, *optional\`, defaults to 0) &#x2014;
Additional vocabulary size of the model, typically for the special &#x201D;<img>&#x201D; token. Additional vocab tokens
are always trainable whereas regular vocab tokens can be frozen or not.`,name:"additional_vocab_size"},{anchor:"transformers.IdeficsConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the Idefics model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsModel">~IdeficsModel</a>`,name:"vocab_size"},{anchor:"transformers.IdeficsConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.IdeficsConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.IdeficsConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.IdeficsConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.IdeficsConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.IdeficsConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.IdeficsConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.IdeficsConfig.alpha_initializer",description:`<strong>alpha_initializer</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;zeros&quot;</code>) &#x2014;
Initialization type for the alphas.`,name:"alpha_initializer"},{anchor:"transformers.IdeficsConfig.alphas_initializer_range",description:`<strong>alphas_initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing the alphas in the Gated Cross
Attention.`,name:"alphas_initializer_range"},{anchor:"transformers.IdeficsConfig.alpha_type",description:`<strong>alpha_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;float&quot;</code>) &#x2014;
Whether the gating alphas should be vectors or single floats.`,name:"alpha_type"},{anchor:"transformers.IdeficsConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.IdeficsConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.IdeficsConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.IdeficsConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.IdeficsConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.IdeficsConfig.tie_word_embeddings(bool,",description:`<strong>tie_word_embeddings(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings(bool,"},{anchor:"transformers.IdeficsConfig.cross_layer_interval",description:`<strong>cross_layer_interval</strong> (<code>int</code>, <em>optional</em>, default to 1) &#x2014;
Interval for cross attention (from text to image) layers.`,name:"cross_layer_interval"},{anchor:"transformers.IdeficsConfig.qk_layer_norms",description:"<strong>qk_layer_norms</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to add layer norm after q and k",name:"qk_layer_norms"},{anchor:"transformers.IdeficsConfig.freeze_text_layers",description:"<strong>freeze_text_layers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014; Whether to freeze text layers",name:"freeze_text_layers"},{anchor:"transformers.IdeficsConfig.freeze_text_module_exceptions",description:`<strong>freeze_text_module_exceptions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>[]</code>) &#x2014;
Exceptions to freezing text layers when <code>freeze_text_layers</code> is <code>True</code>`,name:"freeze_text_module_exceptions"},{anchor:"transformers.IdeficsConfig.freeze_lm_head",description:"<strong>freeze_lm_head</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to freeze lm head",name:"freeze_lm_head"},{anchor:"transformers.IdeficsConfig.freeze_vision_layers",description:"<strong>freeze_vision_layers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;  Whether to freeze vision layers",name:"freeze_vision_layers"},{anchor:"transformers.IdeficsConfig.freeze_vision_module_exceptions",description:`<strong>freeze_vision_module_exceptions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>[]</code>) &#x2014;
Exceptions to freezing vision layers when <code>freeze_vision_layers</code> is <code>True</code>`,name:"freeze_vision_module_exceptions"},{anchor:"transformers.IdeficsConfig.use_resampler",description:"<strong>use_resampler</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to use the Resampler",name:"use_resampler"},{anchor:"transformers.IdeficsConfig.vision_config",description:"<strong>vision_config</strong> (<code>IdeficsVisionConfig</code>,  <em>optional</em>) &#x2014; Custom vision config or dict",name:"vision_config"},{anchor:"transformers.IdeficsConfig.perceiver_config",description:"<strong>perceiver_config</strong> (<code>IdeficsPerceiverConfig</code>,  <em>optional</em>) &#x2014; Custom perceiver config or dict",name:"perceiver_config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/configuration_idefics.py#L159"}}),q=new bt({props:{anchor:"transformers.IdeficsConfig.example",$$slots:{default:[wn]},$$scope:{ctx:$}}}),ue=new Je({}),_e=new H({props:{name:"class transformers.IdeficsModel",anchor:"transformers.IdeficsModel",parameters:[{name:"config",val:": IdeficsConfig"}],parametersDescription:[{anchor:"transformers.IdeficsModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsConfig">IdeficsConfig</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/v4.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; IdeficsConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/modeling_idefics.py#L1049"}}),ve=new H({props:{name:"forward",anchor:"transformers.IdeficsModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_encoder_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"perceiver_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = 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:"interpolate_pos_encoding",val:": typing.Optional[bool] = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IdeficsModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.IdeficsModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.IdeficsModel.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>. <a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.IdeficsModel.forward.past_key_values",description:`<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>) &#x2014;
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 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_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>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/modeling_idefics.py#L1151"}}),X=new Uo({props:{$$slots:{default:[xn]},$$scope:{ctx:$}}}),be=new Je({}),ye=new H({props:{name:"class transformers.IdeficsForVisionText2Text",anchor:"transformers.IdeficsForVisionText2Text",parameters:[{name:"config",val:""},{name:"vision_model",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/modeling_idefics.py#L1405"}}),Te=new H({props:{name:"forward",anchor:"transformers.IdeficsForVisionText2Text.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_encoder_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"perceiver_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = 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:"interpolate_pos_encoding",val:": typing.Optional[bool] = False"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.IdeficsForVisionText2Text.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.IdeficsForVisionText2Text.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.IdeficsForVisionText2Text.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>. <a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.IdeficsForVisionText2Text.forward.past_key_values",description:`<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>) &#x2014;
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 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_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>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/modeling_idefics.py#L1463",returnDescription:`
<p>A <code>transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast</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/v4.34.0/en/model_doc/idefics#transformers.IdeficsConfig"
>IdeficsConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><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>.</p>
<p>image_hidden_states of the model produced by the vision encoder, and optionally by the perceiver</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Y=new Uo({props:{$$slots:{default:[kn]},$$scope:{ctx:$}}}),Q=new bt({props:{anchor:"transformers.IdeficsForVisionText2Text.forward.example",$$slots:{default:[$n]},$$scope:{ctx:$}}}),Ie=new Je({}),Me=new H({props:{name:"class transformers.IdeficsImageProcessor",anchor:"transformers.IdeficsImageProcessor",parameters:[{name:"image_size",val:": int = 224"},{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:"image_num_channels",val:": typing.Optional[int] = 3"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsImageProcessor.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>224</code>) &#x2014;
Resize to image size`,name:"image_size"},{anchor:"transformers.IdeficsImageProcessor.image_num_channels",description:`<strong>image_num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>3</code>) &#x2014;
Number of image channels.`,name:"image_num_channels"},{anchor:"transformers.IdeficsImageProcessor.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.IdeficsImageProcessor.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"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/image_processing_idefics.py#L51"}}),we=new H({props:{name:"preprocess",anchor:"transformers.IdeficsImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"image_num_channels",val:": typing.Optional[int] = 3"},{name:"image_size",val:": typing.Union[typing.Dict[str, int], NoneType] = 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:"transform",val:": typing.Callable = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
A list of images to preprocess.`,name:"images"},{anchor:"transformers.IdeficsImageProcessor.preprocess.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.image_size</code>) &#x2014;
Resize to image size`,name:"image_size"},{anchor:"transformers.IdeficsImageProcessor.preprocess.image_num_channels",description:`<strong>image_num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.image_num_channels</code>) &#x2014;
Number of image channels.`,name:"image_num_channels"},{anchor:"transformers.IdeficsImageProcessor.preprocess.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.IdeficsImageProcessor.preprocess.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.IdeficsImageProcessor.preprocess.transform",description:`<strong>transform</strong> (<code>Callable</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
A custom transform function that accepts a single image can be passed for training. For example,
<code>torchvision.Compose</code> can be used to compose multiple transforms. If <code>None</code> - an inference mode is
assumed - and then a preset of inference-specific transforms will be applied to the images`,name:"transform"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/image_processing_idefics.py#L87",returnDescription:`
<p>a PyTorch tensor of the processed images</p>
`}}),xe=new Je({}),ke=new H({props:{name:"class transformers.IdeficsProcessor",anchor:"transformers.IdeficsProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:" = None"},{name:"image_size",val:" = 224"},{name:"add_end_of_utterance_token",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsProcessor.image_processor",description:`<strong>image_processor</strong> (<code>IdeficsImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.34.0/en/model_doc/idefics#transformers.IdeficsImageProcessor">IdeficsImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.IdeficsProcessor.tokenizer",description:`<strong>tokenizer</strong> (<code>LlamaTokenizerFast</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.34.0/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>. The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.IdeficsProcessor.image_size",description:"<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014; Image size (assuming a square image)",name:"image_size"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/processing_idefics.py#L108"}}),$e=new H({props:{name:"__call__",anchor:"transformers.IdeficsProcessor.__call__",parameters:[{name:"prompts",val:": typing.Union[typing.List[str], typing.List[typing.List[str]]]"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"transform",val:": typing.Callable = None"},{name:"add_eos_token",val:" = False"},{name:"add_end_of_utterance_token",val:" = None"},{name:"debug",val:" = False"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = <TensorType.PYTORCH: 'pt'>"}],parametersDescription:[{anchor:"transformers.IdeficsProcessor.__call__.prompts",description:`<strong>prompts</strong> (<code>Union[List[TextInput], [List[List[TextInput]]]]</code>) &#x2014;
either a single prompt or a batched list of prompts - see the detailed description immediately after
the end of the arguments doc section.`,name:"prompts"},{anchor:"transformers.IdeficsProcessor.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.34.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding
index) among:<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.IdeficsProcessor.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.IdeficsProcessor.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Activates truncation to cut input sequences longer than <code>max_length</code> to <code>max_length</code>.`,name:"truncation"},{anchor:"transformers.IdeficsProcessor.__call__.transform",description:`<strong>transform</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A custom transform function that accepts a single image can be passed for training. For example,
<code>torchvision.Compose</code> can be used to compose multiple functions. If <code>None</code> a preset inference-specific
set of transforms will be applied to the images`,name:"transform"},{anchor:"transformers.IdeficsProcessor.__call__.add_eos_token",description:"<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;\nAdds <code>eos_token</code> at the end of the final prompt if True`",name:"add_eos_token"},{anchor:"transformers.IdeficsProcessor.__call__.add_end_of_utterance_token",description:`<strong>add_end_of_utterance_token</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to automatically add <code>&lt;end_of_utterance&gt;</code> after each prompt&#x2019;s text input (unless followed by an
image). If <code>None</code> the tokenizer will be checked instead and if this token is found in
<code>additional_special_tokens</code> then the value will be <code>True</code>.`,name:"add_end_of_utterance_token"},{anchor:"transformers.IdeficsProcessor.__call__.debug",description:`<strong>debug</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
<code>True</code> value will help debug prompt generation by dumping useful information`,name:"debug"},{anchor:"transformers.IdeficsProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>, defaults to <code>TensorType.PYTORCH</code>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/idefics/processing_idefics.py#L148",returnDescription:`
<p><code>input_ids</code>, <code>attention_mask</code>, <code>pixel_values</code>, <code>image_attention_mask</code> which can be
directly passed to <code>model.generate</code></p>
`,returnType:`
<p>a dict with entries</p>
`}}),oe=new bt({props:{anchor:"transformers.IdeficsProcessor.__call__.example",$$slots:{default:[Cn]},$$scope:{ctx:$}}}),ne=new bt({props:{anchor:"transformers.IdeficsProcessor.__call__.example-2",$$slots:{default:[zn]},$$scope:{ctx:$}}}),se=new bt({props:{anchor:"transformers.IdeficsProcessor.__call__.example-3",$$slots:{default:[Un]},$$scope:{ctx:$}}}),{c(){s=a("meta"),w=i(),p=a("p"),c=i(),g=a("h1"),t=a("a"),_=a("span"),v(de.$$.fragment),Bt=i(),Ne=a("span"),Ne.textContent=Jo,Tt=i(),W=a("h2"),A=a("a"),it=a("span"),v(le.$$.fragment),Dt=i(),Fe=a("span"),Fe.textContent=No,It=i(),ce=a("p"),ce.innerHTML=Fo,Mt=i(),me=a("p"),me.textContent=Po,wt=i(),pe=a("p"),pe.innerHTML=jo,xt=i(),fe=a("p"),fe.innerHTML=Wo,kt=i(),v(B.$$.fragment),$t=i(),E=a("h2"),D=a("a"),dt=a("span"),v(he.$$.fragment),qt=i(),Pe=a("span"),Pe.textContent=Eo,Ct=i(),C=a("div"),v(ge.$$.fragment),Gt=i(),je=a("p"),je.innerHTML=Zo,Xt=i(),We=a("p"),We.innerHTML=Vo,Ot=i(),Ee=a("p"),Ee.innerHTML=Lo,Yt=i(),v(q.$$.fragment),zt=i(),Z=a("h2"),G=a("a"),lt=a("span"),v(ue.$$.fragment),Qt=i(),Ze=a("span"),Ze.textContent=So,Ut=i(),z=a("div"),v(_e.$$.fragment),Kt=i(),Ve=a("p"),Ve.innerHTML=Ro,eo=i(),Le=a("p"),Le.innerHTML=Ho,to=i(),Se=a("p"),Se.innerHTML=Ao,oo=i(),F=a("div"),v(ve.$$.fragment),no=i(),Re=a("p"),Re.innerHTML=Bo,so=i(),v(X.$$.fragment),Jt=i(),V=a("h2"),O=a("a"),ct=a("span"),v(be.$$.fragment),ao=i(),He=a("span"),He.textContent=Do,Nt=i(),L=a("div"),v(ye.$$.fragment),ro=i(),J=a("div"),v(Te.$$.fragment),io=i(),Ae=a("p"),Ae.innerHTML=qo,lo=i(),v(Y.$$.fragment),co=i(),v(Q.$$.fragment),Ft=i(),S=a("h2"),K=a("a"),mt=a("span"),v(Ie.$$.fragment),mo=i(),Be=a("span"),Be.textContent=Go,Pt=i(),N=a("div"),v(Me.$$.fragment),po=i(),De=a("p"),De.textContent=Xo,fo=i(),ee=a("div"),v(we.$$.fragment),ho=i(),qe=a("p"),qe.textContent=Oo,jt=i(),R=a("h2"),te=a("a"),pt=a("span"),v(xe.$$.fragment),go=i(),Ge=a("span"),Ge.textContent=Yo,Wt=i(),U=a("div"),v(ke.$$.fragment),uo=i(),Xe=a("p"),Xe.textContent=Qo,_o=i(),Oe=a("p"),Oe.innerHTML=Ko,vo=i(),x=a("div"),v($e.$$.fragment),bo=i(),Ye=a("p"),Ye.textContent=en,yo=i(),Qe=a("p"),Qe.textContent=tn,To=i(),Ke=a("p"),Ke.innerHTML=on,Io=i(),et=a("p"),et.innerHTML=nn,Mo=i(),tt=a("p"),tt.innerHTML=sn,wo=i(),v(oe.$$.fragment),xo=i(),v(ne.$$.fragment),ko=i(),ot=a("p"),ot.innerHTML=an,$o=i(),nt=a("p"),nt.textContent=rn,Co=i(),v(se.$$.fragment),zo=i(),st=a("p"),st.innerHTML=dn,Et=i(),ft=a("p"),this.h()},l(e){const l=In("svelte-1phssyn",document.head);s=r(l,"META",{name:!0,content:!0}),l.forEach(o),w=d(e),p=r(e,"P",{}),u(p).forEach(o),c=d(e),g=r(e,"H1",{class:!0});var Ce=u(g);t=r(Ce,"A",{id:!0,class:!0,href:!0});var ht=u(t);_=r(ht,"SPAN",{});var gt=u(_);b(de.$$.fragment,gt),gt.forEach(o),ht.forEach(o),Bt=d(Ce),Ne=r(Ce,"SPAN",{"data-svelte-h":!0}),f(Ne)!=="svelte-14dxj50"&&(Ne.textContent=Jo),Ce.forEach(o),Tt=d(e),W=r(e,"H2",{class:!0});var ze=u(W);A=r(ze,"A",{id:!0,class:!0,href:!0});var ut=u(A);it=r(ut,"SPAN",{});var _t=u(it);b(le.$$.fragment,_t),_t.forEach(o),ut.forEach(o),Dt=d(ze),Fe=r(ze,"SPAN",{"data-svelte-h":!0}),f(Fe)!=="svelte-1jsw1pg"&&(Fe.textContent=No),ze.forEach(o),It=d(e),ce=r(e,"P",{"data-svelte-h":!0}),f(ce)!=="svelte-jddp08"&&(ce.innerHTML=Fo),Mt=d(e),me=r(e,"P",{"data-svelte-h":!0}),f(me)!=="svelte-vfdo9a"&&(me.textContent=Po),wt=d(e),pe=r(e,"P",{"data-svelte-h":!0}),f(pe)!=="svelte-18xi2yr"&&(pe.innerHTML=jo),xt=d(e),fe=r(e,"P",{"data-svelte-h":!0}),f(fe)!=="svelte-1nhi3a3"&&(fe.innerHTML=Wo),kt=d(e),b(B.$$.fragment,e),$t=d(e),E=r(e,"H2",{class:!0});var Ue=u(E);D=r(Ue,"A",{id:!0,class:!0,href:!0});var vt=u(D);dt=r(vt,"SPAN",{});var ln=u(dt);b(he.$$.fragment,ln),ln.forEach(o),vt.forEach(o),qt=d(Ue),Pe=r(Ue,"SPAN",{"data-svelte-h":!0}),f(Pe)!=="svelte-13ynycy"&&(Pe.textContent=Eo),Ue.forEach(o),Ct=d(e),C=r(e,"DIV",{class:!0});var P=u(C);b(ge.$$.fragment,P),Gt=d(P),je=r(P,"P",{"data-svelte-h":!0}),f(je)!=="svelte-15segli"&&(je.innerHTML=Zo),Xt=d(P),We=r(P,"P",{"data-svelte-h":!0}),f(We)!=="svelte-n7bqeh"&&(We.innerHTML=Vo),Ot=d(P),Ee=r(P,"P",{"data-svelte-h":!0}),f(Ee)!=="svelte-10kqkkl"&&(Ee.innerHTML=Lo),Yt=d(P),b(q.$$.fragment,P),P.forEach(o),zt=d(e),Z=r(e,"H2",{class:!0});var Vt=u(Z);G=r(Vt,"A",{id:!0,class:!0,href:!0});var cn=u(G);lt=r(cn,"SPAN",{});var mn=u(lt);b(ue.$$.fragment,mn),mn.forEach(o),cn.forEach(o),Qt=d(Vt),Ze=r(Vt,"SPAN",{"data-svelte-h":!0}),f(Ze)!=="svelte-jh5q25"&&(Ze.textContent=So),Vt.forEach(o),Ut=d(e),z=r(e,"DIV",{class:!0});var j=u(z);b(_e.$$.fragment,j),Kt=d(j),Ve=r(j,"P",{"data-svelte-h":!0}),f(Ve)!=="svelte-vmn8lj"&&(Ve.innerHTML=Ro),eo=d(j),Le=r(j,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-hswkmf"&&(Le.innerHTML=Ho),to=d(j),Se=r(j,"P",{"data-svelte-h":!0}),f(Se)!=="svelte-1rhjct8"&&(Se.innerHTML=Ao),oo=d(j),F=r(j,"DIV",{class:!0});var at=u(F);b(ve.$$.fragment,at),no=d(at),Re=r(at,"P",{"data-svelte-h":!0}),f(Re)!=="svelte-1o75ids"&&(Re.innerHTML=Bo),so=d(at),b(X.$$.fragment,at),at.forEach(o),j.forEach(o),Jt=d(e),V=r(e,"H2",{class:!0});var Lt=u(V);O=r(Lt,"A",{id:!0,class:!0,href:!0});var pn=u(O);ct=r(pn,"SPAN",{});var fn=u(ct);b(be.$$.fragment,fn),fn.forEach(o),pn.forEach(o),ao=d(Lt),He=r(Lt,"SPAN",{"data-svelte-h":!0}),f(He)!=="svelte-hwdxs5"&&(He.textContent=Do),Lt.forEach(o),Nt=d(e),L=r(e,"DIV",{class:!0});var St=u(L);b(ye.$$.fragment,St),ro=d(St),J=r(St,"DIV",{class:!0});var ae=u(J);b(Te.$$.fragment,ae),io=d(ae),Ae=r(ae,"P",{"data-svelte-h":!0}),f(Ae)!=="svelte-qxpkyg"&&(Ae.innerHTML=qo),lo=d(ae),b(Y.$$.fragment,ae),co=d(ae),b(Q.$$.fragment,ae),ae.forEach(o),St.forEach(o),Ft=d(e),S=r(e,"H2",{class:!0});var Rt=u(S);K=r(Rt,"A",{id:!0,class:!0,href:!0});var hn=u(K);mt=r(hn,"SPAN",{});var gn=u(mt);b(Ie.$$.fragment,gn),gn.forEach(o),hn.forEach(o),mo=d(Rt),Be=r(Rt,"SPAN",{"data-svelte-h":!0}),f(Be)!=="svelte-cm7jjr"&&(Be.textContent=Go),Rt.forEach(o),Pt=d(e),N=r(e,"DIV",{class:!0});var rt=u(N);b(Me.$$.fragment,rt),po=d(rt),De=r(rt,"P",{"data-svelte-h":!0}),f(De)!=="svelte-1m1ucrf"&&(De.textContent=Xo),fo=d(rt),ee=r(rt,"DIV",{class:!0});var Ht=u(ee);b(we.$$.fragment,Ht),ho=d(Ht),qe=r(Ht,"P",{"data-svelte-h":!0}),f(qe)!=="svelte-1xds4wy"&&(qe.textContent=Oo),Ht.forEach(o),rt.forEach(o),jt=d(e),R=r(e,"H2",{class:!0});var At=u(R);te=r(At,"A",{id:!0,class:!0,href:!0});var un=u(te);pt=r(un,"SPAN",{});var _n=u(pt);b(xe.$$.fragment,_n),_n.forEach(o),un.forEach(o),go=d(At),Ge=r(At,"SPAN",{"data-svelte-h":!0}),f(Ge)!=="svelte-1r1youe"&&(Ge.textContent=Yo),At.forEach(o),Wt=d(e),U=r(e,"DIV",{class:!0});var re=u(U);b(ke.$$.fragment,re),uo=d(re),Xe=r(re,"P",{"data-svelte-h":!0}),f(Xe)!=="svelte-ntsjs9"&&(Xe.textContent=Qo),_o=d(re),Oe=r(re,"P",{"data-svelte-h":!0}),f(Oe)!=="svelte-1voc1bg"&&(Oe.innerHTML=Ko),vo=d(re),x=r(re,"DIV",{class:!0});var k=u(x);b($e.$$.fragment,k),bo=d(k),Ye=r(k,"P",{"data-svelte-h":!0}),f(Ye)!=="svelte-1dgzv8j"&&(Ye.textContent=en),yo=d(k),Qe=r(k,"P",{"data-svelte-h":!0}),f(Qe)!=="svelte-qv5ndj"&&(Qe.textContent=tn),To=d(k),Ke=r(k,"P",{"data-svelte-h":!0}),f(Ke)!=="svelte-xvvltg"&&(Ke.innerHTML=on),Io=d(k),et=r(k,"P",{"data-svelte-h":!0}),f(et)!=="svelte-15i05k0"&&(et.innerHTML=nn),Mo=d(k),tt=r(k,"P",{"data-svelte-h":!0}),f(tt)!=="svelte-gstss4"&&(tt.innerHTML=sn),wo=d(k),b(oe.$$.fragment,k),xo=d(k),b(ne.$$.fragment,k),ko=d(k),ot=r(k,"P",{"data-svelte-h":!0}),f(ot)!=="svelte-1bnak8g"&&(ot.innerHTML=an),$o=d(k),nt=r(k,"P",{"data-svelte-h":!0}),f(nt)!=="svelte-9aj4iv"&&(nt.textContent=rn),Co=d(k),b(se.$$.fragment,k),zo=d(k),st=r(k,"P",{"data-svelte-h":!0}),f(st)!=="svelte-1drva0b"&&(st.innerHTML=dn),k.forEach(o),re.forEach(o),Et=d(e),ft=r(e,"P",{}),u(ft).forEach(o),this.h()},h(){h(s,"name","hf:doc:metadata"),h(s,"content",JSON.stringify(Nn)),h(t,"id","idefics"),h(t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(t,"href","#idefics"),h(g,"class","relative group"),h(A,"id","overview"),h(A,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(A,"href","#overview"),h(W,"class","relative group"),h(D,"id","transformers.IdeficsConfig"),h(D,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(D,"href","#transformers.IdeficsConfig"),h(E,"class","relative group"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(G,"id","transformers.IdeficsModel"),h(G,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(G,"href","#transformers.IdeficsModel"),h(Z,"class","relative group"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(O,"id","transformers.IdeficsForVisionText2Text"),h(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(O,"href","#transformers.IdeficsForVisionText2Text"),h(V,"class","relative group"),h(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(K,"id","transformers.IdeficsImageProcessor"),h(K,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(K,"href","#transformers.IdeficsImageProcessor"),h(S,"class","relative group"),h(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(te,"id","transformers.IdeficsProcessor"),h(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(te,"href","#transformers.IdeficsProcessor"),h(R,"class","relative group"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(U,"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,l){n(document.head,s),m(e,w,l),m(e,p,l),m(e,c,l),m(e,g,l),n(g,t),n(t,_),y(de,_,null),n(g,Bt),n(g,Ne),m(e,Tt,l),m(e,W,l),n(W,A),n(A,it),y(le,it,null),n(W,Dt),n(W,Fe),m(e,It,l),m(e,ce,l),m(e,Mt,l),m(e,me,l),m(e,wt,l),m(e,pe,l),m(e,xt,l),m(e,fe,l),m(e,kt,l),y(B,e,l),m(e,$t,l),m(e,E,l),n(E,D),n(D,dt),y(he,dt,null),n(E,qt),n(E,Pe),m(e,Ct,l),m(e,C,l),y(ge,C,null),n(C,Gt),n(C,je),n(C,Xt),n(C,We),n(C,Ot),n(C,Ee),n(C,Yt),y(q,C,null),m(e,zt,l),m(e,Z,l),n(Z,G),n(G,lt),y(ue,lt,null),n(Z,Qt),n(Z,Ze),m(e,Ut,l),m(e,z,l),y(_e,z,null),n(z,Kt),n(z,Ve),n(z,eo),n(z,Le),n(z,to),n(z,Se),n(z,oo),n(z,F),y(ve,F,null),n(F,no),n(F,Re),n(F,so),y(X,F,null),m(e,Jt,l),m(e,V,l),n(V,O),n(O,ct),y(be,ct,null),n(V,ao),n(V,He),m(e,Nt,l),m(e,L,l),y(ye,L,null),n(L,ro),n(L,J),y(Te,J,null),n(J,io),n(J,Ae),n(J,lo),y(Y,J,null),n(J,co),y(Q,J,null),m(e,Ft,l),m(e,S,l),n(S,K),n(K,mt),y(Ie,mt,null),n(S,mo),n(S,Be),m(e,Pt,l),m(e,N,l),y(Me,N,null),n(N,po),n(N,De),n(N,fo),n(N,ee),y(we,ee,null),n(ee,ho),n(ee,qe),m(e,jt,l),m(e,R,l),n(R,te),n(te,pt),y(xe,pt,null),n(R,go),n(R,Ge),m(e,Wt,l),m(e,U,l),y(ke,U,null),n(U,uo),n(U,Xe),n(U,_o),n(U,Oe),n(U,vo),n(U,x),y($e,x,null),n(x,bo),n(x,Ye),n(x,yo),n(x,Qe),n(x,To),n(x,Ke),n(x,Io),n(x,et),n(x,Mo),n(x,tt),n(x,wo),y(oe,x,null),n(x,xo),y(ne,x,null),n(x,ko),n(x,ot),n(x,$o),n(x,nt),n(x,Co),y(se,x,null),n(x,zo),n(x,st),m(e,Et,l),m(e,ft,l),Zt=!0},p(e,[l]){const Ce={};l&2&&(Ce.$$scope={dirty:l,ctx:e}),B.$set(Ce);const ht={};l&2&&(ht.$$scope={dirty:l,ctx:e}),q.$set(ht);const gt={};l&2&&(gt.$$scope={dirty:l,ctx:e}),X.$set(gt);const ze={};l&2&&(ze.$$scope={dirty:l,ctx:e}),Y.$set(ze);const ut={};l&2&&(ut.$$scope={dirty:l,ctx:e}),Q.$set(ut);const _t={};l&2&&(_t.$$scope={dirty:l,ctx:e}),oe.$set(_t);const Ue={};l&2&&(Ue.$$scope={dirty:l,ctx:e}),ne.$set(Ue);const vt={};l&2&&(vt.$$scope={dirty:l,ctx:e}),se.$set(vt)},i(e){Zt||(T(de.$$.fragment,e),T(le.$$.fragment,e),T(B.$$.fragment,e),T(he.$$.fragment,e),T(ge.$$.fragment,e),T(q.$$.fragment,e),T(ue.$$.fragment,e),T(_e.$$.fragment,e),T(ve.$$.fragment,e),T(X.$$.fragment,e),T(be.$$.fragment,e),T(ye.$$.fragment,e),T(Te.$$.fragment,e),T(Y.$$.fragment,e),T(Q.$$.fragment,e),T(Ie.$$.fragment,e),T(Me.$$.fragment,e),T(we.$$.fragment,e),T(xe.$$.fragment,e),T(ke.$$.fragment,e),T($e.$$.fragment,e),T(oe.$$.fragment,e),T(ne.$$.fragment,e),T(se.$$.fragment,e),Zt=!0)},o(e){I(de.$$.fragment,e),I(le.$$.fragment,e),I(B.$$.fragment,e),I(he.$$.fragment,e),I(ge.$$.fragment,e),I(q.$$.fragment,e),I(ue.$$.fragment,e),I(_e.$$.fragment,e),I(ve.$$.fragment,e),I(X.$$.fragment,e),I(be.$$.fragment,e),I(ye.$$.fragment,e),I(Te.$$.fragment,e),I(Y.$$.fragment,e),I(Q.$$.fragment,e),I(Ie.$$.fragment,e),I(Me.$$.fragment,e),I(we.$$.fragment,e),I(xe.$$.fragment,e),I(ke.$$.fragment,e),I($e.$$.fragment,e),I(oe.$$.fragment,e),I(ne.$$.fragment,e),I(se.$$.fragment,e),Zt=!1},d(e){e&&(o(w),o(p),o(c),o(g),o(Tt),o(W),o(It),o(ce),o(Mt),o(me),o(wt),o(pe),o(xt),o(fe),o(kt),o($t),o(E),o(Ct),o(C),o(zt),o(Z),o(Ut),o(z),o(Jt),o(V),o(Nt),o(L),o(Ft),o(S),o(Pt),o(N),o(jt),o(R),o(Wt),o(U),o(Et),o(ft)),o(s),M(de),M(le),M(B,e),M(he),M(ge),M(q),M(ue),M(_e),M(ve),M(X),M(be),M(ye),M(Te),M(Y),M(Q),M(Ie),M(Me),M(we),M(xe),M(ke),M($e),M(oe),M(ne),M(se)}}}const Nn={local:"idefics",sections:[{local:"overview",title:"Overview"},{local:"transformers.IdeficsConfig",title:"IdeficsConfig"},{local:"transformers.IdeficsModel",title:"IdeficsModel"},{local:"transformers.IdeficsForVisionText2Text",title:"IdeficsForVisionText2Text"},{local:"transformers.IdeficsImageProcessor",title:"IdeficsImageProcessor"},{local:"transformers.IdeficsProcessor",title:"IdeficsProcessor"}],title:"IDEFICS"};function Fn($){return bn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Sn extends yn{constructor(s){super(),Tn(this,s,Fn,Jn,vn,{})}}export{Sn as component};
