import{s as So,o as Yo,n as it}from"../chunks/scheduler.01eeda35.js";import{S as Do,i as Oo,g as d,s as n,r as c,A as Ko,h as m,f as o,c as a,j as v,u,x as T,k as J,y as l,a as i,v as p,d as h,t as f,w as g}from"../chunks/index.6dd51b66.js";import{T as Ao}from"../chunks/Tip.de9bae2b.js";import{D as P}from"../chunks/Docstring.cb556860.js";import{C as mt}from"../chunks/CodeBlock.19ec9b8c.js";import{E as Xt}from"../chunks/ExampleCodeBlock.69db56ad.js";import{H as Z,E as en}from"../chunks/index.58fe8f9d.js";function tn(I){let r,w="Example:",M,_,y;return _=new mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBoaTRNdWx0aW1vZGFsQXVkaW9Db25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwUGhpNE11bHRpbW9kYWxBdWRpb0NvbmZpZyUyMHdpdGglMjBtaWNyb3NvZnQlMkZQaGktNC1tdWx0aW1vZGFsLWluc3RydWN0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMFBoaTRNdWx0aW1vZGFsQXVkaW9Db25maWcoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Phi4MultimodalAudioConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Phi4MultimodalAudioConfig with microsoft/Phi-4-multimodal-instruct style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Phi4MultimodalAudioConfig()`,wrap:!1}}),{c(){r=d("p"),r.textContent=w,M=n(),c(_.$$.fragment)},l(s){r=m(s,"P",{"data-svelte-h":!0}),T(r)!=="svelte-11lpom8"&&(r.textContent=w),M=a(s),u(_.$$.fragment,s)},m(s,b){i(s,r,b),i(s,M,b),p(_,s,b),y=!0},p:it,i(s){y||(h(_.$$.fragment,s),y=!0)},o(s){f(_.$$.fragment,s),y=!1},d(s){s&&(o(r),o(M)),g(_,s)}}}function on(I){let r,w="Example:",M,_,y;return _=new mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBoaTRNdWx0aW1vZGFsVmlzaW9uQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFBoaTRNdWx0aW1vZGFsVmlzaW9uQ29uZmlnJTIwd2l0aCUyMG1pY3Jvc29mdCUyRlBoaS00LW11bHRpbW9kYWwtaW5zdHJ1Y3QlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwUGhpNE11bHRpbW9kYWxWaXNpb25Db25maWcoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Phi4MultimodalVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Phi4MultimodalVisionConfig with microsoft/Phi-4-multimodal-instruct style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Phi4MultimodalVisionConfig()`,wrap:!1}}),{c(){r=d("p"),r.textContent=w,M=n(),c(_.$$.fragment)},l(s){r=m(s,"P",{"data-svelte-h":!0}),T(r)!=="svelte-11lpom8"&&(r.textContent=w),M=a(s),u(_.$$.fragment,s)},m(s,b){i(s,r,b),i(s,M,b),p(_,s,b),y=!0},p:it,i(s){y||(h(_.$$.fragment,s),y=!0)},o(s){f(_.$$.fragment,s),y=!1},d(s){s&&(o(r),o(M)),g(_,s)}}}function nn(I){let r,w="Example:",M,_,y;return _=new mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBoaTRNdWx0aW1vZGFsTW9kZWwlMkMlMjBQaGk0TXVsdGltb2RhbENvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBQaGk0TXVsdGltb2RhbCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBQaGk0TXVsdGltb2RhbENvbmZpZy5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGUGhpLTQtbXVsdGltb2RhbC1pbnN0cnVjdCUyMiklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwUGhpNE11bHRpbW9kYWxNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Phi4MultimodalModel, Phi4MultimodalConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Phi4Multimodal style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Phi4MultimodalConfig.from_pretrained(<span class="hljs-string">&quot;microsoft/Phi-4-multimodal-instruct&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Phi4MultimodalModel(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(){r=d("p"),r.textContent=w,M=n(),c(_.$$.fragment)},l(s){r=m(s,"P",{"data-svelte-h":!0}),T(r)!=="svelte-11lpom8"&&(r.textContent=w),M=a(s),u(_.$$.fragment,s)},m(s,b){i(s,r,b),i(s,M,b),p(_,s,b),y=!0},p:it,i(s){y||(h(_.$$.fragment,s),y=!0)},o(s){f(_.$$.fragment,s),y=!1},d(s){s&&(o(r),o(M)),g(_,s)}}}function an(I){let r,w=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=d("p"),r.innerHTML=w},l(M){r=m(M,"P",{"data-svelte-h":!0}),T(r)!=="svelte-fincs2"&&(r.innerHTML=w)},m(M,_){i(M,r,_)},p:it,d(M){M&&o(r)}}}function sn(I){let r,w=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=d("p"),r.innerHTML=w},l(M){r=m(M,"P",{"data-svelte-h":!0}),T(r)!=="svelte-fincs2"&&(r.innerHTML=w)},m(M,_){i(M,r,_)},p:it,d(M){M&&o(r)}}}function rn(I){let r,w="Example:",M,_,y;return _=new mt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBQaGk0TXVsdGltb2RhbEZvckNhdXNhbExNJTBBbW9kZWwlMjAlM0QlMjBQaGk0TXVsdGltb2RhbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJUQkElMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyVEJBJTIyKSUwQXByb21wdCUyMCUzRCUyMCUyMlRoaXMlMjBpcyUyMGFuJTIwZXhhbXBsZSUyMHNjcmlwdCUyMC4lMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbGVuZ3RoJTNEMzApJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, Phi4MultimodalForCausalLM
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Phi4MultimodalForCausalLM.from_pretrained(<span class="hljs-string">&quot;TBA&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;TBA&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;This is an example script .&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;This is an example script .\\n Certainly! Below is a sample script that demonstrates a simple task, such as calculating the sum&#x27;</span>`,wrap:!1}}),{c(){r=d("p"),r.textContent=w,M=n(),c(_.$$.fragment)},l(s){r=m(s,"P",{"data-svelte-h":!0}),T(r)!=="svelte-11lpom8"&&(r.textContent=w),M=a(s),u(_.$$.fragment,s)},m(s,b){i(s,r,b),i(s,M,b),p(_,s,b),y=!0},p:it,i(s){y||(h(_.$$.fragment,s),y=!0)},o(s){f(_.$$.fragment,s),y=!1},d(s){s&&(o(r),o(M)),g(_,s)}}}function ln(I){let r,w,M,_,y,s,b,ct,te,Jo="Phi4 Multimodal is a lightweight open multimodal foundation model that leverages the language, vision, and speech research and datasets used for Phi-3.5 and 4.0 models. The model processes text, image, and audio inputs, generating text outputs, and comes with 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning, direct preference optimization and RLHF (Reinforcement Learning from Human Feedback) to support precise instruction adherence and safety measures. The languages that each modal supports are the following:",ut,oe,Po="<li>Text: Arabic, Chinese, Czech, Danish, Dutch, English, Finnish, French, German, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish, Thai, Turkish, Ukrainian</li> <li>Vision: English</li> <li>Audio: English, Chinese, German, French, Italian, Japanese, Spanish, Portuguese</li>",pt,ne,$o=`This model was contributed by <a href="https://huggingface.co/cyrilvallez" rel="nofollow">Cyril Vallez</a>. The most recent code can be
found <a href="https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py" rel="nofollow">here</a>.`,ht,ae,ft,se,ko='<code>Phi4-multimodal-instruct</code> can be found on the <a href="https://huggingface.co/microsoft/Phi-4-multimodal-instruct" rel="nofollow">Huggingface Hub</a>',gt,ie,Io="In the following, we demonstrate how to use it for inference depending on the input modalities (text, image, audio).",_t,re,Mt,le,Tt,de,me,yt,ce,bt,C,ue,Ht,Ne,Co="Constructs a Phi4Multimodal image processor.",Qt,R,pe,At,Re,xo="images: B x 3 x H x W, B<=max_crops",St,Ee,he,wt,fe,vt,$,ge,Yt,qe,Uo="Constructs a Phi4Multimodal processor which raps an image processor, a audio processor, and a GPT tokenizer into a single processor.",Dt,Le,jo=`<a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalProcessor">Phi4MultimodalProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalImageProcessorFast">Phi4MultimodalImageProcessorFast</a> and <a href="/docs/transformers/main/en/model_doc/gpt2#transformers.GPT2Tokenizer">GPT2Tokenizer</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalProcessor.decode">decode()</a> for more information.`,Ot,E,_e,Kt,Xe,zo=`This method forwards all its arguments to GPT2Tokenizer’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.`,eo,q,Me,to,He,Zo=`This method forwards all its arguments to GPT2Tokenizer’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.`,Jt,Te,Pt,x,ye,oo,Qe,Fo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalAudioModel">Phi4MultimodalAudioModel</a>. It is used to instantiate a
Phi4Multimodal audio encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the audio encoder of
<a href="https://huggingface.co/microsoft/Phi-4-multimodal-instruct" rel="nofollow">microsoft/Phi-4-multimodal-instruct</a> architecture.`,no,Ae,Vo=`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.`,ao,L,$t,be,kt,U,we,so,Se,Wo=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalVisionModel">Phi4MultimodalVisionModel</a>. It is used to instantiate a
Phi4Multimodal vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of
<a href="https://huggingface.co/microsoft/Phi-4-multimodal-instruct" rel="nofollow">microsoft/Phi-4-multimodal-instruct</a> architecture.`,io,Ye,Bo=`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.`,ro,X,It,ve,Ct,j,Je,lo,De,Go=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalModel">Phi4MultimodalModel</a>. It is used to instantiate a
Phi4Multimodal model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the
<a href="https://huggingface.co/microsoft/Phi-4-multimodal-instruct" rel="nofollow">microsoft/Phi-4-multimodal-instruct</a> architecture.`,mo,Oe,No=`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.`,co,H,xt,Pe,Ut,G,$e,uo,Q,ke,po,Ke,Ro="Forwarding the inputs through the top embedding layers",jt,Ie,zt,Ce,xe,Zt,Ue,Ft,k,je,ho,et,Eo=`The bare Phi4Multimodal Model outputting raw hidden-states without any specific head on top.
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.)`,fo,tt,qo=`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.`,go,ot,Lo="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>Phi4MultimodalMMDecoderLayer</code>",_o,W,ze,Mo,nt,Xo='The <a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalModel">Phi4MultimodalModel</a> forward method, overrides the <code>__call__</code> special method.',To,A,Vt,Ze,Wt,N,Fe,yo,F,Ve,bo,at,Ho='The <a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalForCausalLM">Phi4MultimodalForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',wo,S,vo,Y,Bt,We,Gt,rt,Nt;return y=new Z({props:{title:"Phi4 Multimodal",local:"phi4-multimodal",headingTag:"h1"}}),b=new Z({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ae=new Z({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),re=new mt({props:{code:" ",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoProcessor, GenerationConfig


<span class="hljs-comment"># Define model path</span>
model_path = <span class="hljs-string">&quot;microsoft/Phi-4-multimodal-instruct&quot;</span>
device = <span class="hljs-string">&quot;cuda:0&quot;</span>

<span class="hljs-comment"># Load model and processor</span>
processor = AutoProcessor.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=device,  torch_dtype=torch.float16)

<span class="hljs-comment"># Optional: load the adapters (note that without them, the base model will very likely not work well)</span>
model.load_adapter(model_path, adapter_name=<span class="hljs-string">&quot;speech&quot;</span>, device_map=device, adapter_kwargs={<span class="hljs-string">&quot;subfolder&quot;</span>: <span class="hljs-string">&#x27;speech-lora&#x27;</span>})
model.load_adapter(model_path, adapter_name=<span class="hljs-string">&quot;vision&quot;</span>, device_map=device, adapter_kwargs={<span class="hljs-string">&quot;subfolder&quot;</span>: <span class="hljs-string">&#x27;vision-lora&#x27;</span>})

<span class="hljs-comment"># Part : Image Processing</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://www.ilankelman.org/stopsigns/australia.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 is shown in this image?&quot;</span>},
        ],
    },
]

model.set_adapter(<span class="hljs-string">&quot;vision&quot;</span>) <span class="hljs-comment"># if loaded, activate the vision adapter</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(device, torch.float16)

<span class="hljs-comment"># Generate response</span>
generate_ids = model.generate(
    **inputs,
    max_new_tokens=<span class="hljs-number">1000</span>,
    do_sample=<span class="hljs-literal">False</span>,
)
generate_ids = generate_ids[:, inputs[<span class="hljs-string">&#x27;input_ids&#x27;</span>].shape[<span class="hljs-number">1</span>]:]
response = processor.batch_decode(
    generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>
)[<span class="hljs-number">0</span>]
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&#x27;&gt;&gt;&gt; Response\\n<span class="hljs-subst">{response}</span>&#x27;</span>)


<span class="hljs-comment"># Part 2: Audio Processing</span>
model.set_adapter(<span class="hljs-string">&quot;speech&quot;</span>) <span class="hljs-comment"># if loaded, activate the speech adapter</span>
audio_url = <span class="hljs-string">&quot;https://upload.wikimedia.org/wikipedia/commons/b/b0/Barbara_Sahakian_BBC_Radio4_The_Life_Scientific_29_May_2012_b01j5j24.flac&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;audio&quot;</span>, <span class="hljs-string">&quot;url&quot;</span>: audio_url},
            {<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;Transcribe the audio to text, and then translate the audio to French. Use &lt;sep&gt; as a separator between the origina transcript and the translation.&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>,
    sample_rate=sample_rate,
).to(device, torch.float16)

generate_ids = model.generate(
    **inputs,
    max_new_tokens=<span class="hljs-number">1000</span>,
    do_sample=<span class="hljs-literal">False</span>,
)
generate_ids = generate_ids[:, inputs[<span class="hljs-string">&#x27;input_ids&#x27;</span>].shape[<span class="hljs-number">1</span>]:]
response = processor.batch_decode(
    generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>
)[<span class="hljs-number">0</span>]
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&#x27;&gt;&gt;&gt; Response\\n<span class="hljs-subst">{response}</span>&#x27;</span>)`,wrap:!1}}),le=new Z({props:{title:"Phi4MultimodalFeatureExtractor",local:"transformers.Phi4MultimodalFeatureExtractor",headingTag:"h2"}}),me=new P({props:{name:"class transformers.Phi4MultimodalFeatureExtractor",anchor:"transformers.Phi4MultimodalFeatureExtractor",parameters:[{name:"feature_size",val:": int = 80"},{name:"sampling_rate",val:": int = 16000"},{name:"hop_length",val:": int = 160"},{name:"n_fft",val:": int = 512"},{name:"win_length",val:": int = 400"},{name:"preemphasis",val:": float = 0.97"},{name:"padding_value",val:": float = 0.0"},{name:"audio_compression_rate",val:": int = 8"},{name:"audio_downsample_rate",val:": int = 1"},{name:"audio_feat_stride",val:": int = 1"},{name:"mel_min_frequency",val:": float = 0"},{name:"mel_max_frequency",val:": float = 7690"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/feature_extraction_phi4_multimodal.py#L96"}}),ce=new Z({props:{title:"Phi4MultimodalImageProcessorFast",local:"transformers.Phi4MultimodalImageProcessorFast",headingTag:"h2"}}),ue=new P({props:{name:"class transformers.Phi4MultimodalImageProcessorFast",anchor:"transformers.Phi4MultimodalImageProcessorFast",parameters:[{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.phi4_multimodal.image_processing_phi4_multimodal_fast.Phi4MultimodalFastImageProcessorKwargs]"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/image_processing_phi4_multimodal_fast.py#L45"}}),pe=new P({props:{name:"pad_to_max_num_crops",anchor:"transformers.Phi4MultimodalImageProcessorFast.pad_to_max_num_crops",parameters:[{name:"images",val:""},{name:"max_crops",val:" = 5"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/image_processing_phi4_multimodal_fast.py#L134"}}),he=new P({props:{name:"preprocess",anchor:"transformers.Phi4MultimodalImageProcessorFast.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"}],parametersDescription:[{anchor:"transformers.Phi4MultimodalImageProcessorFast.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.Phi4MultimodalImageProcessorFast.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Mean to use if normalizing the image. Can be a float or a list of floats corresponding to the number of channels in the image.`,name:"image_mean"},{anchor:"transformers.Phi4MultimodalImageProcessorFast.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Standard deviation to use if normalizing the image. Can be a float or a list of floats corresponding to the number of channels in the image.`,name:"image_std"},{anchor:"transformers.Phi4MultimodalImageProcessorFast.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/image_processing_phi4_multimodal_fast.py#L151"}}),fe=new Z({props:{title:"Phi4MultimodalProcessor",local:"transformers.Phi4MultimodalProcessor",headingTag:"h2"}}),ge=new P({props:{name:"class transformers.Phi4MultimodalProcessor",anchor:"transformers.Phi4MultimodalProcessor",parameters:[{name:"image_processor",val:""},{name:"audio_processor",val:""},{name:"tokenizer",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Phi4MultimodalProcessor.image_processor",description:`<strong>image_processor</strong> (<code>Phi4MultimodalImageProcessorFast</code>) &#x2014;
The image processor to use for images.`,name:"image_processor"},{anchor:"transformers.Phi4MultimodalProcessor.audio_processor",description:`<strong>audio_processor</strong> (<code>Phi4MultimodalFeatureExtractor</code>) &#x2014;
The audio processor to use for audio inputs.`,name:"audio_processor"},{anchor:"transformers.Phi4MultimodalProcessor.tokenizer",description:`<strong>tokenizer</strong> (<code>GPT2TokenizerFast</code>) &#x2014;
The tokenizer to use for text.`,name:"tokenizer"},{anchor:"transformers.Phi4MultimodalProcessor.fake_image_token_pattern",description:`<strong>fake_image_token_pattern</strong> (<code>str</code>, <em>optional</em>, defaults to <code>r&quot;&lt;\\|image_\\d+\\|&gt;&quot;</code>) &#x2014;
The fake image token pattern.`,name:"fake_image_token_pattern"},{anchor:"transformers.Phi4MultimodalProcessor.fake_audio_token_pattern",description:`<strong>fake_audio_token_pattern</strong> (<code>str</code>, <em>optional</em>, defaults to <code>r&quot;&lt;\\|audio_\\d+\\|&gt;&quot;</code>) &#x2014;
The fake audio token pattern.`,name:"fake_audio_token_pattern"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/processing_phi4_multimodal.py#L41"}}),_e=new P({props:{name:"batch_decode",anchor:"transformers.Phi4MultimodalProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/processing_phi4_multimodal.py#L168"}}),Me=new P({props:{name:"decode",anchor:"transformers.Phi4MultimodalProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/processing_phi4_multimodal.py#L175"}}),Te=new Z({props:{title:"Phi4MultimodalAudioConfig",local:"transformers.Phi4MultimodalAudioConfig",headingTag:"h2"}}),ye=new P({props:{name:"class transformers.Phi4MultimodalAudioConfig",anchor:"transformers.Phi4MultimodalAudioConfig",parameters:[{name:"hidden_size",val:": int = 1024"},{name:"intermediate_size",val:": int = 1536"},{name:"num_blocks",val:": int = 24"},{name:"num_attention_heads",val:": int = 16"},{name:"activation",val:": str = 'swish'"},{name:"chunk_size",val:": int = -1"},{name:"left_chunk",val:": int = 18"},{name:"dropout_rate",val:": float = 0.0"},{name:"ext_pw_out_channel",val:": int = 1024"},{name:"depthwise_seperable_out_channel",val:": int = 1024"},{name:"depthwise_multiplier",val:": int = 1"},{name:"kernel_size",val:": int = 3"},{name:"conv_activation",val:": str = 'swish'"},{name:"input_size",val:": int = 80"},{name:"conv_glu_type",val:": str = 'swish'"},{name:"time_reduction",val:": int = 8"},{name:"bias_max_distance",val:": int = 1000"},{name:"bias_symmetric",val:": bool = False"},{name:"nemo_activation",val:": str = 'relu'"},{name:"nemo_conv_channels",val:": int = 1024"},{name:"downsample_rate",val:": int = 1"},{name:"initializer_range",val:": float = 0.02"},{name:"audio_token_id",val:": int = 200011"},{name:"feature_layer",val:": int = -2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Phi4MultimodalAudioConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the encoder layers.`,name:"hidden_size"},{anchor:"transformers.Phi4MultimodalAudioConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1536) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Phi4MultimodalAudioConfig.num_blocks",description:`<strong>num_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_blocks"},{anchor:"transformers.Phi4MultimodalAudioConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Phi4MultimodalAudioConfig.activation",description:`<strong>activation</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;swish&quot;</code>) &#x2014;
The non-linear activation function in the MLPs.`,name:"activation"},{anchor:"transformers.Phi4MultimodalAudioConfig.chunk_size",description:`<strong>chunk_size</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
The chunk size to create the masks.`,name:"chunk_size"},{anchor:"transformers.Phi4MultimodalAudioConfig.left_chunk",description:`<strong>left_chunk</strong> (<code>int</code>, <em>optional</em>, defaults to 18) &#x2014;
The left chunk to create the masks.`,name:"left_chunk"},{anchor:"transformers.Phi4MultimodalAudioConfig.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio.`,name:"dropout_rate"},{anchor:"transformers.Phi4MultimodalAudioConfig.ext_pw_out_channel",description:`<strong>ext_pw_out_channel</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Number of out channels in the point-wise conv modules.`,name:"ext_pw_out_channel"},{anchor:"transformers.Phi4MultimodalAudioConfig.depthwise_seperable_out_channel",description:`<strong>depthwise_seperable_out_channel</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Number of out channels in the depth-wise separable conv modules.`,name:"depthwise_seperable_out_channel"},{anchor:"transformers.Phi4MultimodalAudioConfig.depthwise_multiplier",description:`<strong>depthwise_multiplier</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Input size multiplier for the depth-wise separable conv modules.`,name:"depthwise_multiplier"},{anchor:"transformers.Phi4MultimodalAudioConfig.kernel_size",description:`<strong>kernel_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Kernel size for the depth-wise separable conv modules.`,name:"kernel_size"},{anchor:"transformers.Phi4MultimodalAudioConfig.conv_activation",description:`<strong>conv_activation</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;swish&quot;</code>) &#x2014;
The non-linear activation function in the conv modules.`,name:"conv_activation"},{anchor:"transformers.Phi4MultimodalAudioConfig.input_size",description:`<strong>input_size</strong> (<code>int</code>, <em>optional</em>, defaults to 80) &#x2014;
Input size for the audio model.`,name:"input_size"},{anchor:"transformers.Phi4MultimodalAudioConfig.conv_glu_type",description:`<strong>conv_glu_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;swish&quot;</code>) &#x2014;
The non-linear activation function in the point-wise conv modules.`,name:"conv_glu_type"},{anchor:"transformers.Phi4MultimodalAudioConfig.time_reduction",description:`<strong>time_reduction</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Time reduction (subsampling factor).`,name:"time_reduction"},{anchor:"transformers.Phi4MultimodalAudioConfig.bias_max_distance",description:`<strong>bias_max_distance</strong> (<code>int</code>, <em>optional</em>, defaults to 1000) &#x2014;
Max distance for the relative attention bias module.`,name:"bias_max_distance"},{anchor:"transformers.Phi4MultimodalAudioConfig.bias_symmetric",description:`<strong>bias_symmetric</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the relative attention bias should be symmetric or not.`,name:"bias_symmetric"},{anchor:"transformers.Phi4MultimodalAudioConfig.nemo_activation",description:`<strong>nemo_activation</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function in the nemo conv modules.`,name:"nemo_activation"},{anchor:"transformers.Phi4MultimodalAudioConfig.nemo_conv_channels",description:`<strong>nemo_conv_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Number of channels in the nemo conv modules.`,name:"nemo_conv_channels"},{anchor:"transformers.Phi4MultimodalAudioConfig.downsample_rate",description:`<strong>downsample_rate</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Downsample rate for the audio feature extractor.`,name:"downsample_rate"},{anchor:"transformers.Phi4MultimodalAudioConfig.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.Phi4MultimodalAudioConfig.audio_token_id",description:`<strong>audio_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 200011) &#x2014;
The audio token id.`,name:"audio_token_id"},{anchor:"transformers.Phi4MultimodalAudioConfig.feature_layer",description:`<strong>feature_layer</strong> (<code>int</code>, <em>optional</em>, defaults to -2) &#x2014;
The index of the layer of the encoder from which to extract audio features.`,name:"feature_layer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/configuration_phi4_multimodal.py#L111"}}),L=new Xt({props:{anchor:"transformers.Phi4MultimodalAudioConfig.example",$$slots:{default:[tn]},$$scope:{ctx:I}}}),be=new Z({props:{title:"Phi4MultimodalVisionConfig",local:"transformers.Phi4MultimodalVisionConfig",headingTag:"h2"}}),we=new P({props:{name:"class transformers.Phi4MultimodalVisionConfig",anchor:"transformers.Phi4MultimodalVisionConfig",parameters:[{name:"hidden_size",val:" = 1152"},{name:"intermediate_size",val:" = 4304"},{name:"num_hidden_layers",val:" = 27"},{name:"num_attention_heads",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 448"},{name:"patch_size",val:" = 14"},{name:"hidden_act",val:" = 'gelu_pytorch_tanh'"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"attention_dropout",val:" = 0.0"},{name:"crop_size",val:": int = 448"},{name:"image_token_id",val:": int = 200010"},{name:"feature_layer",val:": int = -2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Phi4MultimodalVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1152) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Phi4MultimodalVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4304) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Phi4MultimodalVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 27) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Phi4MultimodalVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Phi4MultimodalVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input images.`,name:"num_channels"},{anchor:"transformers.Phi4MultimodalVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 448) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.Phi4MultimodalVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 14) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Phi4MultimodalVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_pytorch_tanh&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Phi4MultimodalVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Phi4MultimodalVisionConfig.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.Phi4MultimodalVisionConfig.crop_size",description:`<strong>crop_size</strong> (<code>int</code>, <em>optional</em>, defaults to 448) &#x2014;
Crop size for the input images.`,name:"crop_size"},{anchor:"transformers.Phi4MultimodalVisionConfig.image_token_id",description:`<strong>image_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 200010) &#x2014;
The image token id.`,name:"image_token_id"},{anchor:"transformers.Phi4MultimodalVisionConfig.feature_layer",description:`<strong>feature_layer</strong> (<code>int</code>, <em>optional</em>, defaults to -2) &#x2014;
The index of the layer of the encoder from which to extract image features.`,name:"feature_layer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/configuration_phi4_multimodal.py#L26"}}),X=new Xt({props:{anchor:"transformers.Phi4MultimodalVisionConfig.example",$$slots:{default:[on]},$$scope:{ctx:I}}}),ve=new Z({props:{title:"Phi4MultimodalConfig",local:"transformers.Phi4MultimodalConfig",headingTag:"h2"}}),Je=new P({props:{name:"class transformers.Phi4MultimodalConfig",anchor:"transformers.Phi4MultimodalConfig",parameters:[{name:"vocab_size",val:" = 200064"},{name:"hidden_size",val:" = 3072"},{name:"intermediate_size",val:" = 8192"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = 8"},{name:"resid_pdrop",val:" = 0.0"},{name:"embd_pdrop",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 131072"},{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:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"partial_rotary_factor",val:" = 1"},{name:"bos_token_id",val:" = 199999"},{name:"eos_token_id",val:" = [199999, 200020]"},{name:"pad_token_id",val:" = 199999"},{name:"original_max_position_embeddings",val:" = 4096"},{name:"sliding_window",val:" = None"},{name:"vision_config",val:" = None"},{name:"audio_config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Phi4MultimodalConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 200064) &#x2014;
Vocabulary size of the Phi-3 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/phi3#transformers.Phi3Model">Phi3Model</a>.`,name:"vocab_size"},{anchor:"transformers.Phi4MultimodalConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.Phi4MultimodalConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.Phi4MultimodalConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.Phi4MultimodalConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.Phi4MultimodalConfig.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>num_attention_heads</code>.`,name:"num_key_value_heads"},{anchor:"transformers.Phi4MultimodalConfig.resid_pdrop",description:`<strong>resid_pdrop</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Dropout probability for mlp outputs.`,name:"resid_pdrop"},{anchor:"transformers.Phi4MultimodalConfig.embd_pdrop",description:`<strong>embd_pdrop</strong> (<code>int</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the embeddings.`,name:"embd_pdrop"},{anchor:"transformers.Phi4MultimodalConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio after computing the attention scores.`,name:"attention_dropout"},{anchor:"transformers.Phi4MultimodalConfig.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.Phi4MultimodalConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 131072) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.Phi4MultimodalConfig.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.Phi4MultimodalConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon value used for the RMSNorm.`,name:"rms_norm_eps"},{anchor:"transformers.Phi4MultimodalConfig.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>. Whether to tie weight embeddings or not.`,name:"use_cache"},{anchor:"transformers.Phi4MultimodalConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.Phi4MultimodalConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.Phi4MultimodalConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
The scaling strategy for the RoPE embeddings. If <code>None</code>, no scaling is applied. If a dictionary, it must
contain the following keys: <code>type</code>, <code>short_factor</code> and <code>long_factor</code>. The <code>type</code> must be <code>longrope</code> and
the <code>short_factor</code> and <code>long_factor</code> must be lists of numbers with the same length as the hidden size
divided by the number of attention heads divided by 2.`,name:"rope_scaling"},{anchor:"transformers.Phi4MultimodalConfig.partial_rotary_factor",description:`<strong>partial_rotary_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1.0</code>) &#x2014;
Percentage of the query and keys which will have rotary embedding. Must be between 0.0 and 1.0.`,name:"partial_rotary_factor"},{anchor:"transformers.Phi4MultimodalConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 199999) &#x2014;
The id of the &#x201C;beginning-of-sequence&#x201D; token.`,name:"bos_token_id"},{anchor:"transformers.Phi4MultimodalConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code> or <code>list[int]</code>, <em>optional</em>, defaults to <code>[199999, 200020]</code>) &#x2014;
The id of the &#x201C;end-of-sequence&#x201D; token.`,name:"eos_token_id"},{anchor:"transformers.Phi4MultimodalConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 199999) &#x2014;
The id of the padding token.`,name:"pad_token_id"},{anchor:"transformers.Phi4MultimodalConfig.original_max_position_embeddings",description:`<strong>original_max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
The maximum sequence length that this model was trained with. This is used to determine the size of the
original RoPE embeddings when using long scaling.`,name:"original_max_position_embeddings"},{anchor:"transformers.Phi4MultimodalConfig.sliding_window",description:`<strong>sliding_window</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Sliding window attention window size. If <code>None</code>, no sliding window is applied.`,name:"sliding_window"},{anchor:"transformers.Phi4MultimodalConfig.vision_config",description:`<strong>vision_config</strong> (<code>Phi4MultimodalVisionConfig</code> or <code>dict</code>, <em>optional</em>) &#x2014;
The vision config for the underlying image embedding model. If not provided, will default to the configuration
used to instantiate a model similar in architecture as
<a href="https://huggingface.co/microsoft/Phi-4-multimodal-instruct" rel="nofollow">microsoft/Phi-4-multimodal-instruct</a>.`,name:"vision_config"},{anchor:"transformers.Phi4MultimodalConfig.audio_config",description:`<strong>audio_config</strong> (<code>Phi4MultimodalAudioConfig</code> or <code>dict</code>, <em>optional</em>) &#x2014;
The audio config for the underlying audio embedding model. If not provided, will default to the configuration
used to instantiate a model similar in architecture as
<a href="https://huggingface.co/microsoft/Phi-4-multimodal-instruct" rel="nofollow">microsoft/Phi-4-multimodal-instruct</a>.`,name:"audio_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/configuration_phi4_multimodal.py#L244"}}),H=new Xt({props:{anchor:"transformers.Phi4MultimodalConfig.example",$$slots:{default:[nn]},$$scope:{ctx:I}}}),Pe=new Z({props:{title:"Phi4MultimodalAudioModel",local:"transformers.Phi4MultimodalAudioModel",headingTag:"h2"}}),$e=new P({props:{name:"class transformers.Phi4MultimodalAudioModel",anchor:"transformers.Phi4MultimodalAudioModel",parameters:[{name:"config",val:": Phi4MultimodalAudioConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py#L1085"}}),ke=new P({props:{name:"forward_embeddings",anchor:"transformers.Phi4MultimodalAudioModel.forward_embeddings",parameters:[{name:"hidden_states",val:""},{name:"masks",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py#L1121"}}),Ie=new Z({props:{title:"Phi4MultimodalVisionModel",local:"transformers.Phi4MultimodalVisionModel",headingTag:"h2"}}),xe=new P({props:{name:"class transformers.Phi4MultimodalVisionModel",anchor:"transformers.Phi4MultimodalVisionModel",parameters:[{name:"config",val:": Phi4MultimodalVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py#L544"}}),Ue=new Z({props:{title:"Phi4MultimodalModel",local:"transformers.Phi4MultimodalModel",headingTag:"h2"}}),je=new P({props:{name:"class transformers.Phi4MultimodalModel",anchor:"transformers.Phi4MultimodalModel",parameters:[{name:"config",val:": Phi4MultimodalConfig"}],parametersDescription:[{anchor:"transformers.Phi4MultimodalModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/phi4_multimodal#transformers.Phi4MultimodalConfig">Phi4MultimodalConfig</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"},{anchor:"transformers.Phi4MultimodalModel.config",description:"<strong>config</strong> &#x2014; Phi4MultimodalMMConfig",name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py#L1755"}}),ze=new P({props:{name:"forward",anchor:"transformers.Phi4MultimodalModel.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:"image_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_sizes",val:": typing.Optional[torch.LongTensor] = None"},{name:"image_attention_mask",val:" = None"},{name:"audio_input_features",val:": typing.Optional[torch.FloatTensor] = None"},{name:"audio_embed_sizes",val:" = None"},{name:"audio_attention_mask",val:" = 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:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Phi4MultimodalModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Phi4MultimodalModel.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 indices in <code>input_values</code>. 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>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.Phi4MultimodalModel.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.Phi4MultimodalModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code>)<code>, *optional*) -- 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\`.
See our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</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.Phi4MultimodalModel.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.Phi4MultimodalModel.forward.image_pixel_values",description:`<strong>image_pixel_values</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
If the input contains images, these correspond to the pixel values after transformations (as returned by
the Processor)`,name:"image_pixel_values"},{anchor:"transformers.Phi4MultimodalModel.forward.image_sizes",description:`<strong>image_sizes</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
If the input contains images, these correspond to size of each image.`,name:"image_sizes"},{anchor:"transformers.Phi4MultimodalModel.forward.image_attention_mask",description:`<strong>image_attention_mask</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Attention mask for the images.`,name:"image_attention_mask"},{anchor:"transformers.Phi4MultimodalModel.forward.audio_input_features",description:`<strong>audio_input_features</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
If the input contains audio samples, these correspond to the values after transformation (as returned by
the Processor).`,name:"audio_input_features"},{anchor:"transformers.Phi4MultimodalModel.forward.audio_embed_sizes",description:`<strong>audio_embed_sizes</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Size of the audio inputs.`,name:"audio_embed_sizes"},{anchor:"transformers.Phi4MultimodalModel.forward.audio_attention_mask",description:"<strong>audio_attention_mask</strong> (`torch.Tensor, <em>optional</em>) &#x2014;\nAttention mask for the audio inputs.",name:"audio_attention_mask"},{anchor:"transformers.Phi4MultimodalModel.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.Phi4MultimodalModel.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.Phi4MultimodalModel.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.Phi4MultimodalModel.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.Phi4MultimodalModel.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/phi4_multimodal/modeling_phi4_multimodal.py#L1793"}}),A=new Ao({props:{$$slots:{default:[an]},$$scope:{ctx:I}}}),Ze=new Z({props:{title:"Phi4MultimodalForCausalLM",local:"transformers.Phi4MultimodalForCausalLM",headingTag:"h2"}}),Fe=new P({props:{name:"class transformers.Phi4MultimodalForCausalLM",anchor:"transformers.Phi4MultimodalForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py#L2067"}}),Ve=new P({props:{name:"forward",anchor:"transformers.Phi4MultimodalForCausalLM.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:"image_pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_sizes",val:": typing.Optional[torch.LongTensor] = None"},{name:"image_attention_mask",val:" = None"},{name:"audio_input_features",val:": typing.Optional[torch.FloatTensor] = None"},{name:"audio_embed_sizes",val:" = None"},{name:"audio_attention_mask",val:" = 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:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"logits_to_keep",val:": typing.Union[int, torch.Tensor] = 0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Phi4MultimodalForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.Phi4MultimodalForCausalLM.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 indices in <code>input_values</code>. 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>.
<a href="../glossary#attention-mask">What are attention masks?</a></li>
</ul>`,name:"attention_mask"},{anchor:"transformers.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code>)<code>, *optional*) -- 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\`.
See our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</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.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.forward.image_pixel_values",description:`<strong>image_pixel_values</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
If the input contains images, these correspond to the pixel values after transformations (as returned by
the Processor)`,name:"image_pixel_values"},{anchor:"transformers.Phi4MultimodalForCausalLM.forward.image_sizes",description:`<strong>image_sizes</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
If the input contains images, these correspond to size of each image.`,name:"image_sizes"},{anchor:"transformers.Phi4MultimodalForCausalLM.forward.image_attention_mask",description:`<strong>image_attention_mask</strong> (<code>torch.LongTensor</code>, <em>optional</em>) &#x2014;
Attention mask for the images.`,name:"image_attention_mask"},{anchor:"transformers.Phi4MultimodalForCausalLM.forward.audio_input_features",description:`<strong>audio_input_features</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
If the input contains audio samples, these correspond to the values after transformation (as returned by
the Processor).`,name:"audio_input_features"},{anchor:"transformers.Phi4MultimodalForCausalLM.forward.audio_embed_sizes",description:`<strong>audio_embed_sizes</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014;
Size of the audio inputs.`,name:"audio_embed_sizes"},{anchor:"transformers.Phi4MultimodalForCausalLM.forward.audio_attention_mask",description:"<strong>audio_attention_mask</strong> (`torch.Tensor, <em>optional</em>) &#x2014;\nAttention mask for the audio inputs.",name:"audio_attention_mask"},{anchor:"transformers.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.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.Phi4MultimodalForCausalLM.forward.logits_to_keep",description:`<strong>logits_to_keep</strong> (<code>int</code> or <code>torch.Tensor</code>, <em>optional</em>) &#x2014;
If an <code>int</code>, compute logits for the last <code>logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
If a <code>torch.Tensor</code>, must be 1D corresponding to the indices to keep in the sequence length dimension.
This is useful when using packed tensor format (single dimension for batch and sequence length).`,name:"logits_to_keep"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py#L2099",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</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 (<code>&lt;class 'transformers.models.phi4_multimodal.configuration_phi4_multimodal.Phi4MultimodalConfig'&gt;</code>) 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>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),S=new Ao({props:{$$slots:{default:[sn]},$$scope:{ctx:I}}}),Y=new Xt({props:{anchor:"transformers.Phi4MultimodalForCausalLM.forward.example",$$slots:{default:[rn]},$$scope:{ctx:I}}}),We=new en({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/phi4_multimodal.md"}}),{c(){r=d("meta"),w=n(),M=d("p"),_=n(),c(y.$$.fragment),s=n(),c(b.$$.fragment),ct=n(),te=d("p"),te.textContent=Jo,ut=n(),oe=d("ul"),oe.innerHTML=Po,pt=n(),ne=d("p"),ne.innerHTML=$o,ht=n(),c(ae.$$.fragment),ft=n(),se=d("p"),se.innerHTML=ko,gt=n(),ie=d("p"),ie.textContent=Io,_t=n(),c(re.$$.fragment),Mt=n(),c(le.$$.fragment),Tt=n(),de=d("div"),c(me.$$.fragment),yt=n(),c(ce.$$.fragment),bt=n(),C=d("div"),c(ue.$$.fragment),Ht=n(),Ne=d("p"),Ne.textContent=Co,Qt=n(),R=d("div"),c(pe.$$.fragment),At=n(),Re=d("p"),Re.textContent=xo,St=n(),Ee=d("div"),c(he.$$.fragment),wt=n(),c(fe.$$.fragment),vt=n(),$=d("div"),c(ge.$$.fragment),Yt=n(),qe=d("p"),qe.textContent=Uo,Dt=n(),Le=d("p"),Le.innerHTML=jo,Ot=n(),E=d("div"),c(_e.$$.fragment),Kt=n(),Xe=d("p"),Xe.innerHTML=zo,eo=n(),q=d("div"),c(Me.$$.fragment),to=n(),He=d("p"),He.innerHTML=Zo,Jt=n(),c(Te.$$.fragment),Pt=n(),x=d("div"),c(ye.$$.fragment),oo=n(),Qe=d("p"),Qe.innerHTML=Fo,no=n(),Ae=d("p"),Ae.innerHTML=Vo,ao=n(),c(L.$$.fragment),$t=n(),c(be.$$.fragment),kt=n(),U=d("div"),c(we.$$.fragment),so=n(),Se=d("p"),Se.innerHTML=Wo,io=n(),Ye=d("p"),Ye.innerHTML=Bo,ro=n(),c(X.$$.fragment),It=n(),c(ve.$$.fragment),Ct=n(),j=d("div"),c(Je.$$.fragment),lo=n(),De=d("p"),De.innerHTML=Go,mo=n(),Oe=d("p"),Oe.innerHTML=No,co=n(),c(H.$$.fragment),xt=n(),c(Pe.$$.fragment),Ut=n(),G=d("div"),c($e.$$.fragment),uo=n(),Q=d("div"),c(ke.$$.fragment),po=n(),Ke=d("p"),Ke.textContent=Ro,jt=n(),c(Ie.$$.fragment),zt=n(),Ce=d("div"),c(xe.$$.fragment),Zt=n(),c(Ue.$$.fragment),Ft=n(),k=d("div"),c(je.$$.fragment),ho=n(),et=d("p"),et.innerHTML=Eo,fo=n(),tt=d("p"),tt.innerHTML=qo,go=n(),ot=d("p"),ot.innerHTML=Lo,_o=n(),W=d("div"),c(ze.$$.fragment),Mo=n(),nt=d("p"),nt.innerHTML=Xo,To=n(),c(A.$$.fragment),Vt=n(),c(Ze.$$.fragment),Wt=n(),N=d("div"),c(Fe.$$.fragment),yo=n(),F=d("div"),c(Ve.$$.fragment),bo=n(),at=d("p"),at.innerHTML=Ho,wo=n(),c(S.$$.fragment),vo=n(),c(Y.$$.fragment),Bt=n(),c(We.$$.fragment),Gt=n(),rt=d("p"),this.h()},l(e){const t=Ko("svelte-u9bgzb",document.head);r=m(t,"META",{name:!0,content:!0}),t.forEach(o),w=a(e),M=m(e,"P",{}),v(M).forEach(o),_=a(e),u(y.$$.fragment,e),s=a(e),u(b.$$.fragment,e),ct=a(e),te=m(e,"P",{"data-svelte-h":!0}),T(te)!=="svelte-1526epw"&&(te.textContent=Jo),ut=a(e),oe=m(e,"UL",{"data-svelte-h":!0}),T(oe)!=="svelte-l2qt1e"&&(oe.innerHTML=Po),pt=a(e),ne=m(e,"P",{"data-svelte-h":!0}),T(ne)!=="svelte-65m0g2"&&(ne.innerHTML=$o),ht=a(e),u(ae.$$.fragment,e),ft=a(e),se=m(e,"P",{"data-svelte-h":!0}),T(se)!=="svelte-i3igp6"&&(se.innerHTML=ko),gt=a(e),ie=m(e,"P",{"data-svelte-h":!0}),T(ie)!=="svelte-sdjbda"&&(ie.textContent=Io),_t=a(e),u(re.$$.fragment,e),Mt=a(e),u(le.$$.fragment,e),Tt=a(e),de=m(e,"DIV",{class:!0});var lt=v(de);u(me.$$.fragment,lt),lt.forEach(o),yt=a(e),u(ce.$$.fragment,e),bt=a(e),C=m(e,"DIV",{class:!0});var V=v(C);u(ue.$$.fragment,V),Ht=a(V),Ne=m(V,"P",{"data-svelte-h":!0}),T(Ne)!=="svelte-b4r8ob"&&(Ne.textContent=Co),Qt=a(V),R=m(V,"DIV",{class:!0});var Be=v(R);u(pe.$$.fragment,Be),At=a(Be),Re=m(Be,"P",{"data-svelte-h":!0}),T(Re)!=="svelte-1qsnex5"&&(Re.textContent=xo),Be.forEach(o),St=a(V),Ee=m(V,"DIV",{class:!0});var dt=v(Ee);u(he.$$.fragment,dt),dt.forEach(o),V.forEach(o),wt=a(e),u(fe.$$.fragment,e),vt=a(e),$=m(e,"DIV",{class:!0});var z=v($);u(ge.$$.fragment,z),Yt=a(z),qe=m(z,"P",{"data-svelte-h":!0}),T(qe)!=="svelte-jbcev"&&(qe.textContent=Uo),Dt=a(z),Le=m(z,"P",{"data-svelte-h":!0}),T(Le)!=="svelte-10g17bk"&&(Le.innerHTML=jo),Ot=a(z),E=m(z,"DIV",{class:!0});var Ge=v(E);u(_e.$$.fragment,Ge),Kt=a(Ge),Xe=m(Ge,"P",{"data-svelte-h":!0}),T(Xe)!=="svelte-1h7xkpm"&&(Xe.innerHTML=zo),Ge.forEach(o),eo=a(z),q=m(z,"DIV",{class:!0});var Rt=v(q);u(Me.$$.fragment,Rt),to=a(Rt),He=m(Rt,"P",{"data-svelte-h":!0}),T(He)!=="svelte-o7w0zk"&&(He.innerHTML=Zo),Rt.forEach(o),z.forEach(o),Jt=a(e),u(Te.$$.fragment,e),Pt=a(e),x=m(e,"DIV",{class:!0});var D=v(x);u(ye.$$.fragment,D),oo=a(D),Qe=m(D,"P",{"data-svelte-h":!0}),T(Qe)!=="svelte-1lsc5k8"&&(Qe.innerHTML=Fo),no=a(D),Ae=m(D,"P",{"data-svelte-h":!0}),T(Ae)!=="svelte-o55m63"&&(Ae.innerHTML=Vo),ao=a(D),u(L.$$.fragment,D),D.forEach(o),$t=a(e),u(be.$$.fragment,e),kt=a(e),U=m(e,"DIV",{class:!0});var O=v(U);u(we.$$.fragment,O),so=a(O),Se=m(O,"P",{"data-svelte-h":!0}),T(Se)!=="svelte-qqfrwy"&&(Se.innerHTML=Wo),io=a(O),Ye=m(O,"P",{"data-svelte-h":!0}),T(Ye)!=="svelte-o55m63"&&(Ye.innerHTML=Bo),ro=a(O),u(X.$$.fragment,O),O.forEach(o),It=a(e),u(ve.$$.fragment,e),Ct=a(e),j=m(e,"DIV",{class:!0});var K=v(j);u(Je.$$.fragment,K),lo=a(K),De=m(K,"P",{"data-svelte-h":!0}),T(De)!=="svelte-im1bjs"&&(De.innerHTML=Go),mo=a(K),Oe=m(K,"P",{"data-svelte-h":!0}),T(Oe)!=="svelte-o55m63"&&(Oe.innerHTML=No),co=a(K),u(H.$$.fragment,K),K.forEach(o),xt=a(e),u(Pe.$$.fragment,e),Ut=a(e),G=m(e,"DIV",{class:!0});var Et=v(G);u($e.$$.fragment,Et),uo=a(Et),Q=m(Et,"DIV",{class:!0});var qt=v(Q);u(ke.$$.fragment,qt),po=a(qt),Ke=m(qt,"P",{"data-svelte-h":!0}),T(Ke)!=="svelte-uw9oev"&&(Ke.textContent=Ro),qt.forEach(o),Et.forEach(o),jt=a(e),u(Ie.$$.fragment,e),zt=a(e),Ce=m(e,"DIV",{class:!0});var Qo=v(Ce);u(xe.$$.fragment,Qo),Qo.forEach(o),Zt=a(e),u(Ue.$$.fragment,e),Ft=a(e),k=m(e,"DIV",{class:!0});var B=v(k);u(je.$$.fragment,B),ho=a(B),et=m(B,"P",{"data-svelte-h":!0}),T(et)!=="svelte-1gy8nd5"&&(et.innerHTML=Eo),fo=a(B),tt=m(B,"P",{"data-svelte-h":!0}),T(tt)!=="svelte-hswkmf"&&(tt.innerHTML=qo),go=a(B),ot=m(B,"P",{"data-svelte-h":!0}),T(ot)!=="svelte-ylyb7g"&&(ot.innerHTML=Lo),_o=a(B),W=m(B,"DIV",{class:!0});var st=v(W);u(ze.$$.fragment,st),Mo=a(st),nt=m(st,"P",{"data-svelte-h":!0}),T(nt)!=="svelte-ib93n3"&&(nt.innerHTML=Xo),To=a(st),u(A.$$.fragment,st),st.forEach(o),B.forEach(o),Vt=a(e),u(Ze.$$.fragment,e),Wt=a(e),N=m(e,"DIV",{class:!0});var Lt=v(N);u(Fe.$$.fragment,Lt),yo=a(Lt),F=m(Lt,"DIV",{class:!0});var ee=v(F);u(Ve.$$.fragment,ee),bo=a(ee),at=m(ee,"P",{"data-svelte-h":!0}),T(at)!=="svelte-1if6ytj"&&(at.innerHTML=Ho),wo=a(ee),u(S.$$.fragment,ee),vo=a(ee),u(Y.$$.fragment,ee),ee.forEach(o),Lt.forEach(o),Bt=a(e),u(We.$$.fragment,e),Gt=a(e),rt=m(e,"P",{}),v(rt).forEach(o),this.h()},h(){J(r,"name","hf:doc:metadata"),J(r,"content",dn),J(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(R,"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(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(E,"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($,"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(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(j,"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(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(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(W,"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(F,"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")},m(e,t){l(document.head,r),i(e,w,t),i(e,M,t),i(e,_,t),p(y,e,t),i(e,s,t),p(b,e,t),i(e,ct,t),i(e,te,t),i(e,ut,t),i(e,oe,t),i(e,pt,t),i(e,ne,t),i(e,ht,t),p(ae,e,t),i(e,ft,t),i(e,se,t),i(e,gt,t),i(e,ie,t),i(e,_t,t),p(re,e,t),i(e,Mt,t),p(le,e,t),i(e,Tt,t),i(e,de,t),p(me,de,null),i(e,yt,t),p(ce,e,t),i(e,bt,t),i(e,C,t),p(ue,C,null),l(C,Ht),l(C,Ne),l(C,Qt),l(C,R),p(pe,R,null),l(R,At),l(R,Re),l(C,St),l(C,Ee),p(he,Ee,null),i(e,wt,t),p(fe,e,t),i(e,vt,t),i(e,$,t),p(ge,$,null),l($,Yt),l($,qe),l($,Dt),l($,Le),l($,Ot),l($,E),p(_e,E,null),l(E,Kt),l(E,Xe),l($,eo),l($,q),p(Me,q,null),l(q,to),l(q,He),i(e,Jt,t),p(Te,e,t),i(e,Pt,t),i(e,x,t),p(ye,x,null),l(x,oo),l(x,Qe),l(x,no),l(x,Ae),l(x,ao),p(L,x,null),i(e,$t,t),p(be,e,t),i(e,kt,t),i(e,U,t),p(we,U,null),l(U,so),l(U,Se),l(U,io),l(U,Ye),l(U,ro),p(X,U,null),i(e,It,t),p(ve,e,t),i(e,Ct,t),i(e,j,t),p(Je,j,null),l(j,lo),l(j,De),l(j,mo),l(j,Oe),l(j,co),p(H,j,null),i(e,xt,t),p(Pe,e,t),i(e,Ut,t),i(e,G,t),p($e,G,null),l(G,uo),l(G,Q),p(ke,Q,null),l(Q,po),l(Q,Ke),i(e,jt,t),p(Ie,e,t),i(e,zt,t),i(e,Ce,t),p(xe,Ce,null),i(e,Zt,t),p(Ue,e,t),i(e,Ft,t),i(e,k,t),p(je,k,null),l(k,ho),l(k,et),l(k,fo),l(k,tt),l(k,go),l(k,ot),l(k,_o),l(k,W),p(ze,W,null),l(W,Mo),l(W,nt),l(W,To),p(A,W,null),i(e,Vt,t),p(Ze,e,t),i(e,Wt,t),i(e,N,t),p(Fe,N,null),l(N,yo),l(N,F),p(Ve,F,null),l(F,bo),l(F,at),l(F,wo),p(S,F,null),l(F,vo),p(Y,F,null),i(e,Bt,t),p(We,e,t),i(e,Gt,t),i(e,rt,t),Nt=!0},p(e,[t]){const lt={};t&2&&(lt.$$scope={dirty:t,ctx:e}),L.$set(lt);const V={};t&2&&(V.$$scope={dirty:t,ctx:e}),X.$set(V);const Be={};t&2&&(Be.$$scope={dirty:t,ctx:e}),H.$set(Be);const dt={};t&2&&(dt.$$scope={dirty:t,ctx:e}),A.$set(dt);const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),S.$set(z);const Ge={};t&2&&(Ge.$$scope={dirty:t,ctx:e}),Y.$set(Ge)},i(e){Nt||(h(y.$$.fragment,e),h(b.$$.fragment,e),h(ae.$$.fragment,e),h(re.$$.fragment,e),h(le.$$.fragment,e),h(me.$$.fragment,e),h(ce.$$.fragment,e),h(ue.$$.fragment,e),h(pe.$$.fragment,e),h(he.$$.fragment,e),h(fe.$$.fragment,e),h(ge.$$.fragment,e),h(_e.$$.fragment,e),h(Me.$$.fragment,e),h(Te.$$.fragment,e),h(ye.$$.fragment,e),h(L.$$.fragment,e),h(be.$$.fragment,e),h(we.$$.fragment,e),h(X.$$.fragment,e),h(ve.$$.fragment,e),h(Je.$$.fragment,e),h(H.$$.fragment,e),h(Pe.$$.fragment,e),h($e.$$.fragment,e),h(ke.$$.fragment,e),h(Ie.$$.fragment,e),h(xe.$$.fragment,e),h(Ue.$$.fragment,e),h(je.$$.fragment,e),h(ze.$$.fragment,e),h(A.$$.fragment,e),h(Ze.$$.fragment,e),h(Fe.$$.fragment,e),h(Ve.$$.fragment,e),h(S.$$.fragment,e),h(Y.$$.fragment,e),h(We.$$.fragment,e),Nt=!0)},o(e){f(y.$$.fragment,e),f(b.$$.fragment,e),f(ae.$$.fragment,e),f(re.$$.fragment,e),f(le.$$.fragment,e),f(me.$$.fragment,e),f(ce.$$.fragment,e),f(ue.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(fe.$$.fragment,e),f(ge.$$.fragment,e),f(_e.$$.fragment,e),f(Me.$$.fragment,e),f(Te.$$.fragment,e),f(ye.$$.fragment,e),f(L.$$.fragment,e),f(be.$$.fragment,e),f(we.$$.fragment,e),f(X.$$.fragment,e),f(ve.$$.fragment,e),f(Je.$$.fragment,e),f(H.$$.fragment,e),f(Pe.$$.fragment,e),f($e.$$.fragment,e),f(ke.$$.fragment,e),f(Ie.$$.fragment,e),f(xe.$$.fragment,e),f(Ue.$$.fragment,e),f(je.$$.fragment,e),f(ze.$$.fragment,e),f(A.$$.fragment,e),f(Ze.$$.fragment,e),f(Fe.$$.fragment,e),f(Ve.$$.fragment,e),f(S.$$.fragment,e),f(Y.$$.fragment,e),f(We.$$.fragment,e),Nt=!1},d(e){e&&(o(w),o(M),o(_),o(s),o(ct),o(te),o(ut),o(oe),o(pt),o(ne),o(ht),o(ft),o(se),o(gt),o(ie),o(_t),o(Mt),o(Tt),o(de),o(yt),o(bt),o(C),o(wt),o(vt),o($),o(Jt),o(Pt),o(x),o($t),o(kt),o(U),o(It),o(Ct),o(j),o(xt),o(Ut),o(G),o(jt),o(zt),o(Ce),o(Zt),o(Ft),o(k),o(Vt),o(Wt),o(N),o(Bt),o(Gt),o(rt)),o(r),g(y,e),g(b,e),g(ae,e),g(re,e),g(le,e),g(me),g(ce,e),g(ue),g(pe),g(he),g(fe,e),g(ge),g(_e),g(Me),g(Te,e),g(ye),g(L),g(be,e),g(we),g(X),g(ve,e),g(Je),g(H),g(Pe,e),g($e),g(ke),g(Ie,e),g(xe),g(Ue,e),g(je),g(ze),g(A),g(Ze,e),g(Fe),g(Ve),g(S),g(Y),g(We,e)}}}const dn='{"title":"Phi4 Multimodal","local":"phi4-multimodal","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Phi4MultimodalFeatureExtractor","local":"transformers.Phi4MultimodalFeatureExtractor","sections":[],"depth":2},{"title":"Phi4MultimodalImageProcessorFast","local":"transformers.Phi4MultimodalImageProcessorFast","sections":[],"depth":2},{"title":"Phi4MultimodalProcessor","local":"transformers.Phi4MultimodalProcessor","sections":[],"depth":2},{"title":"Phi4MultimodalAudioConfig","local":"transformers.Phi4MultimodalAudioConfig","sections":[],"depth":2},{"title":"Phi4MultimodalVisionConfig","local":"transformers.Phi4MultimodalVisionConfig","sections":[],"depth":2},{"title":"Phi4MultimodalConfig","local":"transformers.Phi4MultimodalConfig","sections":[],"depth":2},{"title":"Phi4MultimodalAudioModel","local":"transformers.Phi4MultimodalAudioModel","sections":[],"depth":2},{"title":"Phi4MultimodalVisionModel","local":"transformers.Phi4MultimodalVisionModel","sections":[],"depth":2},{"title":"Phi4MultimodalModel","local":"transformers.Phi4MultimodalModel","sections":[],"depth":2},{"title":"Phi4MultimodalForCausalLM","local":"transformers.Phi4MultimodalForCausalLM","sections":[],"depth":2}],"depth":1}';function mn(I){return Yo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mn extends Do{constructor(r){super(),Oo(this,r,mn,ln,So,{})}}export{Mn as component};
