import{s as rn,f as ln,o as cn,n as zt}from"../chunks/scheduler.25b97de1.js";import{S as dn,i as pn,g as r,s as a,r as m,A as mn,h as l,f as n,c as s,j as V,u as f,x as p,k as C,y as d,a as o,v as g,d as u,t as h,w as _}from"../chunks/index.d9030fc9.js";import{T as fn}from"../chunks/Tip.baa67368.js";import{D as Ie}from"../chunks/Docstring.e257edda.js";import{C as we}from"../chunks/CodeBlock.e6cd0d95.js";import{E as sn}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{P as gn}from"../chunks/PipelineTag.5f100392.js";import{H as W,E as un}from"../chunks/EditOnGithub.91d95064.js";function hn(U){let c,$="Example:",T,v,b;return v=new we({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYXZhRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTJDJTIwTGxhdmFDb25maWclMkMlMjBDTElQVmlzaW9uQ29uZmlnJTJDJTIwTGxhbWFDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUC12aXNpb24lMjBjb25maWclMEF2aXNpb25fY29uZmlnJTIwJTNEJTIwQ0xJUFZpc2lvbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMExsYW1hJTIwY29uZmlnJTBBdGV4dF9jb25maWclMjAlM0QlMjBMbGFtYUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMExsYXZhJTIwbGxhdmEtMS41LTdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMExsYXZhQ29uZmlnKHZpc2lvbl9jb25maWclMkMlMjB0ZXh0X2NvbmZpZyklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwbGxhdmEtMS41LTdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBMbGF2YUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbihjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlavaForConditionalGeneration, LlavaConfig, CLIPVisionConfig, LlamaConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIP-vision config</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>vision_config = CLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Llama config</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>text_config = LlamaConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Llava llava-1.5-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = LlavaConfig(vision_config, text_config)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the llava-1.5-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LlavaForConditionalGeneration(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){c=r("p"),c.textContent=$,T=a(),m(v.$$.fragment)},l(i){c=l(i,"P",{"data-svelte-h":!0}),p(c)!=="svelte-11lpom8"&&(c.textContent=$),T=s(i),f(v.$$.fragment,i)},m(i,y){o(i,c,y),o(i,T,y),g(v,i,y),b=!0},p:zt,i(i){b||(u(v.$$.fragment,i),b=!0)},o(i){h(v.$$.fragment,i),b=!1},d(i){i&&(n(c),n(T)),_(v,i)}}}function _n(U){let c,$=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){c=r("p"),c.innerHTML=$},l(T){c=l(T,"P",{"data-svelte-h":!0}),p(c)!=="svelte-fincs2"&&(c.innerHTML=$)},m(T,v){o(T,c,v)},p:zt,d(T){T&&n(c)}}}function vn(U){let c,$="Example:",T,v,b;return v=new we({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMExsYXZhRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBMbGF2YUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybGxhdmEtaGYlMkZsbGF2YS0xLjUtN2ItaGYlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybGxhdmEtaGYlMkZsbGF2YS0xLjUtN2ItaGYlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyVVNFUiUzQSUyMCUzQ2ltYWdlJTNFJTVDbldoYXQncyUyMHRoZSUyMGNvbnRlbnQlMjBvZiUyMHRoZSUyMGltYWdlJTNGJTIwQVNTSVNUQU5UJTNBJTIyJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZ3d3cuaWxhbmtlbG1hbi5vcmclMkZzdG9wc2lnbnMlMkZhdXN0cmFsaWEuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0Rwcm9tcHQlMkMlMjBpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTUpJTBBcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<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">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, LlavaForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LlavaForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;llava-hf/llava-1.5-7b-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;llava-hf/llava-1.5-7b-hf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;USER: &lt;image&gt;\\nWhat&#x27;s the content of the image? ASSISTANT:&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://www.ilankelman.org/stopsigns/australia.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=prompt, images=image, 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, max_new_tokens=<span class="hljs-number">15</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;USER:  \\nWhat&#x27;s the content of the image? ASSISTANT: The image features a busy city street with a stop sign prominently displayed&quot;</span>`,wrap:!1}}),{c(){c=r("p"),c.textContent=$,T=a(),m(v.$$.fragment)},l(i){c=l(i,"P",{"data-svelte-h":!0}),p(c)!=="svelte-11lpom8"&&(c.textContent=$),T=s(i),f(v.$$.fragment,i)},m(i,y){o(i,c,y),o(i,T,y),g(v,i,y),b=!0},p:zt,i(i){b||(u(v.$$.fragment,i),b=!0)},o(i){h(v.$$.fragment,i),b=!1},d(i){i&&(n(c),n(T)),_(v,i)}}}function Tn(U){let c,$,T,v,b,i,y,Fe,S,It="LLaVa is an open-source chatbot trained by fine-tuning LlamA/Vicuna on GPT-generated multimodal instruction-following data. It is an auto-regressive language model, based on the transformer architecture. In other words, it is an multi-modal version of LLMs fine-tuned for chat / instructions.",Ne,G,qt='The LLaVa model was proposed in <a href="https://arxiv.org/abs/2304.08485" rel="nofollow">Visual Instruction Tuning</a> and improved in <a href="https://arxiv.org/pdf/2310.03744" rel="nofollow">Improved Baselines with Visual Instruction Tuning</a> by Haotian Liu, Chunyuan Li, Yuheng Li and Yong Jae Lee.',Be,Z,Ft="The abstract from the paper is the following:",Pe,H,Nt="<em>Large multimodal models (LMM) have recently shown encouraging progress with visual instruction tuning. In this note, we show that the fully-connected vision-language cross-modal connector in LLaVA is surprisingly powerful and data-efficient. With simple modifications to LLaVA, namely, using CLIP-ViT-L-336px with an MLP projection and adding academic-task-oriented VQA data with simple response formatting prompts, we establish stronger baselines that achieve state-of-the-art across 11 benchmarks. Our final 13B checkpoint uses merely 1.2M publicly available data, and finishes full training in ∼1 day on a single 8-A100 node. We hope this can make state-of-the-art LMM research more accessible. Code and model will be publicly available</em>",Ve,j,Bt,We,Q,Pt='LLaVa architecture. Taken from the <a href="https://arxiv.org/abs/2304.08485">original paper.</a>',Se,E,Vt=`This model was contributed by <a href="https://huggingface.co/ArthurZ" rel="nofollow">ArthurZ</a> and <a href="https://huggingface.co/ybelkada" rel="nofollow">ybelkada</a>.
The original code can be found <a href="https://github.com/haotian-liu/LLaVA/tree/main/llava" rel="nofollow">here</a>.`,Ge,R,Ze,A,Wt="<li><p>We advise users to use <code>padding_side=&quot;left&quot;</code> when computing batched generation as it leads to more accurate results. Simply make sure to call <code>processor.tokenizer.padding_side = &quot;left&quot;</code> before generating.</p></li> <li><p>Note the model has not been explicitly trained to process multiple images in the same prompt, although this is technically possible, you may experience inaccurate results.</p></li> <li><p>For better results, we recommend users to use the processor’s <code>apply_chat_template()</code> method to format your prompt correctly. For that you need to construct a conversation history, passing in a plain string will not format your prompt. Each message in the conversation history for chat templates is a dictionary with keys “role” and “content”. The “content” should be a list of dictionaries, for “text” and “image” modalities, as follows:</p></li>",He,X,Qe,Y,St="<li>If you want to construct a chat prompt yourself, below is a list of prompt formats accepted by each llava checkpoint:</li>",Ee,D,Gt='<a href="https://huggingface.co/collections/llava-hf/llava-interleave-668e19a97da0036aad4a2f19" rel="nofollow">llava-interleave models</a> requires the following format:',Re,O,Ae,K,Zt="For multiple turns conversation:",Xe,ee,Ye,te,Ht='<a href="https://huggingface.co/collections/llava-hf/llava-15-65f762d5b6941db5c2ba07e0" rel="nofollow">llava-1.5 models</a> requires the following format:',De,ne,Oe,oe,Qt="For multiple turns conversation:",Ke,ae,et,se,tt,re,Et='Flash Attention 2 is an even faster, optimized version of the previous optimization, please refer to the <a href="https://huggingface.co/docs/transformers/perf_infer_gpu_one" rel="nofollow">Flash Attention 2 section of performance docs</a>.',nt,le,ot,ie,Rt="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with BEiT.",at,ce,st,de,At='<li>A <a href="https://colab.research.google.com/drive/1qsl6cd2c8gGtEW1xV5io7S8NHh-Cp1TV?usp=sharing" rel="nofollow">Google Colab demo</a> on how to run Llava on a free-tier Google colab instance leveraging 4-bit inference.</li> <li>A <a href="https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LLaVa/Inference_with_LLaVa_for_multimodal_generation.ipynb" rel="nofollow">similar notebook</a> showcasing batched inference. 🌎</li>',rt,pe,lt,w,me,ht,Me,Xt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30674/en/model_doc/llava#transformers.LlavaForConditionalGeneration">LlavaForConditionalGeneration</a>. It is used to instantiate an
Llava 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 Llava-9B.`,_t,$e,Yt='e.g. <a href="https://huggingface.co/llava-hf/llava-9b" rel="nofollow">llava-hf/llava-9b</a>',vt,Le,Dt=`Configuration objects inherit from <a href="/docs/transformers/pr_30674/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_30674/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Tt,z,it,fe,ct,M,ge,bt,xe,Ot="Constructs a Llava processor which wraps a Llava image processor and a Llava tokenizer into a single processor.",yt,Je,Kt=`<a href="/docs/transformers/pr_30674/en/model_doc/llava#transformers.LlavaProcessor">LlavaProcessor</a> offers all the functionalities of <a href="/docs/transformers/pr_30674/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/pr_30674/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/pr_30674/en/model_doc/llava#transformers.LlavaProcessor.decode">decode()</a> for more information.`,wt,I,ue,Mt,ke,en=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,$t,q,he,Lt,Ce,tn=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,dt,_e,pt,L,ve,xt,Ue,nn=`The LLAVA model which consists of a vision backbone and a language model.
This model inherits from <a href="/docs/transformers/pr_30674/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.)`,Jt,je,on=`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.`,kt,k,Te,Ct,ze,an='The <a href="/docs/transformers/pr_30674/en/model_doc/llava#transformers.LlavaForConditionalGeneration">LlavaForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Ut,F,jt,N,mt,be,ft,qe,gt;return b=new W({props:{title:"LLaVa",local:"llava",headingTag:"h1"}}),y=new W({props:{title:"Overview",local:"overview",headingTag:"h2"}}),R=new W({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),X=new we({props:{code:"JTBBJTBBJTBBJTBBJTBBJTIyVVNFUiUzQSUyMCUzQ2ltYWdlJTNFJTVDbiUzQ1doYXQlRTIlODAlOTlzJTIwc2hvd24lMjBpbiUyMHRoaXMlMjBpbWFnZSUzRiUyMEFTU0lTVEFOVCUzQSUyMFRoaXMlMjBpbWFnZSUyMHNob3dzJTIwYSUyMHJlZCUyMHN0b3AlMjBzaWduLiUzQyUyRnMlM0VVU0VSJTNBJTIwRGVzY3JpYmUlMjB0aGUlMjBpbWFnZSUyMGluJTIwbW9yZSUyMGRldGFpbHMuJTIwQVNTSVNUQU5UJTNBJTIy",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor

processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;llava-hf/llava-1.5-7b-hf&quot;</span>)

conversation = [
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: [
            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</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’s shown in this image?&quot;</span>},
            ],
    },
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;assistant&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;This image shows a red stop sign.&quot;</span>},]
    },
    {

        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
        <span class="hljs-string">&quot;content&quot;</span>: [
            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Describe the image in more details.&quot;</span>},
        ],
    },
]

