import{s as ya,f as _a,o as va,n as St}from"../chunks/scheduler.25b97de1.js";import{S as Ta,i as ba,g as l,s,r as m,A as Ua,h as r,f as a,c as o,j as W,u as h,x as p,k as I,y as d,a as n,v as u,d as g,t as f,w as M}from"../chunks/index.d9030fc9.js";import{T as wa}from"../chunks/Tip.baa67368.js";import{D as Ze}from"../chunks/Docstring.ffac8efa.js";import{C as V}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Ma}from"../chunks/ExampleCodeBlock.22dfe688.js";import{P as Ja}from"../chunks/PipelineTag.5f100392.js";import{H as k,E as ja}from"../chunks/EditOnGithub.91d95064.js";function Ca(L){let c,w="Example:",_,y,v;return y=new V({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=l("p"),c.textContent=w,_=s(),m(y.$$.fragment)},l(i){c=r(i,"P",{"data-svelte-h":!0}),p(c)!=="svelte-11lpom8"&&(c.textContent=w),_=o(i),h(y.$$.fragment,i)},m(i,T){n(i,c,T),n(i,_,T),u(y,i,T),v=!0},p:St,i(i){v||(g(y.$$.fragment,i),v=!0)},o(i){f(y.$$.fragment,i),v=!1},d(i){i&&(a(c),a(_)),M(y,i)}}}function $a(L){let c,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(){c=l("p"),c.innerHTML=w},l(_){c=r(_,"P",{"data-svelte-h":!0}),p(c)!=="svelte-fincs2"&&(c.innerHTML=w)},m(_,y){n(_,c,y)},p:St,d(_){_&&a(c)}}}function Ia(L){let c,w="Example:",_,y,v;return y=new V({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMExsYXZhRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBMbGF2YUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybGxhdmEtaGYlMkZsbGF2YS0xLjUtN2ItaGYlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybGxhdmEtaGYlMkZsbGF2YS0xLjUtN2ItaGYlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyVVNFUiUzQSUyMCUzQ2ltYWdlJTNFJTVDbldoYXQncyUyMHRoZSUyMGNvbnRlbnQlMjBvZiUyMHRoZSUyMGltYWdlJTNGJTIwQVNTSVNUQU5UJTNBJTIyJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZ3d3cuaWxhbmtlbG1hbi5vcmclMkZzdG9wc2lnbnMlMkZhdXN0cmFsaWEuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwdGV4dCUzRHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTUpJTBBcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",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(images=image, text=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, 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=l("p"),c.textContent=w,_=s(),m(y.$$.fragment)},l(i){c=r(i,"P",{"data-svelte-h":!0}),p(c)!=="svelte-11lpom8"&&(c.textContent=w),_=o(i),h(y.$$.fragment,i)},m(i,T){n(i,c,T),n(i,_,T),u(y,i,T),v=!0},p:St,i(i){v||(g(y.$$.fragment,i),v=!0)},o(i){f(y.$$.fragment,i),v=!1},d(i){i&&(a(c),a(_)),M(y,i)}}}function ka(L){let c,w,_,y,v,i,T,We,S,Rt="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.",Ve,R,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.',Se,Q,Et="The abstract from the paper is the following:",Re,E,Xt="<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>",Qe,x,Ht,Ee,X,Pt='LLaVa architecture. Taken from the <a href="https://arxiv.org/abs/2304.08485">original paper.</a>',Xe,H,Yt=`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>.`,He,P,Pe,Y,At="<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>",Ye,A,Ae,D,Dt="For best 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:",De,O,Oe,K,Ke,ee,Ot="LLaVa also supports batched inference. Here is how you can do it:",et,te,tt,ae,Kt="<li>If you want to construct a chat prompt yourself, below is a list of prompt formats accepted by each llava checkpoint:</li>",at,ne,ea='<a href="https://huggingface.co/collections/llava-hf/llava-interleave-668e19a97da0036aad4a2f19" rel="nofollow">llava-interleave models</a> requires the following format:',nt,se,st,oe,ta="For multiple turns conversation:",ot,le,lt,re,aa='<a href="https://huggingface.co/collections/llava-hf/llava-15-65f762d5b6941db5c2ba07e0" rel="nofollow">llava-1.5 models</a> requires the following format:',rt,ie,it,ce,na="For multiple turns conversation:",ct,de,dt,pe,pt,me,sa='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>.',mt,he,ht,ue,oa="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with BEiT.",ut,ge,gt,fe,la='<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>',ft,Me,Mt,b,ye,jt,$e,ra=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/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.`,Ct,Ie,ia='e.g. <a href="https://huggingface.co/llava-hf/llava-9b" rel="nofollow">llava-hf/llava-9b</a>',$t,ke,ca=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,It,z,yt,_e,_t,U,ve,kt,Le,da="Constructs a Llava processor which wraps a Llava image processor and a Llava tokenizer into a single processor.",Lt,xe,pa=`<a href="/docs/transformers/main/en/model_doc/llava#transformers.LlavaProcessor">LlavaProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/llava#transformers.LlavaProcessor.decode">decode()</a> for more information.`,xt,q,Te,zt,ze,ma=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,qt,F,be,Ft,qe,ha=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,vt,Ue,Tt,J,we,Bt,Fe,ua=`The LLAVA model which consists of a vision backbone and a language model.
This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Nt,Be,ga=`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.`,Zt,$,Je,Gt,Ne,fa='The <a href="/docs/transformers/main/en/model_doc/llava#transformers.LlavaForConditionalGeneration">LlavaForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Wt,B,Vt,N,bt,je,Ut,Ge,wt;return v=new k({props:{title:"LLaVa",local:"llava",headingTag:"h1"}}),T=new k({props:{title:"Overview",local:"overview",headingTag:"h2"}}),P=new k({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),A=new k({props:{title:"Single image inference",local:"single-image-inference",headingTag:"h3"}}),O=new V({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}}),K=new k({props:{title:"Batched inference",local:"batched-inference",headingTag:"h3"}}),te=new V({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwTExhdmFGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEElMjMlMjBMb2FkJTIwdGhlJTIwbW9kZWwlMjBpbiUyMGhhbGYtcHJlY2lzaW9uJTBBbW9kZWwlMjAlM0QlMjBMTGF2YUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybGxhdmEtaGYlMkZsbGF2YS0xLjUtN2ItaGYlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJsbGF2YS1oZiUyRmxsYXZhLTEuNS03Yi1oZiUyMiklMEElMEElMjMlMjBHZXQlMjB0d28lMjBkaWZmZXJlbnQlMjBpbWFnZXMlMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnd3dy5pbGFua2VsbWFuLm9yZyUyRnN0b3BzaWducyUyRmF1c3RyYWxpYS5qcGclMjIlMEFpbWFnZV9zdG9wJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZV9jYXRzJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQSUyMyUyMFByZXBhcmUlMjBhJTIwYmF0Y2glMjBvZiUyMHR3byUyMHByb21wdHMlMEFjb252ZXJzYXRpb25fMSUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMldoYXQlMjBpcyUyMHNob3duJTIwaW4lMjB0aGlzJTIwaW1hZ2UlM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElNUQlMEElMEFjb252ZXJzYXRpb25fMiUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMldoYXQlMjBpcyUyMHNob3duJTIwaW4lMjB0aGlzJTIwaW1hZ2UlM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElNUQlMEElMEFwcm9tcHRfMSUyMCUzRCUyMHByb2Nlc3Nvci5hcHBseV9jaGF0X3RlbXBsYXRlKGNvbnZlcnNhdGlvbl8xJTJDJTIwYWRkX2dlbmVyYXRpb25fcHJvbXB0JTNEVHJ1ZSklMEFwcm9tcHRfMiUyMCUzRCUyMHByb2Nlc3Nvci5hcHBseV9jaGF0X3RlbXBsYXRlKGNvbnZlcnNhdGlvbl8yJTJDJTIwYWRkX2dlbmVyYXRpb25fcHJvbXB0JTNEVHJ1ZSklMEFwcm9tcHRzJTIwJTNEJTIwJTVCcHJvbXB0XzElMkMlMjBwcm9tcHRfMiU1RCUwQSUwQSUyMyUyMFdlJTIwY2FuJTIwc2ltcGx5JTIwZmVlZCUyMGltYWdlcyUyMGluJTIwdGhlJTIwb3JkZXIlMjB0aGV5JTIwaGF2ZSUyMHRvJTIwYmUlMjB1c2VkJTIwaW4lMjB0aGUlMjB0ZXh0JTIwcHJvbXB0JTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRCU1QmltYWdlX3N0b3AlMkMlMjBpbWFnZV9jYXRzJTJDJTIwaW1hZ2Vfc25vd21hbiU1RCUyQyUyMHRleHQlM0Rwcm9tcHRzJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhtb2RlbC5kZXZpY2UlMkMlMjB0b3JjaC5mbG9hdDE2KSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDMwKSUwQXByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUp",highlighted:`<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, LLavaForConditionalGeneration

<span class="hljs-comment"># Load the model in half-precision</span>
model = LLavaForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;llava-hf/llava-1.5-7b-hf&quot;</span>, torch_dtype=torch.float16, device_map=<span class="hljs-string">&quot;auto&quot;</span>)
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;llava-hf/llava-1.5-7b-hf&quot;</span>)

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

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

<span class="hljs-comment"># Prepare a batch of two prompts</span>
conversation_1 = [
    {
        <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 is shown in this image?&quot;</span>},
        ],
    },
]

