import{s as il,o as Ml,n as ps}from"../chunks/scheduler.18a86fab.js";import{S as rl,i as cl,g as m,s as o,r as j,A as yl,h as J,f as e,c as i,j as nl,u,x as d,k as pl,y as ml,a as t,v as w,d as I,t as f,w as g}from"../chunks/index.98837b22.js";import{T as ol}from"../chunks/Tip.77304350.js";import{C as b}from"../chunks/CodeBlock.8d0c2e8a.js";import{H as ns}from"../chunks/Heading.7e7e0c5b.js";import{H as Jl,a as ks}from"../chunks/HfOption.6641485e.js";import{E as Tl}from"../chunks/index.92f616ba.js";function dl(C){let a,U='The <a href="/docs/transformers/main/en/main_classes/pipelines#transformers.ImageTextToTextPipeline">ImageTextToTextPipeline</a> accepts chats in the OpenAI format to make inference easier and more accessible.';return{c(){a=m("p"),a.innerHTML=U},l(M){a=J(M,"P",{"data-svelte-h":!0}),d(a)!=="svelte-18ohruh"&&(a.innerHTML=U)},m(M,r){t(M,a,r)},p:ps,d(M){M&&e(a)}}}function Ul(C){let a,U="Loading a video from <code>&quot;url&quot;</code> is only supported by the PyAV or Decord backends.";return{c(){a=m("p"),a.innerHTML=U},l(M){a=J(M,"P",{"data-svelte-h":!0}),d(a)!=="svelte-1ddif0x"&&(a.innerHTML=U)},m(M,r){t(M,a,r)},p:ps,d(M){M&&e(a)}}}function hl(C){let a,U="The <code>num_frames</code> parameter controls how many frames to uniformly sample from the video. Each checkpoint has a maximum frame count it was pretrained with and exceeding this count can significantly lower generation quality. It’s important to choose a frame count that fits both the model capacity and your hardware resources. If <code>num_frames</code> isn’t specified, the entire video is loaded without any frame sampling.",M,r,y,c,n='These inputs are now ready to be used in <a href="/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate">generate()</a>.',T;return r=new b({props:{code:"cHJvY2Vzc2VkX2NoYXQlMjAlM0QlMjBwcm9jZXNzb3IuYXBwbHlfY2hhdF90ZW1wbGF0ZSglMEElMjAlMjAlMjAlMjBtZXNzYWdlcyUyQyUwQSUyMCUyMCUyMCUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2ZyYW1lcyUzRDMyJTJDJTBBJTIwJTIwJTIwJTIwdmlkZW9fbG9hZF9iYWNrZW5kJTNEJTIyZGVjb3JkJTIyJTJDJTBBKSUwQXByaW50KHByb2Nlc3NlZF9jaGF0LmtleXMoKSk=",highlighted:`processed_chat = 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>,
    num_frames=<span class="hljs-number">32</span>,
    video_load_backend=<span class="hljs-string">&quot;decord&quot;</span>,
)
<span class="hljs-built_in">print</span>(processed_chat.keys())`,wrap:!1}}),{c(){a=m("p"),a.innerHTML=U,M=o(),j(r.$$.fragment),y=o(),c=m("p"),c.innerHTML=n},l(p){a=J(p,"P",{"data-svelte-h":!0}),d(a)!=="svelte-1ilhsfw"&&(a.innerHTML=U),M=i(p),u(r.$$.fragment,p),y=i(p),c=J(p,"P",{"data-svelte-h":!0}),d(c)!=="svelte-uo4xlo"&&(c.innerHTML=n)},m(p,h){t(p,a,h),t(p,M,h),w(r,p,h),t(p,y,h),t(p,c,h),T=!0},p:ps,i(p){T||(I(r.$$.fragment,p),T=!0)},o(p){f(r.$$.fragment,p),T=!1},d(p){p&&(e(a),e(M),e(y),e(c)),g(r,p)}}}function jl(C){let a,U="For longer videos, it may be better to sample more frames for better representation with the <code>video_fps</code> parameter. This determines how many frames per second to extract. As an example, if a video is 10 seconds long and <code>video_fps=2</code>, then the model samples 20 frames. In other words, 2 frames are uniformly sampled every 10 seconds.",M,r,y;return r=new b({props:{code:"cHJvY2Vzc2VkX2NoYXQlMjAlM0QlMjBwcm9jZXNzb3IuYXBwbHlfY2hhdF90ZW1wbGF0ZSglMEElMjAlMjAlMjAlMjBtZXNzYWdlcyUyQyUwQSUyMCUyMCUyMCUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB2aWRlb19mcHMlM0QzMiUyQyUwQSUyMCUyMCUyMCUyMHZpZGVvX2xvYWRfYmFja2VuZCUzRCUyMmRlY29yZCUyMiUyQyUwQSklMEFwcmludChwcm9jZXNzZWRfY2hhdC5rZXlzKCkp",highlighted:`processed_chat = 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>,
    video_fps=<span class="hljs-number">32</span>,
    video_load_backend=<span class="hljs-string">&quot;decord&quot;</span>,
)
<span class="hljs-built_in">print</span>(processed_chat.keys())`,wrap:!1}}),{c(){a=m("p"),a.innerHTML=U,M=o(),j(r.$$.fragment)},l(c){a=J(c,"P",{"data-svelte-h":!0}),d(a)!=="svelte-xuidqz"&&(a.innerHTML=U),M=i(c),u(r.$$.fragment,c)},m(c,n){t(c,a,n),t(c,M,n),w(r,c,n),y=!0},p:ps,i(c){y||(I(r.$$.fragment,c),y=!0)},o(c){f(r.$$.fragment,c),y=!1},d(c){c&&(e(a),e(M)),g(r,c)}}}function ul(C){let a,U="Videos may also exist as a set of sampled frames stored as images rather than the full video file.",M,r,y="In this case, pass a list of image file paths and the processor automatically concatenates them into a video. Make sure all images are the same size since they are assumed to be from the same video.",c,n,T;return n=new b({props:{code:"ZnJhbWVzX3BhdGhzJTIwJTNEJTIwJTVCJTIyJTJGcGF0aCUyRnRvJTJGZnJhbWUwLnBuZyUyMi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BJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTVEJTBBJTBBcHJvY2Vzc2VkX2NoYXQlMjAlM0QlMjBwcm9jZXNzb3IuYXBwbHlfY2hhdF90ZW1wbGF0ZSglMEElMjAlMjAlMjAlMjBtZXNzYWdlcyUyQyUwQSUyMCUyMCUyMCUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzRFRydWUlMkMlMEEpJTBBcHJpbnQocHJvY2Vzc2VkX2NoYXQua2V5cygpKQ==",highlighted:`frames_paths = [<span class="hljs-string">&quot;/path/to/frame0.png&quot;</span>, <span class="hljs-string">&quot;/path/to/frame5.png&quot;</span>, <span class="hljs-string">&quot;/path/to/frame10.png&quot;</span>]
messages = [
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&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;You are a friendly chatbot who always responds in the style of a pirate&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;video&quot;</span>, <span class="hljs-string">&quot;path&quot;</span>: frames_paths},
            {<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 do you see in this video?&quot;</span>},
        ],
    },
]

processed_chat = 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>,
)
<span class="hljs-built_in">print</span>(processed_chat.keys())`,wrap:!1}}),{c(){a=m("p"),a.textContent=U,M=o(),r=m("p"),r.textContent=y,c=o(),j(n.$$.fragment)},l(p){a=J(p,"P",{"data-svelte-h":!0}),d(a)!=="svelte-o026q6"&&(a.textContent=U),M=i(p),r=J(p,"P",{"data-svelte-h":!0}),d(r)!=="svelte-l4ijxy"&&(r.textContent=y),c=i(p),u(n.$$.fragment,p)},m(p,h){t(p,a,h),t(p,M,h),t(p,r,h),t(p,c,h),w(n,p,h),T=!0},p:ps,i(p){T||(I(n.$$.fragment,p),T=!0)},o(p){f(n.$$.fragment,p),T=!1},d(p){p&&(e(a),e(M),e(r),e(c)),g(n,p)}}}function wl(C){let a,U,M,r,y,c;return a=new ks({props:{id:"sampling",option:"fixed number of frames",$$slots:{default:[hl]},$$scope:{ctx:C}}}),M=new ks({props:{id:"sampling",option:"fps",$$slots:{default:[jl]},$$scope:{ctx:C}}}),y=new ks({props:{id:"sampling",option:"list of image frames",$$slots:{default:[ul]},$$scope:{ctx:C}}}),{c(){j(a.$$.fragment),U=o(),j(M.$$.fragment),r=o(),j(y.$$.fragment)},l(n){u(a.$$.fragment,n),U=i(n),u(M.$$.fragment,n),r=i(n),u(y.$$.fragment,n)},m(n,T){w(a,n,T),t(n,U,T),w(M,n,T),t(n,r,T),w(y,n,T),c=!0},p(n,T){const p={};T&2&&(p.$$scope={dirty:T,ctx:n}),a.$set(p);const h={};T&2&&(h.$$scope={dirty:T,ctx:n}),M.$set(h);const ts={};T&2&&(ts.$$scope={dirty:T,ctx:n}),y.$set(ts)},i(n){c||(I(a.$$.fragment,n),I(M.$$.fragment,n),I(y.$$.fragment,n),c=!0)},o(n){f(a.$$.fragment,n),f(M.$$.fragment,n),f(y.$$.fragment,n),c=!1},d(n){n&&(e(U),e(r)),g(a,n),g(M,n),g(y,n)}}}function Il(C){let a,U,M,r,y,c,n,T='Multimodal model chat templates expect a similar <a href="./chat_templating">template</a> as text-only models. It needs <code>messages</code> that includes a dictionary of the <code>role</code> and <code>content</code>.',p,h,ts='Multimodal templates are included in the <a href="./processors">Processor</a> class and require an additional <code>type</code> key for specifying whether the included content is an image, video, or text.',os,B,Xs="This guide will show you how to format chat templates for multimodal models as well as some best practices for configuring the template",is,v,Ms,q,Rs='<a href="/docs/transformers/main/en/main_classes/pipelines#transformers.ImageTextToTextPipeline">ImageTextToTextPipeline</a> is a high-level image and text generation class with a “chat mode”. Chat mode is enabled when a conversational model is detected and the chat prompt is <a href="./llm_tutorial#wrong-prompt-format">properly formatted</a>.',rs,G,Vs="Start by building a chat history with the following two roles.",cs,Q,Ws="<li><code>system</code> describes how the model should behave and respond when you’re chatting with it. This role isn’t supported by all chat models.</li> <li><code>user</code> is where you enter your first message to the model.</li>",ys,A,ms,N,zs='Create a <a href="/docs/transformers/main/en/main_classes/pipelines#transformers.ImageTextToTextPipeline">ImageTextToTextPipeline</a> and pass the chat to it. For large models, setting <a href="./models#big-model-inference">device_map=“auto”</a> helps load the model quicker and automatically places it on the fastest device available. Changing the data type to <a href="./models#model-data-type">torch.bfloat16</a> also helps save memory.',Js,x,Ts,_,ds,E,Us,k,Ss='For multimodal models that accept images like <a href="./model_doc/llava">LLaVA</a>, include the following in <code>content</code> as shown below.',hs,X,Ys="<li>The content <code>&quot;type&quot;</code> can be an <code>&quot;image&quot;</code> or <code>&quot;text&quot;</code>.</li> <li>For images, it can be a link to the image (<code>&quot;url&quot;</code>), a file path (<code>&quot;path&quot;</code>), or <code>&quot;base64&quot;</code>. Images are automatically loaded, processed, and prepared into pixel values as inputs to the model.</li>",js,R,us,V,Hs='Pass <code>messages</code> to <a href="/docs/transformers/main/en/main_classes/processors#transformers.ProcessorMixin.apply_chat_template">apply_chat_template()</a> to tokenize the input content and return the <code>input_ids</code> and <code>pixel_values</code>.',ws,W,Is,z,Fs='These inputs are now ready to be used in <a href="/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate">generate()</a>.',fs,S,gs,Y,Ls='Some vision models also support video inputs. The message format is very similar to the format for <a href="#image-inputs">image inputs</a>.',Cs,H,Ps='<li>The content <code>&quot;type&quot;</code> should be <code>&quot;video&quot;</code> to indicate the content is a video.</li> <li>For videos, it can be a link to the video (<code>&quot;url&quot;</code>) or it could be a file path (<code>&quot;path&quot;</code>). Videos loaded from a URL can only be decoded with <a href="https://pyav.basswood-io.com/docs/stable/" rel="nofollow">PyAV</a> or <a href="https://github.com/dmlc/decord" rel="nofollow">Decord</a>.</li>',bs,Z,xs,F,Zs,L,Ds='Pass <code>messages</code> to <a href="/docs/transformers/main/en/main_classes/processors#transformers.ProcessorMixin.apply_chat_template">apply_chat_template()</a> to tokenize the input content. There are a few extra parameters to include in <a href="/docs/transformers/main/en/main_classes/processors#transformers.ProcessorMixin.apply_chat_template">apply_chat_template()</a> that controls the sampling process.',$s,P,Ks='The <code>video_load_backend</code> parameter refers to a specific framework to load a video. It supports <a href="https://pyav.basswood-io.com/docs/stable/" rel="nofollow">PyAV</a>, <a href="https://github.com/dmlc/decord" rel="nofollow">Decord</a>, <a href="https://github.com/opencv/opencv" rel="nofollow">OpenCV</a>, and <a href="https://pytorch.org/vision/stable/index.html" rel="nofollow">torchvision</a>.',Bs,D,Os="The examples below use Decord as the backend because it is a bit faster than PyAV.",vs,$,qs,K,Gs,O,sl='You can create a custom chat template with <a href="https://jinja.palletsprojects.com/en/3.1.x/templates/" rel="nofollow">Jinja</a> and set it with <a href="/docs/transformers/main/en/main_classes/processors#transformers.ProcessorMixin.apply_chat_template">apply_chat_template()</a>. Refer to the <a href="./chat_templating_writing">Template writing</a> guide for more details.',Qs,ss,ll='For example, to enable a template to handle a <em>list of content</em> from multiple modalities while still supporting plain strings for text-only inference, specify how to handle the <code>content[&#39;type&#39;]</code> if it is an image or text as shown below in the Llama 3.2 Vision Instruct <a href="https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct/blob/main/chat_template.json" rel="nofollow">template</a>.',As,ls,Ns,es,_s,as,Es;return y=new ns({props:{title:"Multimodal templates",local:"multimodal-templates",headingTag:"h1"}}),v=new ns({props:{title:"ImageTextToTextPipeline",local:"imagetexttotextpipeline",headingTag:"h2"}}),A=new b({props:{code:"bWVzc2FnZXMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIyc3lzdGVtJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMllvdSUyMGFyZSUyMGElMjBmcmllbmRseSUyMGNoYXRib3QlMjB3aG8lMjBhbHdheXMlMjByZXNwb25kcyUyMGluJTIwdGhlJTIwc3R5bGUlMjBvZiUyMGElMjBwaXJhdGUlMjIlN0QlNUQlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIyaW1hZ2UlMjIlMkMlMjAlMjJ1cmwlMjIlM0ElMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyV2hhdCUyMGFyZSUyMHRoZXNlJTNGJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTVE",highlighted:`messages = [
    {
        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&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;You are a friendly chatbot who always responds in the style of a pirate&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;image&quot;</span>, <span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&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 are these?&quot;</span>},
        ],
    },
]`,wrap:!1}}),x=new ol({props:{warning:!1,$$slots:{default:[dl]},$$scope:{ctx:C}}}),_=new b({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwcGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMHBpcGVsaW5lKCUyMmltYWdlLXRleHQtdG8tdGV4dCUyMiUyQyUyMG1vZGVsJTNEJTIybGxhdmEtaGYlMkZsbGF2YS1vbmV2aXNpb24tcXdlbjItMC41Yi1vdi1oZiUyMiUyQyUyMGRldmljZSUzRCUyMmN1ZGElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZWxpb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mxhbmtldC4lMjBUaGUlMjBjYXQlMjBvbiUyMHRoZSUyMGxlZnQlMjBoYXMlMjBhJTIwc3RyaXBlZCUyMGNvYXQlMkMlMjB0eXBpY2FsJTIwb2YlMjB0YWJieSUyMGNhdHMlMkMlMjBhbmQlMjBpcyUyMGx5aW5nJTIwb24lMjBpdHMlMjBzaWRlJTIwd2l0aCUyMGl0cyUyMGhlYWQlMjByZXN0aW5nJTIwb24lMjB0aGUnJTdEJTVE",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

pipeline = pipeline(<span class="hljs-string">&quot;image-text-to-text&quot;</span>, model=<span class="hljs-string">&quot;llava-hf/llava-onevision-qwen2-0.5b-ov-hf&quot;</span>, device=<span class="hljs-string">&quot;cuda&quot;</span>, torch_dtype=torch.float16)
pipeline(text=messages, max_new_tokens=<span class="hljs-number">50</span>, return_full_text=<span class="hljs-literal">False</span>)
[{<span class="hljs-string">&#x27;input_text&#x27;</span>: [{<span class="hljs-string">&#x27;role&#x27;</span>: <span class="hljs-string">&#x27;system&#x27;</span>,
    <span class="hljs-string">&#x27;content&#x27;</span>: [{<span class="hljs-string">&#x27;type&#x27;</span>: <span class="hljs-string">&#x27;text&#x27;</span>,
      <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;You are a friendly chatbot who always responds in the style of a pirate&#x27;</span>}]},
   {<span class="hljs-string">&#x27;role&#x27;</span>: <span class="hljs-string">&#x27;user&#x27;</span>,
    <span class="hljs-string">&#x27;content&#x27;</span>: [{<span class="hljs-string">&#x27;type&#x27;</span>: <span class="hljs-string">&#x27;image&#x27;</span>,
      <span class="hljs-string">&#x27;url&#x27;</span>: <span class="hljs-string">&#x27;http://images.cocodataset.org/val2017/000000039769.jpg&#x27;</span>},
     {<span class="hljs-string">&#x27;type&#x27;</span>: <span class="hljs-string">&#x27;text&#x27;</span>, <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;What are these?&#x27;</span>}]}],
  <span class="hljs-string">&#x27;generated_text&#x27;</span>: <span class="hljs-string">&#x27;The image shows two cats lying on a pink surface, which appears to be a cushion or a soft blanket. The cat on the left has a striped coat, typical of tabby cats, and is lying on its side with its head resting on the&#x27;</span>}]`,wrap:!1}}),E=new ns({props:{title:"Image inputs",local:"image-inputs",headingTag:"h2"}}),R=new b({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBMbGF2YU9uZXZpc2lvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwTGxhdmFPbmV2aXNpb25Gb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmxsYXZhLWhmJTJGbGxhdmEtb25ldmlzaW9uLXF3ZW4yLTAuNWItb3YtaGYlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybGxhdmEtaGYlMkZsbGF2YS1vbmV2aXNpb24tcXdlbjItMC41Yi1vdi1oZiUyMiklMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJzeXN0ZW0lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyWW91JTIwYXJlJTIwYSUyMGZyaWVuZGx5JTIwY2hhdGJvdCUyMHdobyUyMGFsd2F5cyUyMHJlc3BvbmRzJTIwaW4lMjB0aGUlMjBzdHlsZSUyMG9mJTIwYSUyMHBpcmF0ZSUyMiU3RCU1RCUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiUyQyUyMCUyMnVybCUyMiUzQSUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIydGV4dCUyMiUyQyUyMCUyMnRleHQlMjIlM0ElMjAlMjJXaGF0JTIwYXJlJTIwdGhlc2UlM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElNUQ=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, LlavaOnevisionForConditionalGeneration

model = LlavaOnevisionForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;llava-hf/llava-onevision-qwen2-0.5b-ov-hf&quot;</span>)
processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;llava-hf/llava-onevision-qwen2-0.5b-ov-hf&quot;</span>)

messages = [
    {
      <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&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;You are a friendly chatbot who always responds in the style of a pirate&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;image&quot;</span>, <span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&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 are these?&quot;</span>},
        ],
    },
]`,wrap:!1}}),W=new b({props:{code:"cHJvY2Vzc2VkX2NoYXQlMjAlM0QlMjBwcm9jZXNzb3IuYXBwbHlfY2hhdF90ZW1wbGF0ZShtZXNzYWdlcyUyQyUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUlMkMlMjB0b2tlbml6ZSUzRFRydWUlMkMlMjByZXR1cm5fZGljdCUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXByaW50KHByb2Nlc3NlZF9jaGF0LmtleXMoKSk=",highlighted:`processed_chat = 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>)
<span class="hljs-built_in">print</span>(processed_chat.keys())`,wrap:!1}}),S=new ns({props:{title:"Video inputs",local:"video-inputs",headingTag:"h2"}}),Z=new ol({props:{warning:!0,$$slots:{default:[Ul]},$$scope:{ctx:C}}}),F=new b({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBMbGF2YU9uZXZpc2lvbkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybGxhdmEtaGYlMk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lnX0J1Y2tfQnVubnlfNzIwXzEwc18xME1CLm1wNCUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMldoYXQlMjBkbyUyMHlvdSUyMHNlZSUyMGluJTIwdGhpcyUyMHZpZGVvJTNGJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTVE",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, LlavaOnevisionForConditionalGeneration

model_id = <span class="hljs-string">&quot;llava-hf/llava-onevision-qwen2-0.5b-ov-hf&quot;</span>
model = LlavaOnevisionForConditionalGeneration.from_pretrained(model_id)
processor = AutoProcessor.from_pretrained(model_id)

messages = [
    {
      <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&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;You are a friendly chatbot who always responds in the style of a pirate&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;video&quot;</span>, <span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_10MB.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 do you see in this video?&quot;</span>},
        ],
    },
]`,wrap:!1}}),$=new Jl({props:{id:"sampling",options:["fixed number of frames","fps","list of image frames"],$$slots:{default:[wl]},$$scope:{ctx:C}}}),K=new ns({props:{title:"Template configuration",local:"template-configuration",headingTag:"h2"}}),ls=new b({props:{code:"JTdCJTI1JTIwZm9yJTIwbWVzc2FnZSUyMGluJTIwbWVzc2FnZXMlMjAlMjUlN0QlMEElN0IlMjUlMjBpZiUyMGxvb3AuaW5kZXgwJTIwJTNEJTNEJTIwMCUyMCUyNSU3RCU3QiU3QiUyMGJvc190b2tlbiUyMCU3RCU3RCU3QiUyNSUyMGVuZGlmJTIwJTI1JTdEJTBBJTdCJTdCJTIwJyUzQyU3Q3N0YXJ0X2hlYWRlcl9pZCU3QyUzRSclMjAlMkIlMjBtZXNzYWdlJTVCJ3JvbGUnJTVEJTIwJTJCJTIwJyUzQyU3Q2VuZF9oZWFkZXJfaWQlN0MlM0UlNUNuJTVDbiclMjAlN0QlN0QlMEElN0IlMjUlMjBpZiUyMG1lc3NhZ2UlNUInY29udGVudCclNUQlMjBpcyUyMHN0cmluZyUyMCUyNSU3RCUwQSU3QiU3QiUyMG1lc3NhZ2UlNUInY29udGVudCclNUQlMjAlN0QlN0QlMEElN0IlMjUlMjBlbHNlJTIwJTI1JTdEJTBBJTdCJTI1JTIwZm9yJTIwY29udGVudCUyMGluJTIwbWVzc2FnZSU1Qidjb250ZW50JyU1RCUyMCUyNSU3RCUwQSU3QiUyNSUyMGlmJTIwY29udGVudCU1Qid0eXBlJyU1RCUyMCUzRCUzRCUyMCdpbWFnZSclMjAlMjUlN0QlMEElN0IlN0IlMjAnJTNDJTdDaW1hZ2UlN0MlM0UnJTIwJTdEJTdEJTBBJTdCJTI1JTIwZWxpZiUyMGNvbnRlbnQlNUIndHlwZSclNUQlMjAlM0QlM0QlMjAndGV4dCclMjAlMjUlN0QlMEElN0IlN0IlMjBjb250ZW50JTVCJ3RleHQnJTVEJTIwJTdEJTdEJTBBJTdCJTI1JTIwZW5kaWYlMjAlMjUlN0QlMEElN0IlMjUlMjBlbmRmb3IlMjAlMjUlN0QlMEElN0IlMjUlMjBlbmRpZiUyMCUyNSU3RCUwQSU3QiU3QiUyMCclM0MlN0Nlb3RfaWQlN0MlM0UnJTIwJTdEJTdEJTBBJTdCJTI1JTIwZW5kZm9yJTIwJTI1JTdEJTBBJTdCJTI1JTIwaWYlMjBhZGRfZ2VuZXJhdGlvbl9wcm9tcHQlMjAlMjUlN0QlN0IlN0IlMjAnJTNDJTdDc3RhcnRfaGVhZGVyX2lkJTdDJTNFYXNzaXN0YW50JTNDJTdDZW5kX2hlYWRlcl9pZCU3QyUzRSU1Q24lNUNuJyUyMCU3RCU3RCU3QiUyNSUyMGVuZGlmJTIwJTI1JTdE",highlighted:`<span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">for</span></span> message <span class="hljs-keyword">in</span> messages %}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">if</span></span> loop.index0 == 0 %}</span><span class="hljs-template-variable">{{ bos_token }}</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">endif</span></span> %}</span><span class="language-xml">
</span><span class="hljs-template-variable">{{ &#x27;&lt;|start_header_id|&gt;&#x27; + message[&#x27;role&#x27;] + &#x27;&lt;|end_header_id|&gt;\\n\\n&#x27; }}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">if</span></span> message[&#x27;content&#x27;] is string %}</span><span class="language-xml">
</span><span class="hljs-template-variable">{{ message[&#x27;content&#x27;] }}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">else</span></span> %}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">for</span></span> content <span class="hljs-keyword">in</span> message[&#x27;content&#x27;] %}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">if</span></span> content[&#x27;type&#x27;] == &#x27;image&#x27; %}</span><span class="language-xml">
</span><span class="hljs-template-variable">{{ &#x27;&lt;|image|&gt;&#x27; }}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">elif</span></span> content[&#x27;type&#x27;] == &#x27;text&#x27; %}</span><span class="language-xml">
</span><span class="hljs-template-variable">{{ content[&#x27;text&#x27;] }}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">endif</span></span> %}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">endfor</span></span> %}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">endif</span></span> %}</span><span class="language-xml">
</span><span class="hljs-template-variable">{{ &#x27;&lt;|eot_id|&gt;&#x27; }}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">endfor</span></span> %}</span><span class="language-xml">
</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">if</span></span> add_generation_prompt %}</span><span class="hljs-template-variable">{{ &#x27;&lt;|start_header_id|&gt;assistant&lt;|end_header_id|&gt;\\n\\n&#x27; }}</span><span class="hljs-template-tag">{% <span class="hljs-name"><span class="hljs-name">endif</span></span> %}</span>`,wrap:!1}}),es=new Tl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/chat_templating_multimodal.md"}}),{c(){a=m("meta"),U=o(),M=m("p"),r=o(),j(y.$$.fragment),c=o(),n=m("p"),n.innerHTML=T,p=o(),h=m("p"),h.innerHTML=ts,os=o(),B=m("p"),B.textContent=Xs,is=o(),j(v.$$.fragment),Ms=o(),q=m("p"),q.innerHTML=Rs,rs=o(),G=m("p"),G.textContent=Vs,cs=o(),Q=m("ul"),Q.innerHTML=Ws,ys=o(),j(A.$$.fragment),ms=o(),N=m("p"),N.innerHTML=zs,Js=o(),j(x.$$.fragment),Ts=o(),j(_.$$.fragment),ds=o(),j(E.$$.fragment),Us=o(),k=m("p"),k.innerHTML=Ss,hs=o(),X=m("ul"),X.innerHTML=Ys,js=o(),j(R.$$.fragment),us=o(),V=m("p"),V.innerHTML=Hs,ws=o(),j(W.$$.fragment),Is=o(),z=m("p"),z.innerHTML=Fs,fs=o(),j(S.$$.fragment),gs=o(),Y=m("p"),Y.innerHTML=Ls,Cs=o(),H=m("ul"),H.innerHTML=Ps,bs=o(),j(Z.$$.fragment),xs=o(),j(F.$$.fragment),Zs=o(),L=m("p"),L.innerHTML=Ds,$s=o(),P=m("p"),P.innerHTML=Ks,Bs=o(),D=m("p"),D.textContent=Os,vs=o(),j($.$$.fragment),qs=o(),j(K.$$.fragment),Gs=o(),O=m("p"),O.innerHTML=sl,Qs=o(),ss=m("p"),ss.innerHTML=ll,As=o(),j(ls.$$.fragment),Ns=o(),j(es.$$.fragment),_s=o(),as=m("p"),this.h()},l(s){const l=yl("svelte-u9bgzb",document.head);a=J(l,"META",{name:!0,content:!0}),l.forEach(e),U=i(s),M=J(s,"P",{}),nl(M).forEach(e),r=i(s),u(y.$$.fragment,s),c=i(s),n=J(s,"P",{"data-svelte-h":!0}),d(n)!=="svelte-1agojlz"&&(n.innerHTML=T),p=i(s),h=J(s,"P",{"data-svelte-h":!0}),d(h)!=="svelte-1cx8i0m"&&(h.innerHTML=ts),os=i(s),B=J(s,"P",{"data-svelte-h":!0}),d(B)!=="svelte-gm7wkx"&&(B.textContent=Xs),is=i(s),u(v.$$.fragment,s),Ms=i(s),q=J(s,"P",{"data-svelte-h":!0}),d(q)!=="svelte-znexrk"&&(q.innerHTML=Rs),rs=i(s),G=J(s,"P",{"data-svelte-h":!0}),d(G)!=="svelte-1rwc0gb"&&(G.textContent=Vs),cs=i(s),Q=J(s,"UL",{"data-svelte-h":!0}),d(Q)!=="svelte-dldyqw"&&(Q.innerHTML=Ws),ys=i(s),u(A.$$.fragment,s),ms=i(s),N=J(s,"P",{"data-svelte-h":!0}),d(N)!=="svelte-1x8ndqo"&&(N.innerHTML=zs),Js=i(s),u(x.$$.fragment,s),Ts=i(s),u(_.$$.fragment,s),ds=i(s),u(E.$$.fragment,s),Us=i(s),k=J(s,"P",{"data-svelte-h":!0}),d(k)!=="svelte-bjpyoz"&&(k.innerHTML=Ss),hs=i(s),X=J(s,"UL",{"data-svelte-h":!0}),d(X)!=="svelte-17i21u2"&&(X.innerHTML=Ys),js=i(s),u(R.$$.fragment,s),us=i(s),V=J(s,"P",{"data-svelte-h":!0}),d(V)!=="svelte-po3wbg"&&(V.innerHTML=Hs),ws=i(s),u(W.$$.fragment,s),Is=i(s),z=J(s,"P",{"data-svelte-h":!0}),d(z)!=="svelte-uo4xlo"&&(z.innerHTML=Fs),fs=i(s),u(S.$$.fragment,s),gs=i(s),Y=J(s,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-1ldrrkv"&&(Y.innerHTML=Ls),Cs=i(s),H=J(s,"UL",{"data-svelte-h":!0}),d(H)!=="svelte-1qmo9q2"&&(H.innerHTML=Ps),bs=i(s),u(Z.$$.fragment,s),xs=i(s),u(F.$$.fragment,s),Zs=i(s),L=J(s,"P",{"data-svelte-h":!0}),d(L)!=="svelte-gv51q6"&&(L.innerHTML=Ds),$s=i(s),P=J(s,"P",{"data-svelte-h":!0}),d(P)!=="svelte-mmdb9c"&&(P.innerHTML=Ks),Bs=i(s),D=J(s,"P",{"data-svelte-h":!0}),d(D)!=="svelte-12n779"&&(D.textContent=Os),vs=i(s),u($.$$.fragment,s),qs=i(s),u(K.$$.fragment,s),Gs=i(s),O=J(s,"P",{"data-svelte-h":!0}),d(O)!=="svelte-1fbpi9q"&&(O.innerHTML=sl),Qs=i(s),ss=J(s,"P",{"data-svelte-h":!0}),d(ss)!=="svelte-1gbnbdg"&&(ss.innerHTML=ll),As=i(s),u(ls.$$.fragment,s),Ns=i(s),u(es.$$.fragment,s),_s=i(s),as=J(s,"P",{}),nl(as).forEach(e),this.h()},h(){pl(a,"name","hf:doc:metadata"),pl(a,"content",fl)},m(s,l){ml(document.head,a),t(s,U,l),t(s,M,l),t(s,r,l),w(y,s,l),t(s,c,l),t(s,n,l),t(s,p,l),t(s,h,l),t(s,os,l),t(s,B,l),t(s,is,l),w(v,s,l),t(s,Ms,l),t(s,q,l),t(s,rs,l),t(s,G,l),t(s,cs,l),t(s,Q,l),t(s,ys,l),w(A,s,l),t(s,ms,l),t(s,N,l),t(s,Js,l),w(x,s,l),t(s,Ts,l),w(_,s,l),t(s,ds,l),w(E,s,l),t(s,Us,l),t(s,k,l),t(s,hs,l),t(s,X,l),t(s,js,l),w(R,s,l),t(s,us,l),t(s,V,l),t(s,ws,l),w(W,s,l),t(s,Is,l),t(s,z,l),t(s,fs,l),w(S,s,l),t(s,gs,l),t(s,Y,l),t(s,Cs,l),t(s,H,l),t(s,bs,l),w(Z,s,l),t(s,xs,l),w(F,s,l),t(s,Zs,l),t(s,L,l),t(s,$s,l),t(s,P,l),t(s,Bs,l),t(s,D,l),t(s,vs,l),w($,s,l),t(s,qs,l),w(K,s,l),t(s,Gs,l),t(s,O,l),t(s,Qs,l),t(s,ss,l),t(s,As,l),w(ls,s,l),t(s,Ns,l),w(es,s,l),t(s,_s,l),t(s,as,l),Es=!0},p(s,[l]){const el={};l&2&&(el.$$scope={dirty:l,ctx:s}),x.$set(el);const tl={};l&2&&(tl.$$scope={dirty:l,ctx:s}),Z.$set(tl);const al={};l&2&&(al.$$scope={dirty:l,ctx:s}),$.$set(al)},i(s){Es||(I(y.$$.fragment,s),I(v.$$.fragment,s),I(A.$$.fragment,s),I(x.$$.fragment,s),I(_.$$.fragment,s),I(E.$$.fragment,s),I(R.$$.fragment,s),I(W.$$.fragment,s),I(S.$$.fragment,s),I(Z.$$.fragment,s),I(F.$$.fragment,s),I($.$$.fragment,s),I(K.$$.fragment,s),I(ls.$$.fragment,s),I(es.$$.fragment,s),Es=!0)},o(s){f(y.$$.fragment,s),f(v.$$.fragment,s),f(A.$$.fragment,s),f(x.$$.fragment,s),f(_.$$.fragment,s),f(E.$$.fragment,s),f(R.$$.fragment,s),f(W.$$.fragment,s),f(S.$$.fragment,s),f(Z.$$.fragment,s),f(F.$$.fragment,s),f($.$$.fragment,s),f(K.$$.fragment,s),f(ls.$$.fragment,s),f(es.$$.fragment,s),Es=!1},d(s){s&&(e(U),e(M),e(r),e(c),e(n),e(p),e(h),e(os),e(B),e(is),e(Ms),e(q),e(rs),e(G),e(cs),e(Q),e(ys),e(ms),e(N),e(Js),e(Ts),e(ds),e(Us),e(k),e(hs),e(X),e(js),e(us),e(V),e(ws),e(Is),e(z),e(fs),e(gs),e(Y),e(Cs),e(H),e(bs),e(xs),e(Zs),e(L),e($s),e(P),e(Bs),e(D),e(vs),e(qs),e(Gs),e(O),e(Qs),e(ss),e(As),e(Ns),e(_s),e(as)),e(a),g(y,s),g(v,s),g(A,s),g(x,s),g(_,s),g(E,s),g(R,s),g(W,s),g(S,s),g(Z,s),g(F,s),g($,s),g(K,s),g(ls,s),g(es,s)}}}const fl='{"title":"Multimodal templates","local":"multimodal-templates","sections":[{"title":"ImageTextToTextPipeline","local":"imagetexttotextpipeline","sections":[],"depth":2},{"title":"Image inputs","local":"image-inputs","sections":[],"depth":2},{"title":"Video inputs","local":"video-inputs","sections":[],"depth":2},{"title":"Template configuration","local":"template-configuration","sections":[],"depth":2}],"depth":1}';function gl(C){return Ml(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ql extends rl{constructor(a){super(),cl(this,a,gl,Il,il,{})}}export{ql as component};
