import{s as On,o as Kn,n as H}from"../chunks/scheduler.18a86fab.js";import{S as eo,i as to,g as i,s as r,r as m,A as no,h as d,f as s,c as l,j as b,x as T,u as h,k as j,l as oo,y as a,a as c,v as u,d as _,t as g,w as f}from"../chunks/index.98837b22.js";import{T as Nt}from"../chunks/Tip.77304350.js";import{D as k}from"../chunks/Docstring.6758ea23.js";import{C as X}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as Un}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as re}from"../chunks/Heading.7e7e0c5b.js";import{H as so,a as Dn}from"../chunks/HfOption.6641485e.js";import{E as ao}from"../chunks/index.499f366c.js";function ro(J){let t,p="Click on the Qwen2.5-VL models in the right sidebar for more examples of how to apply Qwen2.5-VL to different vision and language tasks.";return{c(){t=i("p"),t.textContent=p},l(n){t=d(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-vvz2h8"&&(t.textContent=p)},m(n,M){c(n,t,M)},p:H,d(n){n&&s(t)}}}function lo(J){let t,p;return t=new X({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwcGlwZWxpbmUlMEFwaXBlJTIwJTNEJTIwcGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwdGFzayUzRCUyMmltYWdlLXRleHQtdG8tdGV4dCUyMiUyQyUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyUXdlbiUyRlF3ZW4yLjUtVkwtN0ItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2UlM0QwJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiUwQSklMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnVybCUyMiUzQSUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnBpcGVsaW5lLWNhdC1jaG9uay5qcGVnJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIwJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTVEJTBBcGlwZSh0ZXh0JTNEbWVzc2FnZXMlMkNtYXhfbmV3X3Rva2VucyUzRDIwJTJDJTIwcmV0dXJuX2Z1bGxfdGV4dCUzREZhbHNlKSUwQQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
pipe = pipeline(
    task=<span class="hljs-string">&quot;image-text-to-text&quot;</span>,
    model=<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>,
    device=<span class="hljs-number">0</span>,
    torch_dtype=torch.bfloat16
)
messages = [
    {
        <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;url&quot;</span>: <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&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 this image.&quot;</span>},
        ]
    }
]
pipe(text=messages,max_new_tokens=<span class="hljs-number">20</span>, return_full_text=<span class="hljs-literal">False</span>)
`,wrap:!1}}),{c(){m(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,M){u(t,n,M),p=!0},p:H,i(n){p||(_(t.$$.fragment,n),p=!0)},o(n){g(t.$$.fragment,n),p=!1},d(n){f(t,n)}}}function io(J){let t,p;return t=new X({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwUXdlbjJfNV9WTEZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUyQyUyMEF1dG9Qcm9jZXNzb3IlMEElMEFtb2RlbCUyMCUzRCUyMFF3ZW4yXzVfVkxGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMlF3ZW4lMkZRd2VuMi41LVZMLTdCLUluc3RydWN0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIlMkMlMEElMjAlMjAlMjAlMjBhdHRuX2ltcGxlbWVudGF0aW9uJTNEJTIyc2RwYSUyMiUwQSklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJRd2VuJTJGUXdlbjIuNS1WTC03Qi1JbnN0cnVjdCUyMiklMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjJpbWFnZSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnVybCUyMiUzQSUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnBpcGVsaW5lLWNhdC1jaG9uay5qcGVnJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydHlwZSUyMiUzQSUyMnRleHQlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ0ZXh0JTIyJTNBJTIyRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTBBJTVEJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yLmFwcGx5X2NoYXRfdGVtcGxhdGUoJTBBJTIwJTIwJTIwJTIwbWVzc2FnZXMlMkMlMEElMjAlMjAlMjAlMjBhZGRfZ2VuZXJhdGlvbl9wcm9tcHQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX2RpY3QlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSkudG8oJTIyY3VkYSUyMiklMEElMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDEyOCklMEFnZW5lcmF0ZWRfaWRzX3RyaW1tZWQlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXRfaWRzJTVCbGVuKGluX2lkcyklMjAlM0ElNUQlMjBmb3IlMjBpbl9pZHMlMkMlMjBvdXRfaWRzJTIwaW4lMjB6aXAoaW5wdXRzLmlucHV0X2lkcyUyQyUyMGdlbmVyYXRlZF9pZHMpJTBBJTVEJTBBb3V0cHV0X3RleHQlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMGdlbmVyYXRlZF9pZHNfdHJpbW1lZCUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlJTBBKSUwQXByaW50KG91dHB1dF90ZXh0KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2_5_VLForConditionalGeneration, AutoProcessor

model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    <span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>,
    torch_dtype=torch.float16,
    device_map=<span class="hljs-string">&quot;auto&quot;</span>,
    attn_implementation=<span class="hljs-string">&quot;sdpa&quot;</span>
)
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>)
messages = [
    {
        <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;url&quot;</span>: <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/pipeline-cat-chonk.jpeg&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 this image.&quot;</span>
            }
        ]
    }

]

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

generated_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">128</span>)
generated_ids_trimmed = [
            out_ids[<span class="hljs-built_in">len</span>(in_ids) :] <span class="hljs-keyword">for</span> in_ids, out_ids <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
       generated_ids_trimmed, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>
)
<span class="hljs-built_in">print</span>(output_text)`,wrap:!1}}),{c(){m(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,M){u(t,n,M),p=!0},p:H,i(n){p||(_(t.$$.fragment,n),p=!0)},o(n){g(t.$$.fragment,n),p=!1},d(n){f(t,n)}}}function co(J){let t,p,n,M;return t=new Dn({props:{id:"usage",option:"Pipeline",$$slots:{default:[lo]},$$scope:{ctx:J}}}),n=new Dn({props:{id:"usage",option:"AutoModel",$$slots:{default:[io]},$$scope:{ctx:J}}}),{c(){m(t.$$.fragment),p=r(),m(n.$$.fragment)},l(w){h(t.$$.fragment,w),p=l(w),h(n.$$.fragment,w)},m(w,y){u(t,w,y),c(w,p,y),u(n,w,y),M=!0},p(w,y){const z={};y&2&&(z.$$scope={dirty:y,ctx:w}),t.$set(z);const W={};y&2&&(W.$$scope={dirty:y,ctx:w}),n.$set(W)},i(w){M||(_(t.$$.fragment,w),_(n.$$.fragment,w),M=!0)},o(w){g(t.$$.fragment,w),g(n.$$.fragment,w),M=!1},d(w){w&&s(p),f(t,w),f(n,w)}}}function po(J){let t,p;return t=new X({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFF3ZW4yXzVfVkxGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMjBRd2VuMl81X1ZMQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFF3ZW4yXzVfVkwlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwUXdlbjJfNV9WTENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMFF3ZW4yLVZMLTdCJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBRd2VuMl81X1ZMRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2_5_VLForConditionalGeneration, Qwen2_5_VLConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Qwen2_5_VL style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Qwen2_5_VLConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the Qwen2-VL-7B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Qwen2_5_VLForConditionalGeneration(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(){m(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,M){u(t,n,M),p=!0},p:H,i(n){p||(_(t.$$.fragment,n),p=!0)},o(n){g(t.$$.fragment,n),p=!1},d(n){f(t,n)}}}function mo(J){let t,p;return t=new X({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFF3ZW4yXzVfVkxUZXh0TW9kZWwlMkMlMjBRd2VuMl81X1ZMQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFF3ZW4yXzVfVkwlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwUXdlbjJfNV9WTENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMFF3ZW4yLVZMLTdCJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBRd2VuMl81X1ZMVGV4dE1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2_5_VLTextModel, Qwen2_5_VLConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Qwen2_5_VL style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Qwen2_5_VLConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the Qwen2-VL-7B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Qwen2_5_VLTextModel(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(){m(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,M){u(t,n,M),p=!0},p:H,i(n){p||(_(t.$$.fragment,n),p=!0)},o(n){g(t.$$.fragment,n),p=!1},d(n){f(t,n)}}}function ho(J){let t,p=`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(){t=i("p"),t.innerHTML=p},l(n){t=d(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(n,M){c(n,t,M)},p:H,d(n){n&&s(t)}}}function uo(J){let t,p=`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(){t=i("p"),t.innerHTML=p},l(n){t=d(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(n,M){c(n,t,M)},p:H,d(n){n&&s(t)}}}function _o(J){let t,p=`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(){t=i("p"),t.innerHTML=p},l(n){t=d(n,"P",{"data-svelte-h":!0}),T(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(n,M){c(n,t,M)},p:H,d(n){n&&s(t)}}}function go(J){let t,p="Example:",n,M,w;return M=new X({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFF3ZW4yXzVfVkxGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMFF3ZW4yXzVfVkxGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMlF3ZW4lMkZRd2VuMi41LVZMLTdCLUluc3RydWN0JTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMlF3ZW4lMkZRd2VuMi41LVZMLTdCLUluc3RydWN0JTIyKSUwQSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZ3d3cuaWxhbmtlbG1hbi5vcmclMkZzdG9wc2lnbnMlMkZhdXN0cmFsaWEuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBdGV4dCUyMCUzRCUyMHByb2Nlc3Nvci5hcHBseV9jaGF0X3RlbXBsYXRlKG1lc3NhZ2VzJTJDJTIwdG9rZW5pemUlM0RGYWxzZSUyQyUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0QlNUJ0ZXh0JTVEJTJDJTIwaW1hZ2VzJTNEJTVCaW1hZ2UlNUQlMkMlMjB2aXNpb25faW5mb3MlM0QlNUJ2aXNpb25faW5mb3MlNUQpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMuaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDMwKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpJTVCMCU1RA==",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, Qwen2_5_VLForConditionalGeneration

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Qwen2_5_VLForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [
    {
        <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>},
        ],
    },
]
<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>text = processor.apply_chat_template(messages, tokenize=<span class="hljs-literal">False</span>, add_generation_prompt=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=[text], images=[image], vision_infos=[vision_infos])

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;The image shows a street scene with a red stop sign in the foreground. In the background, there is a large red gate with Chinese characters ...&quot;</span>`,wrap:!1}}),{c(){t=i("p"),t.textContent=p,n=r(),m(M.$$.fragment)},l(y){t=d(y,"P",{"data-svelte-h":!0}),T(t)!=="svelte-11lpom8"&&(t.textContent=p),n=l(y),h(M.$$.fragment,y)},m(y,z){c(y,t,z),c(y,n,z),u(M,y,z),w=!0},p:H,i(y){w||(_(M.$$.fragment,y),w=!0)},o(y){g(M.$$.fragment,y),w=!1},d(y){y&&(s(t),s(n)),f(M,y)}}}function fo(J){let t,p,n,M,w,y='<div class="flex flex-wrap space-x-1"><img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/></div>',z,W,mt,le,In='<a href="https://huggingface.co/papers/2502.13923" rel="nofollow">Qwen2.5-VL</a> is a multimodal vision-language model, available in 3B, 7B, and 72B parameters, pretrained on 4.1T tokens. The model introduces window attention in the ViT encoder to accelerate training and inference, dynamic FPS sampling on the spatial and temporal dimensions for better video understanding across different sampling rates, and an upgraded MRoPE (multi-resolutional rotary positional encoding) mechanism to better capture and learn temporal dynamics.',ht,ie,vn='You can find all the original Qwen2.5-VL checkpoints under the <a href="https://huggingface.co/collections/Qwen/qwen25-vl-6795ffac22b334a837c0f9a5" rel="nofollow">Qwen2.5-VL</a> collection.',ut,S,_t,de,jn='The example below demonstrates how to generate text based on an image with <a href="/docs/transformers/main/en/main_classes/pipelines#transformers.Pipeline">Pipeline</a> or the <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoModel">AutoModel</a> class.',gt,Y,ft,ce,Cn='Quantization reduces the memory burden of large models by representing the weights in a lower precision. Refer to the <a href="../quantization/overview">Quantization</a> overview for more available quantization backends.',wt,pe,Qn='The example below uses <a href="../quantization/torchao">torchao</a> to only quantize the weights to int4.',Mt,me,Tt,he,yt,q,ue,Fe,Vn="Use Qwen2.5-VL for video inputs by setting <code>&quot;type&quot;: &quot;video&quot;</code> as shown below.",Gt,_e,Ft,ge,Re,xn=`Use Qwen2.5-VL for a mixed batch of inputs (images, videos, text). Add labels when handling multiple images or videos for better reference
as show below.`,Rt,fe,Xt,B,Xe,kn='Use the <code>min_pixels</code> and <code>max_pixels</code> parameters in <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a> to set the resolution.',At,we,Et,Ae,zn="Higher resolution can require more compute whereas reducing the resolution can save memory as follows:",Ht,Me,Jt,Te,bt,C,ye,St,Ee,Bn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLModel">Qwen2_5_VLModel</a>. It is used to instantiate a
Qwen2-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-VL-7B-Instruct <a href="https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct" rel="nofollow">Qwen/Qwen2-VL-7B-Instruct</a>.`,Yt,He,$n=`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.`,Pt,P,Ut,Je,It,Q,be,Dt,Se,Zn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLTextModel">Qwen2_5_VLTextModel</a>. It is used to instantiate a
Qwen2-VL model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-VL-7B-Instruct <a href="https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct" rel="nofollow">Qwen/Qwen2-VL-7B-Instruct</a>.`,Ot,Ye,Ln=`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.`,Kt,D,vt,Ue,jt,U,Ie,en,Pe,Wn=`Constructs a Qwen2.5-VL processor which wraps a Qwen2.5-VL image processor and a Qwen2 tokenizer into a single processor.
<a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLProcessor">Qwen2_5_VLProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/qwen2_vl#transformers.Qwen2VLImageProcessor">Qwen2VLImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2TokenizerFast">Qwen2TokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLProcessor.decode">decode()</a> for more information.`,tn,O,ve,nn,De,qn=`This method forwards all its arguments to Qwen2TokenizerFast’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.`,on,K,je,sn,Oe,Nn=`This method forwards all its arguments to Qwen2TokenizerFast’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.`,an,ee,Ce,rn,Ke,Gn="Post-process the output of the model to decode the text.",Ct,Qe,Qt,I,Ve,ln,et,Fn="The bare Qwen2 5 Vl Text Model outputting raw hidden-states without any specific head on to.",dn,tt,Rn=`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.)`,cn,nt,Xn=`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.`,pn,N,xe,mn,ot,An='The <a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLTextModel">Qwen2_5_VLTextModel</a> forward method, overrides the <code>__call__</code> special method.',hn,te,Vt,ke,xt,v,ze,un,st,En="The bare Qwen2 5 Vl Model outputting raw hidden-states without any specific head on top.",_n,at,Hn=`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.)`,gn,rt,Sn=`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.`,fn,G,Be,wn,lt,Yn='The <a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLModel">Qwen2_5_VLModel</a> forward method, overrides the <code>__call__</code> special method.',Mn,ne,kt,$e,zt,A,Ze,Tn,x,Le,yn,it,Pn='The <a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLForConditionalGeneration">Qwen2_5_VLForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Jn,oe,bn,se,Bt,We,$t,pt,Zt;return W=new re({props:{title:"Qwen2.5-VL",local:"qwen25-vl",headingTag:"h1"}}),S=new Nt({props:{warning:!1,$$slots:{default:[ro]},$$scope:{ctx:J}}}),Y=new so({props:{id:"usage",options:["Pipeline","AutoModel"],$$slots:{default:[co]},$$scope:{ctx:J}}}),me=new X({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVG9yY2hBb0NvbmZpZyUyQyUyMFF3ZW4yXzVfVkxGb3JDb25kaXRpb25hbEdlbmVyYXRpb24lMkMlMjBBdXRvUHJvY2Vzc29yJTBBJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMFRvcmNoQW9Db25maWcoJTIyaW50NF93ZWlnaHRfb25seSUyMiUyQyUyMGdyb3VwX3NpemUlM0QxMjgpJTBBbW9kZWwlMjAlM0QlMjBRd2VuMl81X1ZMRm9yQ29uZGl0aW9uYWxHZW5lcmF0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJRd2VuJTJGUXdlbjIuNS1WTC03Qi1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMiUyQyUwQSUyMCUyMCUyMCUyMHF1YW50aXphdGlvbl9jb25maWclM0RxdWFudGl6YXRpb25fY29uZmlnJTBBKSUwQQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TorchAoConfig, Qwen2_5_VLForConditionalGeneration, AutoProcessor

quantization_config = TorchAoConfig(<span class="hljs-string">&quot;int4_weight_only&quot;</span>, group_size=<span class="hljs-number">128</span>)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    <span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>,
    torch_dtype=torch.bfloat16,
    device_map=<span class="hljs-string">&quot;auto&quot;</span>,
    quantization_config=quantization_config
)
`,wrap:!1}}),he=new re({props:{title:"Notes",local:"notes",headingTag:"h3"}}),_e=new X({props:{code:"Y29udmVyc2F0aW9uJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMnZpZGVvJTIyJTJDJTIwJTIycGF0aCUyMiUzQSUyMCUyMiUyRnBhdGglMkZ0byUyRnZpZGVvLm1wNCUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMldoYXQlMjBoYXBwZW5lZCUyMGluJTIwdGhlJTIwdmlkZW8lM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjAlN0QlMEElNUQlMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IuYXBwbHlfY2hhdF90ZW1wbGF0ZSglMEElMjAlMjAlMjAlMjBjb252ZXJzYXRpb24lMkMlMEElMjAlMjAlMjAlMjB2aWRlb19mcHMlM0QxJTJDJTBBJTIwJTIwJTIwJTIwYWRkX2dlbmVyYXRpb25fcHJvbXB0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl9kaWN0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpLnRvKG1vZGVsLmRldmljZSklMEElMEElMjMlMjBJbmZlcmVuY2UlM0ElMjBHZW5lcmF0aW9uJTIwb2YlMjB0aGUlMjBvdXRwdXQlMEFvdXRwdXRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDEyOCklMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwJTVCb3V0cHV0X2lkcyU1QmxlbihpbnB1dF9pZHMpJTNBJTVEJTIwZm9yJTIwaW5wdXRfaWRzJTJDJTIwb3V0cHV0X2lkcyUyMGluJTIwemlwKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBvdXRwdXRfaWRzKSU1RCUwQW91dHB1dF90ZXh0JTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNEVHJ1ZSklMEFwcmludChvdXRwdXRfdGV4dCk=",highlighted:`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;video&quot;</span>, <span class="hljs-string">&quot;path&quot;</span>: <span class="hljs-string">&quot;/path/to/video.mp4&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 happened in the video?&quot;</span>},
        ],
    }
]

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