conversation_2 = [
    {
        <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 is shown in this image?&quot;</span>},
        ],
    },
]

prompt_1 = processor.apply_chat_template(conversation_1, add_generation_prompt=<span class="hljs-literal">True</span>)
prompt_2 = processor.apply_chat_template(conversation_2, add_generation_prompt=<span class="hljs-literal">True</span>)
prompts = [prompt_1, prompt_2]

<span class="hljs-comment"># We can simply feed images in the order they have to be used in the text prompt</span>
inputs = processor(images=[image_stop, image_cats, image_snowman], text=prompts, padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(model.device, torch.float16)

<span class="hljs-comment"># Generate</span>
generate_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">30</span>)
processor.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>)`,wrap:!1}}),se=new V({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}}),le=new V({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}}),ie=new V({props:{code:"JTIyVVNFUiUzQSUyMCUzQ2ltYWdlJTNFJTVDbiUzQ3Byb21wdCUzRSUyMEFTU0lTVEFOVCUzQSUyMg==",highlighted:'<span class="hljs-string">&quot;USER: &lt;image&gt;\\n&lt;prompt&gt; ASSISTANT:&quot;</span>',wrap:!1}}),de=new V({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}}),pe=new k({props:{title:"Using Flash Attention 2",local:"using-flash-attention-2",headingTag:"h3"}}),he=new k({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ge=new Ja({props:{pipeline:"image-to-text"}}),Me=new k({props:{title:"LlavaConfig",local:"transformers.LlavaConfig",headingTag:"h2"}}),ye=new Ze({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/main/src/transformers/models/llava/configuration_llava.py#L24"}}),z=new Ma({props:{anchor:"transformers.LlavaConfig.example",$$slots:{default:[Ca]},$$scope:{ctx:L}}}),_e=new k({props:{title:"LlavaProcessor",local:"transformers.LlavaProcessor",headingTag:"h2"}}),ve=new Ze({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/main/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/main/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/main/src/transformers/models/llava/processing_llava.py#L40"}}),Te=new Ze({props:{name:"batch_decode",anchor:"transformers.LlavaProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/llava/processing_llava.py#L170"}}),be=new Ze({props:{name:"decode",anchor:"transformers.LlavaProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/llava/processing_llava.py#L178"}}),Ue=new k({props:{title:"LlavaForConditionalGeneration",local:"transformers.LlavaForConditionalGeneration",headingTag:"h2"}}),we=new Ze({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/llava/modeling_llava.py#L230"}}),Je=new Ze({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"},{name:"num_logits_to_keep",val:": int = 0"}],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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/main/en/model_doc/auto#transformers.AutoImageProcessor). See [CLIPImageProcessor.__call__()](/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__) for details ([]</code>LlavaProcessor`] uses\n<a href="/docs/transformers/main/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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>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/main/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>.</p>
<p>num_logits_to_keep (<code>int</code>, <em>optional</em>):
Calculate logits for the last <code>num_logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/llava/modeling_llava.py#L380",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/main/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>torch.FloatTensor</code>, <em>optional</em>) — A <code>torch.FloatTensor</code> of size (batch_size, num_images, sequence_length, hidden_size)\`.
image_hidden_states of the model produced by the vision encoder and after projecting the last hidden state.</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>
`}}),B=new wa({props:{$$slots:{default:[$a]},$$scope:{ctx:L}}}),N=new Ma({props:{anchor:"transformers.LlavaForConditionalGeneration.forward.example",$$slots:{default:[Ia]},$$scope:{ctx:L}}}),je=new ja({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/llava.md"}}),{c(){c=l("meta"),w=s(),_=l("p"),y=s(),m(v.$$.fragment),i=s(),m(T.$$.fragment),We=s(),S=l("p"),S.textContent=Rt,Ve=s(),R=l("p"),R.innerHTML=Qt,Se=s(),Q=l("p"),Q.textContent=Et,Re=s(),E=l("p"),E.innerHTML=Xt,Qe=s(),x=l("img"),Ee=s(),X=l("small"),X.innerHTML=Pt,Xe=s(),H=l("p"),H.innerHTML=Yt,He=s(),m(P.$$.fragment),Pe=s(),Y=l("ul"),Y.innerHTML=At,Ye=s(),m(A.$$.fragment),Ae=s(),D=l("p"),D.innerHTML=Dt,De=s(),m(O.$$.fragment),Oe=s(),m(K.$$.fragment),Ke=s(),ee=l("p"),ee.textContent=Ot,et=s(),m(te.$$.fragment),tt=s(),ae=l("ul"),ae.innerHTML=Kt,at=s(),ne=l("p"),ne.innerHTML=ea,nt=s(),m(se.$$.fragment),st=s(),oe=l("p"),oe.textContent=ta,ot=s(),m(le.$$.fragment),lt=s(),re=l("p"),re.innerHTML=aa,rt=s(),m(ie.$$.fragment),it=s(),ce=l("p"),ce.textContent=na,ct=s(),m(de.$$.fragment),dt=s(),m(pe.$$.fragment),pt=s(),me=l("p"),me.innerHTML=sa,mt=s(),m(he.$$.fragment),ht=s(),ue=l("p"),ue.textContent=oa,ut=s(),m(ge.$$.fragment),gt=s(),fe=l("ul"),fe.innerHTML=la,ft=s(),m(Me.$$.fragment),Mt=s(),b=l("div"),m(ye.$$.fragment),jt=s(),$e=l("p"),$e.innerHTML=ra,Ct=s(),Ie=l("p"),Ie.innerHTML=ia,$t=s(),ke=l("p"),ke.innerHTML=ca,It=s(),m(z.$$.fragment),yt=s(),m(_e.$$.fragment),_t=s(),U=l("div"),m(ve.$$.fragment),kt=s(),Le=l("p"),Le.textContent=da,Lt=s(),xe=l("p"),xe.innerHTML=pa,xt=s(),q=l("div"),m(Te.$$.fragment),zt=s(),ze=l("p"),ze.innerHTML=ma,qt=s(),F=l("div"),m(be.$$.fragment),Ft=s(),qe=l("p"),qe.innerHTML=ha,vt=s(),m(Ue.$$.fragment),Tt=s(),J=l("div"),m(we.$$.fragment),Bt=s(),Fe=l("p"),Fe.innerHTML=ua,Nt=s(),Be=l("p"),Be.innerHTML=ga,Zt=s(),$=l("div"),m(Je.$$.fragment),Gt=s(),Ne=l("p"),Ne.innerHTML=fa,Wt=s(),m(B.$$.fragment),Vt=s(),m(N.$$.fragment),bt=s(),m(je.$$.fragment),Ut=s(),Ge=l("p"),this.h()},l(e){const t=Ua("svelte-u9bgzb",document.head);c=r(t,"META",{name:!0,content:!0}),t.forEach(a),w=o(e),_=r(e,"P",{}),W(_).forEach(a),y=o(e),h(v.$$.fragment,e),i=o(e),h(T.$$.fragment,e),We=o(e),S=r(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-xhhjdz"&&(S.textContent=Rt),Ve=o(e),R=r(e,"P",{"data-svelte-h":!0}),p(R)!=="svelte-iilyg8"&&(R.innerHTML=Qt),Se=o(e),Q=r(e,"P",{"data-svelte-h":!0}),p(Q)!=="svelte-vfdo9a"&&(Q.textContent=Et),Re=o(e),E=r(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-a2g4ox"&&(E.innerHTML=Xt),Qe=o(e),x=r(e,"IMG",{src:!0,alt:!0,width:!0}),Ee=o(e),X=r(e,"SMALL",{"data-svelte-h":!0}),p(X)!=="svelte-16ml59q"&&(X.innerHTML=Pt),Xe=o(e),H=r(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-3u37is"&&(H.innerHTML=Yt),He=o(e),h(P.$$.fragment,e),Pe=o(e),Y=r(e,"UL",{"data-svelte-h":!0}),p(Y)!=="svelte-1gvp0fc"&&(Y.innerHTML=At),Ye=o(e),h(A.$$.fragment,e),Ae=o(e),D=r(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-1awenn5"&&(D.innerHTML=Dt),De=o(e),h(O.$$.fragment,e),Oe=o(e),h(K.$$.fragment,e),Ke=o(e),ee=r(e,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-befb9w"&&(ee.textContent=Ot),et=o(e),h(te.$$.fragment,e),tt=o(e),ae=r(e,"UL",{"data-svelte-h":!0}),p(ae)!=="svelte-rusc9d"&&(ae.innerHTML=Kt),at=o(e),ne=r(e,"P",{"data-svelte-h":!0}),p(ne)!=="svelte-1qk1eny"&&(ne.innerHTML=ea),nt=o(e),h(se.$$.fragment,e),st=o(e),oe=r(e,"P",{"data-svelte-h":!0}),p(oe)!=="svelte-mnlzle"&&(oe.textContent=ta),ot=o(e),h(le.$$.fragment,e),lt=o(e),re=r(e,"P",{"data-svelte-h":!0}),p(re)!=="svelte-uxk0fh"&&(re.innerHTML=aa),rt=o(e),h(ie.$$.fragment,e),it=o(e),ce=r(e,"P",{"data-svelte-h":!0}),p(ce)!=="svelte-mnlzle"&&(ce.textContent=na),ct=o(e),h(de.$$.fragment,e),dt=o(e),h(pe.$$.fragment,e),pt=o(e),me=r(e,"P",{"data-svelte-h":!0}),p(me)!=="svelte-15nzlnu"&&(me.innerHTML=sa),mt=o(e),h(he.$$.fragment,e),ht=o(e),ue=r(e,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-1bkfbxv"&&(ue.textContent=oa),ut=o(e),h(ge.$$.fragment,e),gt=o(e),fe=r(e,"UL",{"data-svelte-h":!0}),p(fe)!=="svelte-qnejrc"&&(fe.innerHTML=la),ft=o(e),h(Me.$$.fragment,e),Mt=o(e),b=r(e,"DIV",{class:!0});var j=W(b);h(ye.$$.fragment,j),jt=o(j),$e=r(j,"P",{"data-svelte-h":!0}),p($e)!=="svelte-1r3a7z"&&($e.innerHTML=ra),Ct=o(j),Ie=r(j,"P",{"data-svelte-h":!0}),p(Ie)!=="svelte-d825u1"&&(Ie.innerHTML=ia),$t=o(j),ke=r(j,"P",{"data-svelte-h":!0}),p(ke)!=="svelte-o55m63"&&(ke.innerHTML=ca),It=o(j),h(z.$$.fragment,j),j.forEach(a),yt=o(e),h(_e.$$.fragment,e),_t=o(e),U=r(e,"DIV",{class:!0});var C=W(U);h(ve.$$.fragment,C),kt=o(C),Le=r(C,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-api29h"&&(Le.textContent=da),Lt=o(C),xe=r(C,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-1qpkvbj"&&(xe.innerHTML=pa),xt=o(C),q=r(C,"DIV",{class:!0});var Ce=W(q);h(Te.$$.fragment,Ce),zt=o(Ce),ze=r(Ce,"P",{"data-svelte-h":!0}),p(ze)!=="svelte-1o9eza"&&(ze.innerHTML=ma),Ce.forEach(a),qt=o(C),F=r(C,"DIV",{class:!0});var Jt=W(F);h(be.$$.fragment,Jt),Ft=o(Jt),qe=r(Jt,"P",{"data-svelte-h":!0}),p(qe)!=="svelte-kk16qw"&&(qe.innerHTML=ha),Jt.forEach(a),C.forEach(a),vt=o(e),h(Ue.$$.fragment,e),Tt=o(e),J=r(e,"DIV",{class:!0});var Z=W(J);h(we.$$.fragment,Z),Bt=o(Z),Fe=r(Z,"P",{"data-svelte-h":!0}),p(Fe)!=="svelte-1ox7dlx"&&(Fe.innerHTML=ua),Nt=o(Z),Be=r(Z,"P",{"data-svelte-h":!0}),p(Be)!=="svelte-hswkmf"&&(Be.innerHTML=ga),Zt=o(Z),$=r(Z,"DIV",{class:!0});var G=W($);h(Je.$$.fragment,G),Gt=o(G),Ne=r(G,"P",{"data-svelte-h":!0}),p(Ne)!=="svelte-1n3tg9h"&&(Ne.innerHTML=fa),Wt=o(G),h(B.$$.fragment,G),Vt=o(G),h(N.$$.fragment,G),G.forEach(a),Z.forEach(a),bt=o(e),h(je.$$.fragment,e),Ut=o(e),Ge=r(e,"P",{}),W(Ge).forEach(a),this.h()},h(){I(c,"name","hf:doc:metadata"),I(c,"content",La),_a(x.src,Ht="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/llava_architecture.jpg")||I(x,"src",Ht),I(x,"alt","drawing"),I(x,"width","600"),I(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){d(document.head,c),n(e,w,t),n(e,_,t),n(e,y,t),u(v,e,t),n(e,i,t),u(T,e,t),n(e,We,t),n(e,S,t),n(e,Ve,t),n(e,R,t),n(e,Se,t),n(e,Q,t),n(e,Re,t),n(e,E,t),n(e,Qe,t),n(e,x,t),n(e,Ee,t),n(e,X,t),n(e,Xe,t),n(e,H,t),n(e,He,t),u(P,e,t),n(e,Pe,t),n(e,Y,t),n(e,Ye,t),u(A,e,t),n(e,Ae,t),n(e,D,t),n(e,De,t),u(O,e,t),n(e,Oe,t),u(K,e,t),n(e,Ke,t),n(e,ee,t),n(e,et,t),u(te,e,t),n(e,tt,t),n(e,ae,t),n(e,at,t),n(e,ne,t),n(e,nt,t),u(se,e,t),n(e,st,t),n(e,oe,t),n(e,ot,t),u(le,e,t),n(e,lt,t),n(e,re,t),n(e,rt,t),u(ie,e,t),n(e,it,t),n(e,ce,t),n(e,ct,t),u(de,e,t),n(e,dt,t),u(pe,e,t),n(e,pt,t),n(e,me,t),n(e,mt,t),u(he,e,t),n(e,ht,t),n(e,ue,t),n(e,ut,t),u(ge,e,t),n(e,gt,t),n(e,fe,t),n(e,ft,t),u(Me,e,t),n(e,Mt,t),n(e,b,t),u(ye,b,null),d(b,jt),d(b,$e),d(b,Ct),d(b,Ie),d(b,$t),d(b,ke),d(b,It),u(z,b,null),n(e,yt,t),u(_e,e,t),n(e,_t,t),n(e,U,t),u(ve,U,null),d(U,kt),d(U,Le),d(U,Lt),d(U,xe),d(U,xt),d(U,q),u(Te,q,null),d(q,zt),d(q,ze),d(U,qt),d(U,F),u(be,F,null),d(F,Ft),d(F,qe),n(e,vt,t),u(Ue,e,t),n(e,Tt,t),n(e,J,t),u(we,J,null),d(J,Bt),d(J,Fe),d(J,Nt),d(J,Be),d(J,Zt),d(J,$),u(Je,$,null),d($,Gt),d($,Ne),d($,Wt),u(B,$,null),d($,Vt),u(N,$,null),n(e,bt,t),u(je,e,t),n(e,Ut,t),n(e,Ge,t),wt=!0},p(e,[t]){const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),z.$set(j);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),B.$set(C);const Ce={};t&2&&(Ce.$$scope={dirty:t,ctx:e}),N.$set(Ce)},i(e){wt||(g(v.$$.fragment,e),g(T.$$.fragment,e),g(P.$$.fragment,e),g(A.$$.fragment,e),g(O.$$.fragment,e),g(K.$$.fragment,e),g(te.$$.fragment,e),g(se.$$.fragment,e),g(le.$$.fragment,e),g(ie.$$.fragment,e),g(de.$$.fragment,e),g(pe.$$.fragment,e),g(he.$$.fragment,e),g(ge.$$.fragment,e),g(Me.$$.fragment,e),g(ye.$$.fragment,e),g(z.$$.fragment,e),g(_e.$$.fragment,e),g(ve.$$.fragment,e),g(Te.$$.fragment,e),g(be.$$.fragment,e),g(Ue.$$.fragment,e),g(we.$$.fragment,e),g(Je.$$.fragment,e),g(B.$$.fragment,e),g(N.$$.fragment,e),g(je.$$.fragment,e),wt=!0)},o(e){f(v.$$.fragment,e),f(T.$$.fragment,e),f(P.$$.fragment,e),f(A.$$.fragment,e),f(O.$$.fragment,e),f(K.$$.fragment,e),f(te.$$.fragment,e),f(se.$$.fragment,e),f(le.$$.fragment,e),f(ie.$$.fragment,e),f(de.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(ge.$$.fragment,e),f(Me.$$.fragment,e),f(ye.$$.fragment,e),f(z.$$.fragment,e),f(_e.$$.fragment,e),f(ve.$$.fragment,e),f(Te.$$.fragment,e),f(be.$$.fragment,e),f(Ue.$$.fragment,e),f(we.$$.fragment,e),f(Je.$$.fragment,e),f(B.$$.fragment,e),f(N.$$.fragment,e),f(je.$$.fragment,e),wt=!1},d(e){e&&(a(w),a(_),a(y),a(i),a(We),a(S),a(Ve),a(R),a(Se),a(Q),a(Re),a(E),a(Qe),a(x),a(Ee),a(X),a(Xe),a(H),a(He),a(Pe),a(Y),a(Ye),a(Ae),a(D),a(De),a(Oe),a(Ke),a(ee),a(et),a(tt),a(ae),a(at),a(ne),a(nt),a(st),a(oe),a(ot),a(lt),a(re),a(rt),a(it),a(ce),a(ct),a(dt),a(pt),a(me),a(mt),a(ht),a(ue),a(ut),a(gt),a(fe),a(ft),a(Mt),a(b),a(yt),a(_t),a(U),a(vt),a(Tt),a(J),a(bt),a(Ut),a(Ge)),a(c),M(v,e),M(T,e),M(P,e),M(A,e),M(O,e),M(K,e),M(te,e),M(se,e),M(le,e),M(ie,e),M(de,e),M(pe,e),M(he,e),M(ge,e),M(Me,e),M(ye),M(z),M(_e,e),M(ve),M(Te),M(be),M(Ue,e),M(we),M(Je),M(B),M(N),M(je,e)}}}const La='{"title":"LLaVa","local":"llava","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[{"title":"Single image inference","local":"single-image-inference","sections":[],"depth":3},{"title":"Batched inference","local":"batched-inference","sections":[],"depth":3},{"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 xa(L){return va(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Va extends Ta{constructor(c){super(),ba(this,c,xa,ka,ya,{})}}export{Va as component};