text_prompt = processor.apply_chat_template(conversation, add_generation_prompt=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># Note that the template simply formats your prompt, you still have to tokenize it and obtain pixel values for your images</span>
<span class="hljs-built_in">print</span>(text_prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-string">&quot;USER: &lt;image&gt;\\n&lt;What’s shown in this image? ASSISTANT: This image shows a red stop sign.&lt;/s&gt;USER: Describe the image in more details. ASSISTANT:&quot;</span>`,wrap:!1}}),O=new we({props:{code:"JTIyJTNDJTdDaW1fc3RhcnQlN0MlM0V1c2VyJTIwJTNDaW1hZ2UlM0UlNUNuV2hhdCUyMGlzJTIwc2hvd24lMjBpbiUyMHRoaXMlMjBpbWFnZSUzRiUzQyU3Q2ltX2VuZCU3QyUzRSUzQyU3Q2ltX3N0YXJ0JTdDJTNFYXNzaXN0YW50JTIy",highlighted:'<span class="hljs-string">&quot;&lt;|im_start|&gt;user &lt;image&gt;\\nWhat is shown in this image?&lt;|im_end|&gt;&lt;|im_start|&gt;assistant&quot;</span>',wrap:!1}}),ee=new we({props:{code:"JTIyJTNDJTdDaW1fc3RhcnQlN0MlM0V1c2VyJTIwJTNDaW1hZ2UlM0UlNUNuJTNDcHJvbXB0MSUzRSUzQyU3Q2ltX2VuZCU3QyUzRSUzQyU3Q2ltX3N0YXJ0JTdDJTNFYXNzaXN0YW50JTIwJTNDYW5zd2VyMSUzRSUzQyU3Q2ltX2VuZCU3QyUzRSUzQyU3Q2ltX3N0YXJ0JTdDJTNFdXNlciUyMCUzQ2ltYWdlJTNFJTVDbiUzQ3Byb21wdDElM0UlM0MlN0NpbV9lbmQlN0MlM0UlM0MlN0NpbV9zdGFydCU3QyUzRWFzc2lzdGFudCUyMCUyMg==",highlighted:'<span class="hljs-string">&quot;&lt;|im_start|&gt;user &lt;image&gt;\\n&lt;prompt1&gt;&lt;|im_end|&gt;&lt;|im_start|&gt;assistant &lt;answer1&gt;&lt;|im_end|&gt;&lt;|im_start|&gt;user &lt;image&gt;\\n&lt;prompt1&gt;&lt;|im_end|&gt;&lt;|im_start|&gt;assistant &quot;</span>',wrap:!1}}),ne=new we({props:{code:"JTIyVVNFUiUzQSUyMCUzQ2ltYWdlJTNFJTVDbiUzQ3Byb21wdCUzRSUyMEFTU0lTVEFOVCUzQSUyMg==",highlighted:'<span class="hljs-string">&quot;USER: &lt;image&gt;\\n&lt;prompt&gt; ASSISTANT:&quot;</span>',wrap:!1}}),ae=new we({props:{code:"JTIyVVNFUiUzQSUyMCUzQ2ltYWdlJTNFJTVDbiUzQ3Byb21wdDElM0UlMjBBU1NJU1RBTlQlM0ElMjAlM0NhbnN3ZXIxJTNFJTNDJTJGcyUzRVVTRVIlM0ElMjAlM0Nwcm9tcHQyJTNFJTIwQVNTSVNUQU5UJTNBJTIwJTNDYW5zd2VyMiUzRSUzQyUyRnMlM0VVU0VSJTNBJTIwJTNDcHJvbXB0MyUzRSUyMEFTU0lTVEFOVCUzQSUyMg==",highlighted:'<span class="hljs-string">&quot;USER: &lt;image&gt;\\n&lt;prompt1&gt; ASSISTANT: &lt;answer1&gt;&lt;/s&gt;USER: &lt;prompt2&gt; ASSISTANT: &lt;answer2&gt;&lt;/s&gt;USER: &lt;prompt3&gt; ASSISTANT:&quot;</span>',wrap:!1}}),se=new W({props:{title:"Using Flash Attention 2",local:"using-flash-attention-2",headingTag:"h3"}}),le=new W({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ce=new gn({props:{pipeline:"image-to-text"}}),pe=new W({props:{title:"LlavaConfig",local:"transformers.LlavaConfig",headingTag:"h2"}}),me=new Ie({props:{name:"class transformers.LlavaConfig",anchor:"transformers.LlavaConfig",parameters:[{name:"vision_config",val:" = None"},{name:"text_config",val:" = None"},{name:"ignore_index",val:" = -100"},{name:"image_token_index",val:" = 32000"},{name:"projector_hidden_act",val:" = 'gelu'"},{name:"vision_feature_select_strategy",val:" = 'default'"},{name:"vision_feature_layer",val:" = -2"},{name:"image_seq_length",val:" = 576"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlavaConfig.vision_config",description:`<strong>vision_config</strong> (<code>Union[AutoConfig, dict]</code>,  <em>optional</em>, defaults to <code>CLIPVisionConfig</code>) &#x2014;
The config object or dictionary of the vision backbone.`,name:"vision_config"},{anchor:"transformers.LlavaConfig.text_config",description:`<strong>text_config</strong> (<code>Union[AutoConfig, dict]</code>, <em>optional</em>, defaults to <code>LlamaConfig</code>) &#x2014;
The config object or dictionary of the text backbone.`,name:"text_config"},{anchor:"transformers.LlavaConfig.ignore_index",description:`<strong>ignore_index</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
The ignore index for the loss function.`,name:"ignore_index"},{anchor:"transformers.LlavaConfig.image_token_index",description:`<strong>image_token_index</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
The image token index to encode the image prompt.`,name:"image_token_index"},{anchor:"transformers.LlavaConfig.projector_hidden_act",description:`<strong>projector_hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The activation function used by the multimodal projector.`,name:"projector_hidden_act"},{anchor:"transformers.LlavaConfig.vision_feature_select_strategy",description:`<strong>vision_feature_select_strategy</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;default&quot;</code>) &#x2014;
The feature selection strategy used to select the vision feature from the vision backbone.
Can be one of <code>&quot;default&quot;</code> or <code>&quot;full&quot;</code>.`,name:"vision_feature_select_strategy"},{anchor:"transformers.LlavaConfig.vision_feature_layer",description:`<strong>vision_feature_layer</strong> (<code>int</code>, <em>optional</em>, defaults to -2) &#x2014;
The index of the layer to select the vision feature.`,name:"vision_feature_layer"},{anchor:"transformers.LlavaConfig.image_seq_length",description:`<strong>image_seq_length</strong> (<code>int</code>, <em>optional</em>, defaults to 576) &#x2014;
Sequence length of one image embedding.`,name:"image_seq_length"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/llava/configuration_llava.py#L24"}}),z=new sn({props:{anchor:"transformers.LlavaConfig.example",$$slots:{default:[hn]},$$scope:{ctx:U}}}),fe=new W({props:{title:"LlavaProcessor",local:"transformers.LlavaProcessor",headingTag:"h2"}}),ge=new Ie({props:{name:"class transformers.LlavaProcessor",anchor:"transformers.LlavaProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"patch_size",val:" = None"},{name:"vision_feature_select_strategy",val:" = None"},{name:"chat_template",val:" = None"},{name:"image_token",val:" = '<image>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlavaProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/pr_30674/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a>, <em>optional</em>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.LlavaProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/pr_30674/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.LlavaProcessor.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Patch size from the vision tower.`,name:"patch_size"},{anchor:"transformers.LlavaProcessor.vision_feature_select_strategy",description:`<strong>vision_feature_select_strategy</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The feature selection strategy used to select the vision feature from the vision backbone.
Shoudl be same as in model&#x2019;s config`,name:"vision_feature_select_strategy"},{anchor:"transformers.LlavaProcessor.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) &#x2014; A Jinja template which will be used to convert lists of messages
in a chat into a tokenizable string.`,name:"chat_template"},{anchor:"transformers.LlavaProcessor.image_token",description:`<strong>image_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;image&gt;&quot;</code>) &#x2014;
Special token used to denote image location.`,name:"image_token"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/llava/processing_llava.py#L31"}}),ue=new Ie({props:{name:"batch_decode",anchor:"transformers.LlavaProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/llava/processing_llava.py#L171"}}),he=new Ie({props:{name:"decode",anchor:"transformers.LlavaProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/llava/processing_llava.py#L179"}}),_e=new W({props:{title:"LlavaForConditionalGeneration",local:"transformers.LlavaForConditionalGeneration",headingTag:"h2"}}),ve=new Ie({props:{name:"class transformers.LlavaForConditionalGeneration",anchor:"transformers.LlavaForConditionalGeneration",parameters:[{name:"config",val:": LlavaConfig"}],parametersDescription:[{anchor:"transformers.LlavaForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_30674/en/model_doc/llava#transformers.LlavaConfig">LlavaConfig</a> or <code>LlavaVisionConfig</code>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_30674/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/llava/modeling_llava.py#L239"}}),Te=new Ie({props:{name:"forward",anchor:"transformers.LlavaForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"pixel_values",val:": FloatTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"vision_feature_layer",val:": Optional = None"},{name:"vision_feature_select_strategy",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlavaForConditionalGeneration.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_30674/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30674/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.LlavaForConditionalGeneration.forward.pixel_values",description:'<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)) -- The tensors corresponding to the input images. Pixel values can be obtained using [AutoImageProcessor](/docs/transformers/pr_30674/en/model_doc/auto#transformers.AutoImageProcessor). See [CLIPImageProcessor.__call__()](/docs/transformers/pr_30674/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__) for details ([]</code>LlavaProcessor`] uses\n<a href="/docs/transformers/pr_30674/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> for processing images).',name:"pixel_values"},{anchor:"transformers.LlavaForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_30674/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_30674/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>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.LlavaForConditionalGeneration.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.LlavaForConditionalGeneration.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.LlavaForConditionalGeneration.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.LlavaForConditionalGeneration.forward.vision_feature_layer",description:`<strong>vision_feature_layer</strong> (<code>int</code>, <em>optional</em>, defaults to -2) &#x2014;
The index of the layer to select the vision feature.`,name:"vision_feature_layer"},{anchor:"transformers.LlavaForConditionalGeneration.forward.vision_feature_select_strategy",description:`<strong>vision_feature_select_strategy</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;default&quot;</code>) &#x2014;
The feature selection strategy used to select the vision feature from the vision backbone.
Can be one of <code>&quot;default&quot;</code> or <code>&quot;full&quot;</code>.`,name:"vision_feature_select_strategy"},{anchor:"transformers.LlavaForConditionalGeneration.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.LlavaForConditionalGeneration.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.LlavaForConditionalGeneration.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.LlavaForConditionalGeneration.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_30674/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlavaForConditionalGeneration.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_30674/src/transformers/models/llava/modeling_llava.py#L362",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.llava.modeling_llava.LlavaCausalLMOutputWithPast</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/pr_30674/en/model_doc/llava#transformers.LlavaConfig"
>LlavaConfig</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.llava.modeling_llava.LlavaCausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),F=new fn({props:{$$slots:{default:[_n]},$$scope:{ctx:U}}}),N=new sn({props:{anchor:"transformers.LlavaForConditionalGeneration.forward.example",$$slots:{default:[vn]},$$scope:{ctx:U}}}),be=new un({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/llava.md"}}),{c(){c=r("meta"),$=a(),T=r("p"),v=a(),m(b.$$.fragment),i=a(),m(y.$$.fragment),Fe=a(),S=r("p"),S.textContent=It,Ne=a(),G=r("p"),G.innerHTML=qt,Be=a(),Z=r("p"),Z.textContent=Ft,Pe=a(),H=r("p"),H.innerHTML=Nt,Ve=a(),j=r("img"),We=a(),Q=r("small"),Q.innerHTML=Pt,Se=a(),E=r("p"),E.innerHTML=Vt,Ge=a(),m(R.$$.fragment),Ze=a(),A=r("ul"),A.innerHTML=Wt,He=a(),m(X.$$.fragment),Qe=a(),Y=r("ul"),Y.innerHTML=St,Ee=a(),D=r("p"),D.innerHTML=Gt,Re=a(),m(O.$$.fragment),Ae=a(),K=r("p"),K.textContent=Zt,Xe=a(),m(ee.$$.fragment),Ye=a(),te=r("p"),te.innerHTML=Ht,De=a(),m(ne.$$.fragment),Oe=a(),oe=r("p"),oe.textContent=Qt,Ke=a(),m(ae.$$.fragment),et=a(),m(se.$$.fragment),tt=a(),re=r("p"),re.innerHTML=Et,nt=a(),m(le.$$.fragment),ot=a(),ie=r("p"),ie.textContent=Rt,at=a(),m(ce.$$.fragment),st=a(),de=r("ul"),de.innerHTML=At,rt=a(),m(pe.$$.fragment),lt=a(),w=r("div"),m(me.$$.fragment),ht=a(),Me=r("p"),Me.innerHTML=Xt,_t=a(),$e=r("p"),$e.innerHTML=Yt,vt=a(),Le=r("p"),Le.innerHTML=Dt,Tt=a(),m(z.$$.fragment),it=a(),m(fe.$$.fragment),ct=a(),M=r("div"),m(ge.$$.fragment),bt=a(),xe=r("p"),xe.textContent=Ot,yt=a(),Je=r("p"),Je.innerHTML=Kt,wt=a(),I=r("div"),m(ue.$$.fragment),Mt=a(),ke=r("p"),ke.innerHTML=en,$t=a(),q=r("div"),m(he.$$.fragment),Lt=a(),Ce=r("p"),Ce.innerHTML=tn,dt=a(),m(_e.$$.fragment),pt=a(),L=r("div"),m(ve.$$.fragment),xt=a(),Ue=r("p"),Ue.innerHTML=nn,Jt=a(),je=r("p"),je.innerHTML=on,kt=a(),k=r("div"),m(Te.$$.fragment),Ct=a(),ze=r("p"),ze.innerHTML=an,Ut=a(),m(F.$$.fragment),jt=a(),m(N.$$.fragment),mt=a(),m(be.$$.fragment),ft=a(),qe=r("p"),this.h()},l(e){const t=mn("svelte-u9bgzb",document.head);c=l(t,"META",{name:!0,content:!0}),t.forEach(n),$=s(e),T=l(e,"P",{}),V(T).forEach(n),v=s(e),f(b.$$.fragment,e),i=s(e),f(y.$$.fragment,e),Fe=s(e),S=l(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-xhhjdz"&&(S.textContent=It),Ne=s(e),G=l(e,"P",{"data-svelte-h":!0}),p(G)!=="svelte-iilyg8"&&(G.innerHTML=qt),Be=s(e),Z=l(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-vfdo9a"&&(Z.textContent=Ft),Pe=s(e),H=l(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-a2g4ox"&&(H.innerHTML=Nt),Ve=s(e),j=l(e,"IMG",{src:!0,alt:!0,width:!0}),We=s(e),Q=l(e,"SMALL",{"data-svelte-h":!0}),p(Q)!=="svelte-16ml59q"&&(Q.innerHTML=Pt),Se=s(e),E=l(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-3u37is"&&(E.innerHTML=Vt),Ge=s(e),f(R.$$.fragment,e),Ze=s(e),A=l(e,"UL",{"data-svelte-h":!0}),p(A)!=="svelte-1pse1vh"&&(A.innerHTML=Wt),He=s(e),f(X.$$.fragment,e),Qe=s(e),Y=l(e,"UL",{"data-svelte-h":!0}),p(Y)!=="svelte-rusc9d"&&(Y.innerHTML=St),Ee=s(e),D=l(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-1qk1eny"&&(D.innerHTML=Gt),Re=s(e),f(O.$$.fragment,e),Ae=s(e),K=l(e,"P",{"data-svelte-h":!0}),p(K)!=="svelte-mnlzle"&&(K.textContent=Zt),Xe=s(e),f(ee.$$.fragment,e),Ye=s(e),te=l(e,"P",{"data-svelte-h":!0}),p(te)!=="svelte-uxk0fh"&&(te.innerHTML=Ht),De=s(e),f(ne.$$.fragment,e),Oe=s(e),oe=l(e,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-mnlzle"&&(oe.textContent=Qt),Ke=s(e),f(ae.$$.fragment,e),et=s(e),f(se.$$.fragment,e),tt=s(e),re=l(e,"P",{"data-svelte-h":!0}),p(re)!=="svelte-15nzlnu"&&(re.innerHTML=Et),nt=s(e),f(le.$$.fragment,e),ot=s(e),ie=l(e,"P",{"data-svelte-h":!0}),p(ie)!=="svelte-1bkfbxv"&&(ie.textContent=Rt),at=s(e),f(ce.$$.fragment,e),st=s(e),de=l(e,"UL",{"data-svelte-h":!0}),p(de)!=="svelte-qnejrc"&&(de.innerHTML=At),rt=s(e),f(pe.$$.fragment,e),lt=s(e),w=l(e,"DIV",{class:!0});var x=V(w);f(me.$$.fragment,x),ht=s(x),Me=l(x,"P",{"data-svelte-h":!0}),p(Me)!=="svelte-15zjsij"&&(Me.innerHTML=Xt),_t=s(x),$e=l(x,"P",{"data-svelte-h":!0}),p($e)!=="svelte-d825u1"&&($e.innerHTML=Yt),vt=s(x),Le=l(x,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-5wo8g3"&&(Le.innerHTML=Dt),Tt=s(x),f(z.$$.fragment,x),x.forEach(n),it=s(e),f(fe.$$.fragment,e),ct=s(e),M=l(e,"DIV",{class:!0});var J=V(M);f(ge.$$.fragment,J),bt=s(J),xe=l(J,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-api29h"&&(xe.textContent=Ot),yt=s(J),Je=l(J,"P",{"data-svelte-h":!0}),p(Je)!=="svelte-1jglm3z"&&(Je.innerHTML=Kt),wt=s(J),I=l(J,"DIV",{class:!0});var ye=V(I);f(ue.$$.fragment,ye),Mt=s(ye),ke=l(ye,"P",{"data-svelte-h":!0}),p(ke)!=="svelte-yfey9m"&&(ke.innerHTML=en),ye.forEach(n),$t=s(J),q=l(J,"DIV",{class:!0});var ut=V(q);f(he.$$.fragment,ut),Lt=s(ut),Ce=l(ut,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-1vqpy98"&&(Ce.innerHTML=tn),ut.forEach(n),J.forEach(n),dt=s(e),f(_e.$$.fragment,e),pt=s(e),L=l(e,"DIV",{class:!0});var B=V(L);f(ve.$$.fragment,B),xt=s(B),Ue=l(B,"P",{"data-svelte-h":!0}),p(Ue)!=="svelte-1njcfj5"&&(Ue.innerHTML=nn),Jt=s(B),je=l(B,"P",{"data-svelte-h":!0}),p(je)!=="svelte-hswkmf"&&(je.innerHTML=on),kt=s(B),k=l(B,"DIV",{class:!0});var P=V(k);f(Te.$$.fragment,P),Ct=s(P),ze=l(P,"P",{"data-svelte-h":!0}),p(ze)!=="svelte-1yf1txl"&&(ze.innerHTML=an),Ut=s(P),f(F.$$.fragment,P),jt=s(P),f(N.$$.fragment,P),P.forEach(n),B.forEach(n),mt=s(e),f(be.$$.fragment,e),ft=s(e),qe=l(e,"P",{}),V(qe).forEach(n),this.h()},h(){C(c,"name","hf:doc:metadata"),C(c,"content",bn),ln(j.src,Bt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/llava_architecture.jpg")||C(j,"src",Bt),C(j,"alt","drawing"),C(j,"width","600"),C(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(L,"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){d(document.head,c),o(e,$,t),o(e,T,t),o(e,v,t),g(b,e,t),o(e,i,t),g(y,e,t),o(e,Fe,t),o(e,S,t),o(e,Ne,t),o(e,G,t),o(e,Be,t),o(e,Z,t),o(e,Pe,t),o(e,H,t),o(e,Ve,t),o(e,j,t),o(e,We,t),o(e,Q,t),o(e,Se,t),o(e,E,t),o(e,Ge,t),g(R,e,t),o(e,Ze,t),o(e,A,t),o(e,He,t),g(X,e,t),o(e,Qe,t),o(e,Y,t),o(e,Ee,t),o(e,D,t),o(e,Re,t),g(O,e,t),o(e,Ae,t),o(e,K,t),o(e,Xe,t),g(ee,e,t),o(e,Ye,t),o(e,te,t),o(e,De,t),g(ne,e,t),o(e,Oe,t),o(e,oe,t),o(e,Ke,t),g(ae,e,t),o(e,et,t),g(se,e,t),o(e,tt,t),o(e,re,t),o(e,nt,t),g(le,e,t),o(e,ot,t),o(e,ie,t),o(e,at,t),g(ce,e,t),o(e,st,t),o(e,de,t),o(e,rt,t),g(pe,e,t),o(e,lt,t),o(e,w,t),g(me,w,null),d(w,ht),d(w,Me),d(w,_t),d(w,$e),d(w,vt),d(w,Le),d(w,Tt),g(z,w,null),o(e,it,t),g(fe,e,t),o(e,ct,t),o(e,M,t),g(ge,M,null),d(M,bt),d(M,xe),d(M,yt),d(M,Je),d(M,wt),d(M,I),g(ue,I,null),d(I,Mt),d(I,ke),d(M,$t),d(M,q),g(he,q,null),d(q,Lt),d(q,Ce),o(e,dt,t),g(_e,e,t),o(e,pt,t),o(e,L,t),g(ve,L,null),d(L,xt),d(L,Ue),d(L,Jt),d(L,je),d(L,kt),d(L,k),g(Te,k,null),d(k,Ct),d(k,ze),d(k,Ut),g(F,k,null),d(k,jt),g(N,k,null),o(e,mt,t),g(be,e,t),o(e,ft,t),o(e,qe,t),gt=!0},p(e,[t]){const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),z.$set(x);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),F.$set(J);const ye={};t&2&&(ye.$$scope={dirty:t,ctx:e}),N.$set(ye)},i(e){gt||(u(b.$$.fragment,e),u(y.$$.fragment,e),u(R.$$.fragment,e),u(X.$$.fragment,e),u(O.$$.fragment,e),u(ee.$$.fragment,e),u(ne.$$.fragment,e),u(ae.$$.fragment,e),u(se.$$.fragment,e),u(le.$$.fragment,e),u(ce.$$.fragment,e),u(pe.$$.fragment,e),u(me.$$.fragment,e),u(z.$$.fragment,e),u(fe.$$.fragment,e),u(ge.$$.fragment,e),u(ue.$$.fragment,e),u(he.$$.fragment,e),u(_e.$$.fragment,e),u(ve.$$.fragment,e),u(Te.$$.fragment,e),u(F.$$.fragment,e),u(N.$$.fragment,e),u(be.$$.fragment,e),gt=!0)},o(e){h(b.$$.fragment,e),h(y.$$.fragment,e),h(R.$$.fragment,e),h(X.$$.fragment,e),h(O.$$.fragment,e),h(ee.$$.fragment,e),h(ne.$$.fragment,e),h(ae.$$.fragment,e),h(se.$$.fragment,e),h(le.$$.fragment,e),h(ce.$$.fragment,e),h(pe.$$.fragment,e),h(me.$$.fragment,e),h(z.$$.fragment,e),h(fe.$$.fragment,e),h(ge.$$.fragment,e),h(ue.$$.fragment,e),h(he.$$.fragment,e),h(_e.$$.fragment,e),h(ve.$$.fragment,e),h(Te.$$.fragment,e),h(F.$$.fragment,e),h(N.$$.fragment,e),h(be.$$.fragment,e),gt=!1},d(e){e&&(n($),n(T),n(v),n(i),n(Fe),n(S),n(Ne),n(G),n(Be),n(Z),n(Pe),n(H),n(Ve),n(j),n(We),n(Q),n(Se),n(E),n(Ge),n(Ze),n(A),n(He),n(Qe),n(Y),n(Ee),n(D),n(Re),n(Ae),n(K),n(Xe),n(Ye),n(te),n(De),n(Oe),n(oe),n(Ke),n(et),n(tt),n(re),n(nt),n(ot),n(ie),n(at),n(st),n(de),n(rt),n(lt),n(w),n(it),n(ct),n(M),n(dt),n(pt),n(L),n(mt),n(ft),n(qe)),n(c),_(b,e),_(y,e),_(R,e),_(X,e),_(O,e),_(ee,e),_(ne,e),_(ae,e),_(se,e),_(le,e),_(ce,e),_(pe,e),_(me),_(z),_(fe,e),_(ge),_(ue),_(he),_(_e,e),_(ve),_(Te),_(F),_(N),_(be,e)}}}const bn='{"title":"LLaVa","local":"llava","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[{"title":"Using Flash Attention 2","local":"using-flash-attention-2","sections":[],"depth":3}],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"LlavaConfig","local":"transformers.LlavaConfig","sections":[],"depth":2},{"title":"LlavaProcessor","local":"transformers.LlavaProcessor","sections":[],"depth":2},{"title":"LlavaForConditionalGeneration","local":"transformers.LlavaForConditionalGeneration","sections":[],"depth":2}],"depth":1}';function yn(U){return cn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Un extends dn{constructor(c){super(),pn(this,c,yn,Tn,rn,{})}}export{Un as component};