<span class="hljs-comment"># Inference: Generation of the output</span>
output_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">128</span>)
generated_ids = [output_ids[<span class="hljs-built_in">len</span>(input_ids):] <span class="hljs-keyword">for</span> input_ids, output_ids <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(inputs.input_ids, output_ids)]
output_text = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">True</span>)
<span class="hljs-built_in">print</span>(output_text)`,wrap:!1}}),fe=new X({props:{code:" ",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2_5_VLForConditionalGeneration, AutoProcessor

model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    <span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>,
    torch_dtype=torch.float16,
    device_map=<span class="hljs-string">&quot;auto&quot;</span>,
    attn_implementation=<span class="hljs-string">&quot;sdpa&quot;</span>
)
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&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;Hello, how are you?&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;I&#x27;m doing well, thank you for asking. How can I assist you today?&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;Can you describe these images and video?&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;image&quot;</span>}, 
            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;video&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;These are from my vacation.&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;I&#x27;d be happy to describe the images and video for you. Could you please provide more context about your vacation?&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;It was a trip to the mountains. Can you see the details in the images and video?&quot;</span>
    }
]

<span class="hljs-comment"># default:</span>
prompt_without_id = processor.apply_chat_template(conversation, add_generation_prompt=<span class="hljs-literal">True</span>)
<span class="hljs-comment"># Excepted output: &#x27;&lt;|im_start|&gt;system\\nYou are a helpful assistant.&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\n&lt;|vision_start|&gt;&lt;|image_pad|&gt;&lt;|vision_end|&gt;Hello, how are you?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\nI&#x27;m doing well, thank you for asking. How can I assist you today?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\nCan you describe these images and video?&lt;|vision_start|&gt;&lt;|image_pad|&gt;&lt;|vision_end|&gt;&lt;|vision_start|&gt;&lt;|image_pad|&gt;&lt;|vision_end|&gt;&lt;|vision_start|&gt;&lt;|video_pad|&gt;&lt;|vision_end|&gt;These are from my vacation.&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\nI&#x27;d be happy to describe the images and video for you. Could you please provide more context about your vacation?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\nIt was a trip to the mountains. Can you see the details in the images and video?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\n&#x27;</span>


<span class="hljs-comment"># add ids</span>
prompt_with_id = processor.apply_chat_template(conversation, add_generation_prompt=<span class="hljs-literal">True</span>, add_vision_id=<span class="hljs-literal">True</span>)
<span class="hljs-comment"># Excepted output: &#x27;&lt;|im_start|&gt;system\\nYou are a helpful assistant.&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\nPicture 1: &lt;|vision_start|&gt;&lt;|image_pad|&gt;&lt;|vision_end|&gt;Hello, how are you?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\nI&#x27;m doing well, thank you for asking. How can I assist you today?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\nCan you describe these images and video?Picture 2: &lt;|vision_start|&gt;&lt;|image_pad|&gt;&lt;|vision_end|&gt;Picture 3: &lt;|vision_start|&gt;&lt;|image_pad|&gt;&lt;|vision_end|&gt;Video 1: &lt;|vision_start|&gt;&lt;|video_pad|&gt;&lt;|vision_end|&gt;These are from my vacation.&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\nI&#x27;d be happy to describe the images and video for you. Could you please provide more context about your vacation?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\nIt was a trip to the mountains. Can you see the details in the images and video?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\n&#x27;</span>`,wrap:!1}}),we=new X({props:{code:"bWluX3BpeGVscyUyMCUzRCUyMDIyNCoyMjQlMEFtYXhfcGl4ZWxzJTIwJTNEJTIwMjA0OCoyMDQ4JTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyUXdlbiUyRlF3ZW4yLjUtVkwtN0ItSW5zdHJ1Y3QlMjIlMkMlMjBtaW5fcGl4ZWxzJTNEbWluX3BpeGVscyUyQyUyMG1heF9waXhlbHMlM0RtYXhfcGl4ZWxzKQ==",highlighted:`min_pixels = <span class="hljs-number">224</span>*<span class="hljs-number">224</span>
max_pixels = <span class="hljs-number">2048</span>*<span class="hljs-number">2048</span>
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>, min_pixels=min_pixels, max_pixels=max_pixels)`,wrap:!1}}),Me=new X({props:{code:"bWluX3BpeGVscyUyMCUzRCUyMDI1NioyOCoyOCUwQW1heF9waXhlbHMlMjAlM0QlMjAxMDI0KjI4KjI4JTIwJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyUXdlbiUyRlF3ZW4yLjUtVkwtN0ItSW5zdHJ1Y3QlMjIlMkMlMjBtaW5fcGl4ZWxzJTNEbWluX3BpeGVscyUyQyUyMG1heF9waXhlbHMlM0RtYXhfcGl4ZWxzKQ==",highlighted:`min_pixels = <span class="hljs-number">256</span>*<span class="hljs-number">28</span>*<span class="hljs-number">28</span>
max_pixels = <span class="hljs-number">1024</span>*<span class="hljs-number">28</span>*<span class="hljs-number">28</span> 
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen2.5-VL-7B-Instruct&quot;</span>, min_pixels=min_pixels, max_pixels=max_pixels)`,wrap:!1}}),Te=new re({props:{title:"Qwen2_5_VLConfig",local:"transformers.Qwen2_5_VLConfig",headingTag:"h2"}}),ye=new k({props:{name:"class transformers.Qwen2_5_VLConfig",anchor:"transformers.Qwen2_5_VLConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"image_token_id",val:" = 151655"},{name:"video_token_id",val:" = 151656"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLConfig.text_config",description:`<strong>text_config</strong> (<code>Union[PreTrainedConfig, dict]</code>, <em>optional</em>, defaults to <code>Qwen2_5_VLTextConfig</code>) &#x2014;
The config object or dictionary of the text backbone.`,name:"text_config"},{anchor:"transformers.Qwen2_5_VLConfig.vision_config",description:`<strong>vision_config</strong> (<code>Union[PreTrainedConfig, dict]</code>,  <em>optional</em>, defaults to <code>Qwen2_5_VLVisionConfig</code>) &#x2014;
The config object or dictionary of the vision backbone.`,name:"vision_config"},{anchor:"transformers.Qwen2_5_VLConfig.image_token_id",description:`<strong>image_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 151655) &#x2014;
The image token index to encode the image prompt.`,name:"image_token_id"},{anchor:"transformers.Qwen2_5_VLConfig.video_token_id",description:`<strong>video_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 151656) &#x2014;
The video token index to encode the image prompt.`,name:"video_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/configuration_qwen2_5_vl.py#L259"}}),P=new Un({props:{anchor:"transformers.Qwen2_5_VLConfig.example",$$slots:{default:[po]},$$scope:{ctx:J}}}),Je=new re({props:{title:"Qwen2_5_VLTextConfig",local:"transformers.Qwen2_5_VLTextConfig",headingTag:"h2"}}),be=new k({props:{name:"class transformers.Qwen2_5_VLTextConfig",anchor:"transformers.Qwen2_5_VLTextConfig",parameters:[{name:"vocab_size",val:" = 152064"},{name:"hidden_size",val:" = 8192"},{name:"intermediate_size",val:" = 29568"},{name:"num_hidden_layers",val:" = 80"},{name:"num_attention_heads",val:" = 64"},{name:"num_key_value_heads",val:" = 8"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 32768"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 1000000.0"},{name:"use_sliding_window",val:" = False"},{name:"sliding_window",val:" = 4096"},{name:"max_window_layers",val:" = 80"},{name:"attention_dropout",val:" = 0.0"},{name:"rope_scaling",val:" = None"},{name:"image_token_id",val:" = None"},{name:"video_token_id",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 152064) &#x2014;
Vocabulary size of the Qwen2_5_VL model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLModel">Qwen2_5_VLModel</a>`,name:"vocab_size"},{anchor:"transformers.Qwen2_5_VLTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.Qwen2_5_VLTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 29568) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.Qwen2_5_VLTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 80) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Qwen2_5_VLTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Qwen2_5_VLTextConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1</code> the model will use Multi Query Attention (MQA) otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
by meanpooling all the original heads within that group. For more details checkout <a href="https://arxiv.org/pdf/2305.13245.pdf" rel="nofollow">this
paper</a>. If it is not specified, will default to <code>32</code>.`,name:"num_key_value_heads"},{anchor:"transformers.Qwen2_5_VLTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.Qwen2_5_VLTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 32768) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.Qwen2_5_VLTextConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.Qwen2_5_VLTextConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.Qwen2_5_VLTextConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.Qwen2_5_VLTextConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model&#x2019;s input and output word embeddings should be tied.`,name:"tie_word_embeddings"},{anchor:"transformers.Qwen2_5_VLTextConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 1000000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.Qwen2_5_VLTextConfig.use_sliding_window",description:`<strong>use_sliding_window</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use sliding window attention.`,name:"use_sliding_window"},{anchor:"transformers.Qwen2_5_VLTextConfig.sliding_window",description:`<strong>sliding_window</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Sliding window attention (SWA) window size. If not specified, will default to <code>4096</code>.`,name:"sliding_window"},{anchor:"transformers.Qwen2_5_VLTextConfig.max_window_layers",description:`<strong>max_window_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 80) &#x2014;
The number of layers that use SWA (Sliding Window Attention). The bottom layers use SWA while the top use full attention.`,name:"max_window_layers"},{anchor:"transformers.Qwen2_5_VLTextConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.Qwen2_5_VLTextConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type
and you expect the model to work on longer <code>max_position_embeddings</code>, we recommend you to update this value
accordingly.
Expected contents:
<code>rope_type</code> (<code>str</code>):
The sub-variant of RoPE to use. Can be one of [&#x2018;default&#x2019;, &#x2018;linear&#x2019;, &#x2018;dynamic&#x2019;, &#x2018;yarn&#x2019;, &#x2018;longrope&#x2019;,
&#x2018;llama3&#x2019;], with &#x2018;default&#x2019; being the original RoPE implementation.
<code>factor</code> (<code>float</code>, <em>optional</em>):
Used with all rope types except &#x2018;default&#x2019;. The scaling factor to apply to the RoPE embeddings. In
most scaling types, a <code>factor</code> of x will enable the model to handle sequences of length x <em>
original maximum pre-trained length.
<code>original_max_position_embeddings</code> (<code>int</code>, </em>optional<em>):
Used with &#x2018;dynamic&#x2019;, &#x2018;longrope&#x2019; and &#x2018;llama3&#x2019;. The original max position embeddings used during
pretraining.
<code>attention_factor</code> (<code>float</code>, </em>optional<em>):
Used with &#x2018;yarn&#x2019; and &#x2018;longrope&#x2019;. The scaling factor to be applied on the attention
computation. If unspecified, it defaults to value recommended by the implementation, using the
<code>factor</code> field to infer the suggested value.
<code>beta_fast</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;yarn&#x2019;. Parameter to set the boundary for extrapolation (only) in the linear
ramp function. If unspecified, it defaults to 32.
<code>beta_slow</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;yarn&#x2019;. Parameter to set the boundary for interpolation (only) in the linear
ramp function. If unspecified, it defaults to 1.
<code>short_factor</code> (<code>List[float]</code>, </em>optional<em>):
Only used with &#x2018;longrope&#x2019;. The scaling factor to be applied to short contexts (&lt;
<code>original_max_position_embeddings</code>). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2
<code>long_factor</code> (<code>List[float]</code>, </em>optional<em>):
Only used with &#x2018;longrope&#x2019;. The scaling factor to be applied to long contexts (&lt;
<code>original_max_position_embeddings</code>). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2
<code>low_freq_factor</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;llama3&#x2019;. Scaling factor applied to low frequency components of the RoPE
<code>high_freq_factor</code> (<code>float</code>, </em>optional*):
Only used with &#x2018;llama3&#x2019;. Scaling factor applied to high frequency components of the RoPE`,name:"rope_scaling"},{anchor:"transformers.Qwen2_5_VLTextConfig.image_token_id",description:`<strong>image_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Token index used as placeholder for image embeddings.`,name:"image_token_id"},{anchor:"transformers.Qwen2_5_VLTextConfig.video_token_id",description:`<strong>video_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Token index used as placeholder for video embeddings.`,name:"video_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/configuration_qwen2_5_vl.py#L70"}}),D=new Un({props:{anchor:"transformers.Qwen2_5_VLTextConfig.example",$$slots:{default:[mo]},$$scope:{ctx:J}}}),Ue=new re({props:{title:"Qwen2_5_VLProcessor",local:"transformers.Qwen2_5_VLProcessor",headingTag:"h2"}}),Ie=new k({props:{name:"class transformers.Qwen2_5_VLProcessor",anchor:"transformers.Qwen2_5_VLProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"video_processor",val:" = None"},{name:"chat_template",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/qwen2_vl#transformers.Qwen2VLImageProcessor">Qwen2VLImageProcessor</a>, <em>optional</em>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.Qwen2_5_VLProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2TokenizerFast">Qwen2TokenizerFast</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.Qwen2_5_VLProcessor.video_processor",description:`<strong>video_processor</strong> (<code>Qwen2_5_VLVideoProcessor</code>, <em>optional</em>) &#x2014;
The video processor is a required input.`,name:"video_processor"},{anchor:"transformers.Qwen2_5_VLProcessor.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) &#x2014; A Jinja template which will be used to convert lists of messages
in a chat into a tokenizable string.`,name:"chat_template"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/processing_qwen2_5_vl.py#L58"}}),ve=new k({props:{name:"batch_decode",anchor:"transformers.Qwen2_5_VLProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/processing_qwen2_5_vl.py#L196"}}),je=new k({props:{name:"decode",anchor:"transformers.Qwen2_5_VLProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/processing_qwen2_5_vl.py#L203"}}),Ce=new k({props:{name:"post_process_image_text_to_text",anchor:"transformers.Qwen2_5_VLProcessor.post_process_image_text_to_text",parameters:[{name:"generated_outputs",val:""},{name:"skip_special_tokens",val:" = True"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLProcessor.post_process_image_text_to_text.generated_outputs",description:`<strong>generated_outputs</strong> (<code>torch.Tensor</code> or <code>np.ndarray</code>) &#x2014;
The output of the model <code>generate</code> function. The output is expected to be a tensor of shape <code>(batch_size, sequence_length)</code>
or <code>(sequence_length,)</code>.`,name:"generated_outputs"},{anchor:"transformers.Qwen2_5_VLProcessor.post_process_image_text_to_text.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to remove special tokens in the output. Argument passed to the tokenizer&#x2019;s <code>batch_decode</code> method.`,name:"skip_special_tokens"},{anchor:"transformers.Qwen2_5_VLProcessor.post_process_image_text_to_text.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clean up the tokenization spaces. Argument passed to the tokenizer&#x2019;s <code>batch_decode</code> method.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Qwen2_5_VLProcessor.post_process_image_text_to_text.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional arguments to be passed to the tokenizer&#x2019;s <code>batch_decode method</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/processing_qwen2_5_vl.py#L210",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The decoded text.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[str]</code></p>
`}}),Qe=new re({props:{title:"Qwen2_5_VLTextModel",local:"transformers.Qwen2_5_VLTextModel",headingTag:"h2"}}),Ve=new k({props:{name:"class transformers.Qwen2_5_VLTextModel",anchor:"transformers.Qwen2_5_VLTextModel",parameters:[{name:"config",val:": Qwen2_5_VLTextConfig"}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLTextConfig">Qwen2_5_VLTextConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1082"}}),xe=new k({props:{name:"forward",anchor:"transformers.Qwen2_5_VLTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Qwen2_5_VLTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Qwen2_5_VLTextModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Qwen2_5_VLTextModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Qwen2_5_VLTextModel.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.Qwen2_5_VLTextModel.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.Qwen2_5_VLTextModel.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.Qwen2_5_VLTextModel.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.Qwen2_5_VLTextModel.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.Qwen2_5_VLTextModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1109",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> 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/qwen2_5_vl#transformers.Qwen2_5_VLConfig"
>Qwen2_5_VLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</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>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</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>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),te=new Nt({props:{$$slots:{default:[ho]},$$scope:{ctx:J}}}),ke=new re({props:{title:"Qwen2_5_VLModel",local:"transformers.Qwen2_5_VLModel",headingTag:"h2"}}),ze=new k({props:{name:"class transformers.Qwen2_5_VLModel",anchor:"transformers.Qwen2_5_VLModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLModel">Qwen2_5_VLModel</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1382"}}),Be=new k({props:{name:"forward",anchor:"transformers.Qwen2_5_VLModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"pixel_values_videos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_grid_thw",val:": typing.Optional[torch.LongTensor] = None"},{name:"video_grid_thw",val:": typing.Optional[torch.LongTensor] = None"},{name:"rope_deltas",val:": typing.Optional[torch.LongTensor] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"second_per_grid_ts",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLModel.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.</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.Qwen2_5_VLModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Qwen2_5_VLModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Qwen2_5_VLModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Qwen2_5_VLModel.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.Qwen2_5_VLModel.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.Qwen2_5_VLModel.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.Qwen2_5_VLModel.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.Qwen2_5_VLModel.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.Qwen2_5_VLModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Qwen2_5_VLModel.forward.pixel_values_videos",description:"<strong>pixel_values_videos</strong> (<code>torch.FloatTensor</code> of shape <code>(seq_length, num_channels * temporal_size * image_size * image_size)) -- The tensors corresponding to the input videos. Pixel values can be obtained using [AutoImageProcessor](/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor). See </code>Qwen2_5_VLImageProcessor.<strong>call</strong><code>for details. [Qwen2_5_VLProcessor](/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLProcessor) uses</code>Qwen2_5_VLImageProcessor` for processing videos.",name:"pixel_values_videos"},{anchor:"transformers.Qwen2_5_VLModel.forward.image_grid_thw",description:`<strong>image_grid_thw</strong> (<code>torch.LongTensor</code> of shape <code>(num_images, 3)</code>, <em>optional</em>) &#x2014;
The temporal, height and width of feature shape of each image in LLM.`,name:"image_grid_thw"},{anchor:"transformers.Qwen2_5_VLModel.forward.video_grid_thw",description:`<strong>video_grid_thw</strong> (<code>torch.LongTensor</code> of shape <code>(num_videos, 3)</code>, <em>optional</em>) &#x2014;
The temporal, height and width of feature shape of each video in LLM.`,name:"video_grid_thw"},{anchor:"transformers.Qwen2_5_VLModel.forward.rope_deltas",description:`<strong>rope_deltas</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>) &#x2014;
The rope index difference between sequence length and multimodal rope.`,name:"rope_deltas"},{anchor:"transformers.Qwen2_5_VLModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.Qwen2_5_VLModel.forward.second_per_grid_ts",description:`<strong>second_per_grid_ts</strong> (<code>torch.Tensor</code> of shape <code>(num_videos)</code>, <em>optional</em>) &#x2014;
The time interval (in seconds) for each grid along the temporal dimension in the 3D position IDs.`,name:"second_per_grid_ts"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1586",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.qwen2_5_vl.modeling_qwen2_5_vl.Qwen2_5_VLModelOutputWithPast</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/qwen2_5_vl#transformers.Qwen2_5_VLConfig"
>Qwen2_5_VLConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</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>rope_deltas</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>) — The rope index difference between sequence length and multimodal rope.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.qwen2_5_vl.modeling_qwen2_5_vl.Qwen2_5_VLModelOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new Nt({props:{$$slots:{default:[uo]},$$scope:{ctx:J}}}),$e=new re({props:{title:"Qwen2_5_VLForConditionalGeneration",local:"transformers.Qwen2_5_VLForConditionalGeneration",headingTag:"h2"}}),Ze=new k({props:{name:"class transformers.Qwen2_5_VLForConditionalGeneration",anchor:"transformers.Qwen2_5_VLForConditionalGeneration",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1761"}}),Le=new k({props:{name:"forward",anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"pixel_values",val:": typing.Optional[torch.Tensor] = None"},{name:"pixel_values_videos",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_grid_thw",val:": typing.Optional[torch.LongTensor] = None"},{name:"video_grid_thw",val:": typing.Optional[torch.LongTensor] = None"},{name:"rope_deltas",val:": typing.Optional[torch.LongTensor] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"second_per_grid_ts",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.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.</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.Qwen2_5_VLForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.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.Qwen2_5_VLForConditionalGeneration.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -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:"labels"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.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.Qwen2_5_VLForConditionalGeneration.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.Qwen2_5_VLForConditionalGeneration.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.Qwen2_5_VLForConditionalGeneration.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.Qwen2_5_VLForConditionalGeneration.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.pixel_values_videos",description:"<strong>pixel_values_videos</strong> (<code>torch.FloatTensor</code> of shape <code>(seq_length, num_channels * temporal_size * image_size * image_size)) -- The tensors corresponding to the input videos. Pixel values can be obtained using [AutoImageProcessor](/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor). See </code>Qwen2_5_VLImageProcessor.<strong>call</strong><code>for details. [Qwen2_5_VLProcessor](/docs/transformers/main/en/model_doc/qwen2_5_vl#transformers.Qwen2_5_VLProcessor) uses</code>Qwen2_5_VLImageProcessor` for processing videos.",name:"pixel_values_videos"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.image_grid_thw",description:`<strong>image_grid_thw</strong> (<code>torch.LongTensor</code> of shape <code>(num_images, 3)</code>, <em>optional</em>) &#x2014;
The temporal, height and width of feature shape of each image in LLM.`,name:"image_grid_thw"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.video_grid_thw",description:`<strong>video_grid_thw</strong> (<code>torch.LongTensor</code> of shape <code>(num_videos, 3)</code>, <em>optional</em>) &#x2014;
The temporal, height and width of feature shape of each video in LLM.`,name:"video_grid_thw"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.rope_deltas",description:`<strong>rope_deltas</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>) &#x2014;
The rope index difference between sequence length and multimodal rope.`,name:"rope_deltas"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.second_per_grid_ts",description:`<strong>second_per_grid_ts</strong> (<code>torch.Tensor</code> of shape <code>(num_videos)</code>, <em>optional</em>) &#x2014;
The time interval (in seconds) for each grid along the temporal dimension in the 3D position IDs.`,name:"second_per_grid_ts"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py#L1802",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.qwen2_5_vl.modeling_qwen2_5_vl.Qwen2_5_VLCausalLMOutputWithPast</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/qwen2_5_vl#transformers.Qwen2_5_VLConfig"
>Qwen2_5_VLConfig</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>rope_deltas</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>) — The rope index difference between sequence length and multimodal rope.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.qwen2_5_vl.modeling_qwen2_5_vl.Qwen2_5_VLCausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new Nt({props:{$$slots:{default:[_o]},$$scope:{ctx:J}}}),se=new Un({props:{anchor:"transformers.Qwen2_5_VLForConditionalGeneration.forward.example",$$slots:{default:[go]},$$scope:{ctx:J}}}),We=new ao({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/qwen2_5_vl.md"}}),{c(){t=i("meta"),p=r(),n=i("p"),M=r(),w=i("div"),w.innerHTML=y,z=r(),m(W.$$.fragment),mt=r(),le=i("p"),le.innerHTML=In,ht=r(),ie=i("p"),ie.innerHTML=vn,ut=r(),m(S.$$.fragment),_t=r(),de=i("p"),de.innerHTML=jn,gt=r(),m(Y.$$.fragment),ft=r(),ce=i("p"),ce.innerHTML=Cn,wt=r(),pe=i("p"),pe.innerHTML=Qn,Mt=r(),m(me.$$.fragment),Tt=r(),m(he.$$.fragment),yt=r(),q=i("ul"),ue=i("li"),Fe=i("p"),Fe.innerHTML=Vn,Gt=r(),m(_e.$$.fragment),Ft=r(),ge=i("li"),Re=i("p"),Re.textContent=xn,Rt=r(),m(fe.$$.fragment),Xt=r(),B=i("li"),Xe=i("p"),Xe.innerHTML=kn,At=r(),m(we.$$.fragment),Et=r(),Ae=i("p"),Ae.textContent=zn,Ht=r(),m(Me.$$.fragment),Jt=r(),m(Te.$$.fragment),bt=r(),C=i("div"),m(ye.$$.fragment),St=r(),Ee=i("p"),Ee.innerHTML=Bn,Yt=r(),He=i("p"),He.innerHTML=$n,Pt=r(),m(P.$$.fragment),Ut=r(),m(Je.$$.fragment),It=r(),Q=i("div"),m(be.$$.fragment),Dt=r(),Se=i("p"),Se.innerHTML=Zn,Ot=r(),Ye=i("p"),Ye.innerHTML=Ln,Kt=r(),m(D.$$.fragment),vt=r(),m(Ue.$$.fragment),jt=r(),U=i("div"),m(Ie.$$.fragment),en=r(),Pe=i("p"),Pe.innerHTML=Wn,tn=r(),O=i("div"),m(ve.$$.fragment),nn=r(),De=i("p"),De.innerHTML=qn,on=r(),K=i("div"),m(je.$$.fragment),sn=r(),Oe=i("p"),Oe.innerHTML=Nn,an=r(),ee=i("div"),m(Ce.$$.fragment),rn=r(),Ke=i("p"),Ke.textContent=Gn,Ct=r(),m(Qe.$$.fragment),Qt=r(),I=i("div"),m(Ve.$$.fragment),ln=r(),et=i("p"),et.textContent=Fn,dn=r(),tt=i("p"),tt.innerHTML=Rn,cn=r(),nt=i("p"),nt.innerHTML=Xn,pn=r(),N=i("div"),m(xe.$$.fragment),mn=r(),ot=i("p"),ot.innerHTML=An,hn=r(),m(te.$$.fragment),Vt=r(),m(ke.$$.fragment),xt=r(),v=i("div"),m(ze.$$.fragment),un=r(),st=i("p"),st.textContent=En,_n=r(),at=i("p"),at.innerHTML=Hn,gn=r(),rt=i("p"),rt.innerHTML=Sn,fn=r(),G=i("div"),m(Be.$$.fragment),wn=r(),lt=i("p"),lt.innerHTML=Yn,Mn=r(),m(ne.$$.fragment),kt=r(),m($e.$$.fragment),zt=r(),A=i("div"),m(Ze.$$.fragment),Tn=r(),x=i("div"),m(Le.$$.fragment),yn=r(),it=i("p"),it.innerHTML=Pn,Jn=r(),m(oe.$$.fragment),bn=r(),m(se.$$.fragment),Bt=r(),m(We.$$.fragment),$t=r(),pt=i("p"),this.h()},l(e){const o=no("svelte-u9bgzb",document.head);t=d(o,"META",{name:!0,content:!0}),o.forEach(s),p=l(e),n=d(e,"P",{}),b(n).forEach(s),M=l(e),w=d(e,"DIV",{style:!0,"data-svelte-h":!0}),T(w)!=="svelte-1r0lour"&&(w.innerHTML=y),z=l(e),h(W.$$.fragment,e),mt=l(e),le=d(e,"P",{"data-svelte-h":!0}),T(le)!=="svelte-1u52npc"&&(le.innerHTML=In),ht=l(e),ie=d(e,"P",{"data-svelte-h":!0}),T(ie)!=="svelte-1n14jka"&&(ie.innerHTML=vn),ut=l(e),h(S.$$.fragment,e),_t=l(e),de=d(e,"P",{"data-svelte-h":!0}),T(de)!=="svelte-25ere2"&&(de.innerHTML=jn),gt=l(e),h(Y.$$.fragment,e),ft=l(e),ce=d(e,"P",{"data-svelte-h":!0}),T(ce)!=="svelte-nf5ooi"&&(ce.innerHTML=Cn),wt=l(e),pe=d(e,"P",{"data-svelte-h":!0}),T(pe)!=="svelte-w36i1c"&&(pe.innerHTML=Qn),Mt=l(e),h(me.$$.fragment,e),Tt=l(e),h(he.$$.fragment,e),yt=l(e),q=d(e,"UL",{});var E=b(q);ue=d(E,"LI",{});var qe=b(ue);Fe=d(qe,"P",{"data-svelte-h":!0}),T(Fe)!=="svelte-12lc62g"&&(Fe.innerHTML=Vn),Gt=l(qe),h(_e.$$.fragment,qe),qe.forEach(s),Ft=l(E),ge=d(E,"LI",{});var Ne=b(ge);Re=d(Ne,"P",{"data-svelte-h":!0}),T(Re)!=="svelte-1tcjnsv"&&(Re.textContent=xn),Rt=l(Ne),h(fe.$$.fragment,Ne),Ne.forEach(s),Xt=l(E),B=d(E,"LI",{});var $=b(B);Xe=d($,"P",{"data-svelte-h":!0}),T(Xe)!=="svelte-1gyxcpw"&&(Xe.innerHTML=kn),At=l($),h(we.$$.fragment,$),Et=l($),Ae=d($,"P",{"data-svelte-h":!0}),T(Ae)!=="svelte-dp8v49"&&(Ae.textContent=zn),Ht=l($),h(Me.$$.fragment,$),$.forEach(s),E.forEach(s),Jt=l(e),h(Te.$$.fragment,e),bt=l(e),C=d(e,"DIV",{class:!0});var Z=b(C);h(ye.$$.fragment,Z),St=l(Z),Ee=d(Z,"P",{"data-svelte-h":!0}),T(Ee)!=="svelte-1w0nr0c"&&(Ee.innerHTML=Bn),Yt=l(Z),He=d(Z,"P",{"data-svelte-h":!0}),T(He)!=="svelte-o55m63"&&(He.innerHTML=$n),Pt=l(Z),h(P.$$.fragment,Z),Z.forEach(s),Ut=l(e),h(Je.$$.fragment,e),It=l(e),Q=d(e,"DIV",{class:!0});var L=b(Q);h(be.$$.fragment,L),Dt=l(L),Se=d(L,"P",{"data-svelte-h":!0}),T(Se)!=="svelte-c4akxs"&&(Se.innerHTML=Zn),Ot=l(L),Ye=d(L,"P",{"data-svelte-h":!0}),T(Ye)!=="svelte-o55m63"&&(Ye.innerHTML=Ln),Kt=l(L),h(D.$$.fragment,L),L.forEach(s),vt=l(e),h(Ue.$$.fragment,e),jt=l(e),U=d(e,"DIV",{class:!0});var V=b(U);h(Ie.$$.fragment,V),en=l(V),Pe=d(V,"P",{"data-svelte-h":!0}),T(Pe)!=="svelte-7vosvd"&&(Pe.innerHTML=Wn),tn=l(V),O=d(V,"DIV",{class:!0});var Ge=b(O);h(ve.$$.fragment,Ge),nn=l(Ge),De=d(Ge,"P",{"data-svelte-h":!0}),T(De)!=="svelte-1h49hic"&&(De.innerHTML=qn),Ge.forEach(s),on=l(V),K=d(V,"DIV",{class:!0});var Lt=b(K);h(je.$$.fragment,Lt),sn=l(Lt),Oe=d(Lt,"P",{"data-svelte-h":!0}),T(Oe)!=="svelte-46ufki"&&(Oe.innerHTML=Nn),Lt.forEach(s),an=l(V),ee=d(V,"DIV",{class:!0});var Wt=b(ee);h(Ce.$$.fragment,Wt),rn=l(Wt),Ke=d(Wt,"P",{"data-svelte-h":!0}),T(Ke)!=="svelte-z5vbkk"&&(Ke.textContent=Gn),Wt.forEach(s),V.forEach(s),Ct=l(e),h(Qe.$$.fragment,e),Qt=l(e),I=d(e,"DIV",{class:!0});var F=b(I);h(Ve.$$.fragment,F),ln=l(F),et=d(F,"P",{"data-svelte-h":!0}),T(et)!=="svelte-x9qjd5"&&(et.textContent=Fn),dn=l(F),tt=d(F,"P",{"data-svelte-h":!0}),T(tt)!=="svelte-6pahdo"&&(tt.innerHTML=Rn),cn=l(F),nt=d(F,"P",{"data-svelte-h":!0}),T(nt)!=="svelte-hswkmf"&&(nt.innerHTML=Xn),pn=l(F),N=d(F,"DIV",{class:!0});var dt=b(N);h(xe.$$.fragment,dt),mn=l(dt),ot=d(dt,"P",{"data-svelte-h":!0}),T(ot)!=="svelte-12jq561"&&(ot.innerHTML=An),hn=l(dt),h(te.$$.fragment,dt),dt.forEach(s),F.forEach(s),Vt=l(e),h(ke.$$.fragment,e),xt=l(e),v=d(e,"DIV",{class:!0});var R=b(v);h(ze.$$.fragment,R),un=l(R),st=d(R,"P",{"data-svelte-h":!0}),T(st)!=="svelte-ctarxu"&&(st.textContent=En),_n=l(R),at=d(R,"P",{"data-svelte-h":!0}),T(at)!=="svelte-6pahdo"&&(at.innerHTML=Hn),gn=l(R),rt=d(R,"P",{"data-svelte-h":!0}),T(rt)!=="svelte-hswkmf"&&(rt.innerHTML=Sn),fn=l(R),G=d(R,"DIV",{class:!0});var ct=b(G);h(Be.$$.fragment,ct),wn=l(ct),lt=d(ct,"P",{"data-svelte-h":!0}),T(lt)!=="svelte-1f6md11"&&(lt.innerHTML=Yn),Mn=l(ct),h(ne.$$.fragment,ct),ct.forEach(s),R.forEach(s),kt=l(e),h($e.$$.fragment,e),zt=l(e),A=d(e,"DIV",{class:!0});var qt=b(A);h(Ze.$$.fragment,qt),Tn=l(qt),x=d(qt,"DIV",{class:!0});var ae=b(x);h(Le.$$.fragment,ae),yn=l(ae),it=d(ae,"P",{"data-svelte-h":!0}),T(it)!=="svelte-1uxus5f"&&(it.innerHTML=Pn),Jn=l(ae),h(oe.$$.fragment,ae),bn=l(ae),h(se.$$.fragment,ae),ae.forEach(s),qt.forEach(s),Bt=l(e),h(We.$$.fragment,e),$t=l(e),pt=d(e,"P",{}),b(pt).forEach(s),this.h()},h(){j(t,"name","hf:doc:metadata"),j(t,"content",wo),oo(w,"float","right"),j(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){a(document.head,t),c(e,p,o),c(e,n,o),c(e,M,o),c(e,w,o),c(e,z,o),u(W,e,o),c(e,mt,o),c(e,le,o),c(e,ht,o),c(e,ie,o),c(e,ut,o),u(S,e,o),c(e,_t,o),c(e,de,o),c(e,gt,o),u(Y,e,o),c(e,ft,o),c(e,ce,o),c(e,wt,o),c(e,pe,o),c(e,Mt,o),u(me,e,o),c(e,Tt,o),u(he,e,o),c(e,yt,o),c(e,q,o),a(q,ue),a(ue,Fe),a(ue,Gt),u(_e,ue,null),a(q,Ft),a(q,ge),a(ge,Re),a(ge,Rt),u(fe,ge,null),a(q,Xt),a(q,B),a(B,Xe),a(B,At),u(we,B,null),a(B,Et),a(B,Ae),a(B,Ht),u(Me,B,null),c(e,Jt,o),u(Te,e,o),c(e,bt,o),c(e,C,o),u(ye,C,null),a(C,St),a(C,Ee),a(C,Yt),a(C,He),a(C,Pt),u(P,C,null),c(e,Ut,o),u(Je,e,o),c(e,It,o),c(e,Q,o),u(be,Q,null),a(Q,Dt),a(Q,Se),a(Q,Ot),a(Q,Ye),a(Q,Kt),u(D,Q,null),c(e,vt,o),u(Ue,e,o),c(e,jt,o),c(e,U,o),u(Ie,U,null),a(U,en),a(U,Pe),a(U,tn),a(U,O),u(ve,O,null),a(O,nn),a(O,De),a(U,on),a(U,K),u(je,K,null),a(K,sn),a(K,Oe),a(U,an),a(U,ee),u(Ce,ee,null),a(ee,rn),a(ee,Ke),c(e,Ct,o),u(Qe,e,o),c(e,Qt,o),c(e,I,o),u(Ve,I,null),a(I,ln),a(I,et),a(I,dn),a(I,tt),a(I,cn),a(I,nt),a(I,pn),a(I,N),u(xe,N,null),a(N,mn),a(N,ot),a(N,hn),u(te,N,null),c(e,Vt,o),u(ke,e,o),c(e,xt,o),c(e,v,o),u(ze,v,null),a(v,un),a(v,st),a(v,_n),a(v,at),a(v,gn),a(v,rt),a(v,fn),a(v,G),u(Be,G,null),a(G,wn),a(G,lt),a(G,Mn),u(ne,G,null),c(e,kt,o),u($e,e,o),c(e,zt,o),c(e,A,o),u(Ze,A,null),a(A,Tn),a(A,x),u(Le,x,null),a(x,yn),a(x,it),a(x,Jn),u(oe,x,null),a(x,bn),u(se,x,null),c(e,Bt,o),u(We,e,o),c(e,$t,o),c(e,pt,o),Zt=!0},p(e,[o]){const E={};o&2&&(E.$$scope={dirty:o,ctx:e}),S.$set(E);const qe={};o&2&&(qe.$$scope={dirty:o,ctx:e}),Y.$set(qe);const Ne={};o&2&&(Ne.$$scope={dirty:o,ctx:e}),P.$set(Ne);const $={};o&2&&($.$$scope={dirty:o,ctx:e}),D.$set($);const Z={};o&2&&(Z.$$scope={dirty:o,ctx:e}),te.$set(Z);const L={};o&2&&(L.$$scope={dirty:o,ctx:e}),ne.$set(L);const V={};o&2&&(V.$$scope={dirty:o,ctx:e}),oe.$set(V);const Ge={};o&2&&(Ge.$$scope={dirty:o,ctx:e}),se.$set(Ge)},i(e){Zt||(_(W.$$.fragment,e),_(S.$$.fragment,e),_(Y.$$.fragment,e),_(me.$$.fragment,e),_(he.$$.fragment,e),_(_e.$$.fragment,e),_(fe.$$.fragment,e),_(we.$$.fragment,e),_(Me.$$.fragment,e),_(Te.$$.fragment,e),_(ye.$$.fragment,e),_(P.$$.fragment,e),_(Je.$$.fragment,e),_(be.$$.fragment,e),_(D.$$.fragment,e),_(Ue.$$.fragment,e),_(Ie.$$.fragment,e),_(ve.$$.fragment,e),_(je.$$.fragment,e),_(Ce.$$.fragment,e),_(Qe.$$.fragment,e),_(Ve.$$.fragment,e),_(xe.$$.fragment,e),_(te.$$.fragment,e),_(ke.$$.fragment,e),_(ze.$$.fragment,e),_(Be.$$.fragment,e),_(ne.$$.fragment,e),_($e.$$.fragment,e),_(Ze.$$.fragment,e),_(Le.$$.fragment,e),_(oe.$$.fragment,e),_(se.$$.fragment,e),_(We.$$.fragment,e),Zt=!0)},o(e){g(W.$$.fragment,e),g(S.$$.fragment,e),g(Y.$$.fragment,e),g(me.$$.fragment,e),g(he.$$.fragment,e),g(_e.$$.fragment,e),g(fe.$$.fragment,e),g(we.$$.fragment,e),g(Me.$$.fragment,e),g(Te.$$.fragment,e),g(ye.$$.fragment,e),g(P.$$.fragment,e),g(Je.$$.fragment,e),g(be.$$.fragment,e),g(D.$$.fragment,e),g(Ue.$$.fragment,e),g(Ie.$$.fragment,e),g(ve.$$.fragment,e),g(je.$$.fragment,e),g(Ce.$$.fragment,e),g(Qe.$$.fragment,e),g(Ve.$$.fragment,e),g(xe.$$.fragment,e),g(te.$$.fragment,e),g(ke.$$.fragment,e),g(ze.$$.fragment,e),g(Be.$$.fragment,e),g(ne.$$.fragment,e),g($e.$$.fragment,e),g(Ze.$$.fragment,e),g(Le.$$.fragment,e),g(oe.$$.fragment,e),g(se.$$.fragment,e),g(We.$$.fragment,e),Zt=!1},d(e){e&&(s(p),s(n),s(M),s(w),s(z),s(mt),s(le),s(ht),s(ie),s(ut),s(_t),s(de),s(gt),s(ft),s(ce),s(wt),s(pe),s(Mt),s(Tt),s(yt),s(q),s(Jt),s(bt),s(C),s(Ut),s(It),s(Q),s(vt),s(jt),s(U),s(Ct),s(Qt),s(I),s(Vt),s(xt),s(v),s(kt),s(zt),s(A),s(Bt),s($t),s(pt)),s(t),f(W,e),f(S,e),f(Y,e),f(me,e),f(he,e),f(_e),f(fe),f(we),f(Me),f(Te,e),f(ye),f(P),f(Je,e),f(be),f(D),f(Ue,e),f(Ie),f(ve),f(je),f(Ce),f(Qe,e),f(Ve),f(xe),f(te),f(ke,e),f(ze),f(Be),f(ne),f($e,e),f(Ze),f(Le),f(oe),f(se),f(We,e)}}}const wo='{"title":"Qwen2.5-VL","local":"qwen25-vl","sections":[{"title":"Notes","local":"notes","sections":[],"depth":3},{"title":"Qwen2_5_VLConfig","local":"transformers.Qwen2_5_VLConfig","sections":[],"depth":2},{"title":"Qwen2_5_VLTextConfig","local":"transformers.Qwen2_5_VLTextConfig","sections":[],"depth":2},{"title":"Qwen2_5_VLProcessor","local":"transformers.Qwen2_5_VLProcessor","sections":[],"depth":2},{"title":"Qwen2_5_VLTextModel","local":"transformers.Qwen2_5_VLTextModel","sections":[],"depth":2},{"title":"Qwen2_5_VLModel","local":"transformers.Qwen2_5_VLModel","sections":[],"depth":2},{"title":"Qwen2_5_VLForConditionalGeneration","local":"transformers.Qwen2_5_VLForConditionalGeneration","sections":[],"depth":2}],"depth":1}';function Mo(J){return Kn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Qo extends eo{constructor(t){super(),to(this,t,Mo,fo,On,{})}}export{Qo as component};
