import{S as vl,i as bl,s as xl,e as s,k as h,w as x,t as i,M as Pl,c as a,d as o,m as u,a as r,x as P,h as l,b as c,N as Cl,G as e,g,y as C,q as $,o as w,B as I,v as $l,L as Vt}from"../../chunks/vendor-hf-doc-builder.js";import{T as pn}from"../../chunks/Tip-hf-doc-builder.js";import{D as j}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ot}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as H}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as At}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function wl(y){let d,b,_,m,v;return m=new Ot({props:{code:`from transformers import XCLIPTextModel, XCLIPTextConfig

# Initializing a XCLIPTextModel with microsoft/xclip-base-patch32 style configuration
configuration = XCLIPTextConfig()

# Initializing a XCLIPTextConfig from the microsoft/xclip-base-patch32 style configuration
model = XCLIPTextModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XCLIPTextModel, XCLIPTextConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a XCLIPTextModel with microsoft/xclip-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = XCLIPTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a XCLIPTextConfig from the microsoft/xclip-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XCLIPTextModel(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`}}),{c(){d=s("p"),b=i("Example:"),_=h(),x(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Example:"),p.forEach(o),_=u(n),P(m.$$.fragment,n)},m(n,p){g(n,d,p),e(d,b),g(n,_,p),C(m,n,p),v=!0},p:Vt,i(n){v||($(m.$$.fragment,n),v=!0)},o(n){w(m.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(_),I(m,n)}}}function Il(y){let d,b,_,m,v;return m=new Ot({props:{code:`from transformers import XCLIPVisionModel, XCLIPVisionConfig

# Initializing a XCLIPVisionModel with microsoft/xclip-base-patch32 style configuration
configuration = XCLIPVisionConfig()

# Initializing a XCLIPVisionModel model from the microsoft/xclip-base-patch32 style configuration
model = XCLIPVisionModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> XCLIPVisionModel, XCLIPVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a XCLIPVisionModel with microsoft/xclip-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = XCLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a XCLIPVisionModel model from the microsoft/xclip-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XCLIPVisionModel(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`}}),{c(){d=s("p"),b=i("Example:"),_=h(),x(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Example:"),p.forEach(o),_=u(n),P(m.$$.fragment,n)},m(n,p){g(n,d,p),e(d,b),g(n,_,p),C(m,n,p),v=!0},p:Vt,i(n){v||($(m.$$.fragment,n),v=!0)},o(n){w(m.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(_),I(m,n)}}}function yl(y){let d,b,_,m,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),m=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var L=r(_);m=l(L,"Module"),L.forEach(o),v=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){g(n,d,p),e(d,b),e(d,_),e(_,m),e(d,v)},d(n){n&&o(d)}}}function Ll(y){let d,b,_,m,v;return m=new Ot({props:{code:`from decord import VideoReader, cpu
import torch
import numpy as np

from transformers import AutoProcessor, AutoModel
from huggingface_hub import hf_hub_download

np.random.seed(0)


def sample_frame_indices(clip_len, frame_sample_rate, seg_len):
    converted_len = int(clip_len * frame_sample_rate)
    end_idx = np.random.randint(converted_len, seg_len)
    start_idx = end_idx - converted_len
    indices = np.linspace(start_idx, end_idx, num=clip_len)
    indices = np.clip(indices, start_idx, end_idx - 1).astype(np.int64)
    return indices


# video clip consists of 300 frames (10 seconds at 30 FPS)
file_path = hf_hub_download(
    repo_id="nielsr/video-demo", filename="eating_spaghetti.mp4", repo_type="dataset"
)
vr = VideoReader(file_path, num_threads=1, ctx=cpu(0))

# sample 16 frames
vr.seek(0)
indices = sample_frame_indices(clip_len=8, frame_sample_rate=1, seg_len=len(vr))
video = vr.get_batch(indices).asnumpy()

processor = AutoProcessor.from_pretrained("microsoft/xclip-base-patch32")
model = AutoModel.from_pretrained("microsoft/xclip-base-patch32")

inputs = processor(
    text=["playing sports", "eating spaghetti", "go shopping"],
    videos=list(video),
    return_tensors="pt",
    padding=True,
)

# forward pass
with torch.no_grad():
    outputs = model(**inputs)

logits_per_video = outputs.logits_per_video  # this is the video-text similarity score
probs = logits_per_video.softmax(dim=1)  # we can take the softmax to get the label probabilities
print(probs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> decord <span class="hljs-keyword">import</span> VideoReader, cpu
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">0</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sample_frame_indices</span>(<span class="hljs-params">clip_len, frame_sample_rate, seg_len</span>):
<span class="hljs-meta">... </span>    converted_len = <span class="hljs-built_in">int</span>(clip_len * frame_sample_rate)
<span class="hljs-meta">... </span>    end_idx = np.random.randint(converted_len, seg_len)
<span class="hljs-meta">... </span>    start_idx = end_idx - converted_len
<span class="hljs-meta">... </span>    indices = np.linspace(start_idx, end_idx, num=clip_len)
<span class="hljs-meta">... </span>    indices = np.clip(indices, start_idx, end_idx - <span class="hljs-number">1</span>).astype(np.int64)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> indices


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># video clip consists of 300 frames (10 seconds at 30 FPS)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>vr = VideoReader(file_path, num_threads=<span class="hljs-number">1</span>, ctx=cpu(<span class="hljs-number">0</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample 16 frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>vr.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(clip_len=<span class="hljs-number">8</span>, frame_sample_rate=<span class="hljs-number">1</span>, seg_len=<span class="hljs-built_in">len</span>(vr))
<span class="hljs-meta">&gt;&gt;&gt; </span>video = vr.get_batch(indices).asnumpy()

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;playing sports&quot;</span>, <span class="hljs-string">&quot;eating spaghetti&quot;</span>, <span class="hljs-string">&quot;go shopping&quot;</span>],
<span class="hljs-meta">... </span>    videos=<span class="hljs-built_in">list</span>(video),
<span class="hljs-meta">... </span>    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>,
<span class="hljs-meta">... </span>    padding=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># forward pass</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_video = outputs.logits_per_video  <span class="hljs-comment"># this is the video-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_video.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(probs)
tensor([[<span class="hljs-number">1.9496e-04</span>, <span class="hljs-number">9.9960e-01</span>, <span class="hljs-number">2.0825e-04</span>]])`}}),{c(){d=s("p"),b=i("Examples:"),_=h(),x(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Examples:"),p.forEach(o),_=u(n),P(m.$$.fragment,n)},m(n,p){g(n,d,p),e(d,b),g(n,_,p),C(m,n,p),v=!0},p:Vt,i(n){v||($(m.$$.fragment,n),v=!0)},o(n){w(m.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(_),I(m,n)}}}function Tl(y){let d,b,_,m,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),m=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var L=r(_);m=l(L,"Module"),L.forEach(o),v=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){g(n,d,p),e(d,b),e(d,_),e(_,m),e(d,v)},d(n){n&&o(d)}}}function Xl(y){let d,b,_,m,v;return m=new Ot({props:{code:`from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("microsoft/xclip-base-patch32")
model = AutoModel.from_pretrained("microsoft/xclip-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")
text_features = model.get_text_features(**inputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`}}),{c(){d=s("p"),b=i("Examples:"),_=h(),x(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Examples:"),p.forEach(o),_=u(n),P(m.$$.fragment,n)},m(n,p){g(n,d,p),e(d,b),g(n,_,p),C(m,n,p),v=!0},p:Vt,i(n){v||($(m.$$.fragment,n),v=!0)},o(n){w(m.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(_),I(m,n)}}}function jl(y){let d,b,_,m,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),m=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var L=r(_);m=l(L,"Module"),L.forEach(o),v=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){g(n,d,p),e(d,b),e(d,_),e(_,m),e(d,v)},d(n){n&&o(d)}}}function kl(y){let d,b,_,m,v;return m=new Ot({props:{code:`from decord import VideoReader, cpu
import torch
import numpy as np

from transformers import AutoProcessor, AutoModel
from huggingface_hub import hf_hub_download

np.random.seed(0)


def sample_frame_indices(clip_len, frame_sample_rate, seg_len):
    converted_len = int(clip_len * frame_sample_rate)
    end_idx = np.random.randint(converted_len, seg_len)
    start_idx = end_idx - converted_len
    indices = np.linspace(start_idx, end_idx, num=clip_len)
    indices = np.clip(indices, start_idx, end_idx - 1).astype(np.int64)
    return indices


# video clip consists of 300 frames (10 seconds at 30 FPS)
file_path = hf_hub_download(
    repo_id="nielsr/video-demo", filename="eating_spaghetti.mp4", repo_type="dataset"
)
vr = VideoReader(file_path, num_threads=1, ctx=cpu(0))

# sample 16 frames
vr.seek(0)
indices = sample_frame_indices(clip_len=8, frame_sample_rate=1, seg_len=len(vr))
video = vr.get_batch(indices).asnumpy()

processor = AutoProcessor.from_pretrained("microsoft/xclip-base-patch32")
model = AutoModel.from_pretrained("microsoft/xclip-base-patch32")

inputs = processor(videos=list(video), return_tensors="pt")

video_features = model.get_video_features(**inputs)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> decord <span class="hljs-keyword">import</span> VideoReader, cpu
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">0</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sample_frame_indices</span>(<span class="hljs-params">clip_len, frame_sample_rate, seg_len</span>):
<span class="hljs-meta">... </span>    converted_len = <span class="hljs-built_in">int</span>(clip_len * frame_sample_rate)
<span class="hljs-meta">... </span>    end_idx = np.random.randint(converted_len, seg_len)
<span class="hljs-meta">... </span>    start_idx = end_idx - converted_len
<span class="hljs-meta">... </span>    indices = np.linspace(start_idx, end_idx, num=clip_len)
<span class="hljs-meta">... </span>    indices = np.clip(indices, start_idx, end_idx - <span class="hljs-number">1</span>).astype(np.int64)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> indices


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># video clip consists of 300 frames (10 seconds at 30 FPS)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>vr = VideoReader(file_path, num_threads=<span class="hljs-number">1</span>, ctx=cpu(<span class="hljs-number">0</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample 16 frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>vr.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(clip_len=<span class="hljs-number">8</span>, frame_sample_rate=<span class="hljs-number">1</span>, seg_len=<span class="hljs-built_in">len</span>(vr))
<span class="hljs-meta">&gt;&gt;&gt; </span>video = vr.get_batch(indices).asnumpy()

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(videos=<span class="hljs-built_in">list</span>(video), return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>video_features = model.get_video_features(**inputs)`}}),{c(){d=s("p"),b=i("Examples:"),_=h(),x(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Examples:"),p.forEach(o),_=u(n),P(m.$$.fragment,n)},m(n,p){g(n,d,p),e(d,b),g(n,_,p),C(m,n,p),v=!0},p:Vt,i(n){v||($(m.$$.fragment,n),v=!0)},o(n){w(m.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(_),I(m,n)}}}function Ml(y){let d,b,_,m,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),m=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var L=r(_);m=l(L,"Module"),L.forEach(o),v=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){g(n,d,p),e(d,b),e(d,_),e(_,m),e(d,v)},d(n){n&&o(d)}}}function El(y){let d,b,_,m,v;return m=new Ot({props:{code:`from transformers import AutoTokenizer, XCLIPTextModel

model = XCLIPTextModel.from_pretrained("microsoft/xclip-base-patch32")
tokenizer = AutoTokenizer.from_pretrained("microsoft/xclip-base-patch32")

inputs = tokenizer(["a photo of a cat", "a photo of a dog"], padding=True, return_tensors="pt")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled (EOS token) states`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = XCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`}}),{c(){d=s("p"),b=i("Examples:"),_=h(),x(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Examples:"),p.forEach(o),_=u(n),P(m.$$.fragment,n)},m(n,p){g(n,d,p),e(d,b),g(n,_,p),C(m,n,p),v=!0},p:Vt,i(n){v||($(m.$$.fragment,n),v=!0)},o(n){w(m.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(_),I(m,n)}}}function zl(y){let d,b,_,m,v;return{c(){d=s("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s("code"),m=i("Module"),v=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a(p,"CODE",{});var L=r(_);m=l(L,"Module"),L.forEach(o),v=l(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(o)},m(n,p){g(n,d,p),e(d,b),e(d,_),e(_,m),e(d,v)},d(n){n&&o(d)}}}function ql(y){let d,b,_,m,v;return m=new Ot({props:{code:`from decord import VideoReader, cpu
import torch
import numpy as np

from transformers import AutoProcessor, XCLIPVisionModel
from huggingface_hub import hf_hub_download

np.random.seed(0)


def sample_frame_indices(clip_len, frame_sample_rate, seg_len):
    converted_len = int(clip_len * frame_sample_rate)
    end_idx = np.random.randint(converted_len, seg_len)
    start_idx = end_idx - converted_len
    indices = np.linspace(start_idx, end_idx, num=clip_len)
    indices = np.clip(indices, start_idx, end_idx - 1).astype(np.int64)
    return indices


# video clip consists of 300 frames (10 seconds at 30 FPS)
file_path = hf_hub_download(
    repo_id="nielsr/video-demo", filename="eating_spaghetti.mp4", repo_type="dataset"
)
vr = VideoReader(file_path, num_threads=1, ctx=cpu(0))

# sample 16 frames
vr.seek(0)
indices = sample_frame_indices(clip_len=8, frame_sample_rate=1, seg_len=len(vr))
video = vr.get_batch(indices).asnumpy()

processor = AutoProcessor.from_pretrained("microsoft/xclip-base-patch32")
model = XCLIPVisionModel.from_pretrained("microsoft/xclip-base-patch32")

pixel_values = processor(videos=list(video), return_tensors="pt").pixel_values

batch_size, num_frames, num_channels, height, width = pixel_values.shape
pixel_values = pixel_values.reshape(-1, num_channels, height, width)

outputs = model(pixel_values)
last_hidden_state = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> decord <span class="hljs-keyword">import</span> VideoReader, cpu
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, XCLIPVisionModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download

<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">0</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sample_frame_indices</span>(<span class="hljs-params">clip_len, frame_sample_rate, seg_len</span>):
<span class="hljs-meta">... </span>    converted_len = <span class="hljs-built_in">int</span>(clip_len * frame_sample_rate)
<span class="hljs-meta">... </span>    end_idx = np.random.randint(converted_len, seg_len)
<span class="hljs-meta">... </span>    start_idx = end_idx - converted_len
<span class="hljs-meta">... </span>    indices = np.linspace(start_idx, end_idx, num=clip_len)
<span class="hljs-meta">... </span>    indices = np.clip(indices, start_idx, end_idx - <span class="hljs-number">1</span>).astype(np.int64)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> indices


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># video clip consists of 300 frames (10 seconds at 30 FPS)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>vr = VideoReader(file_path, num_threads=<span class="hljs-number">1</span>, ctx=cpu(<span class="hljs-number">0</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample 16 frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>vr.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(clip_len=<span class="hljs-number">8</span>, frame_sample_rate=<span class="hljs-number">1</span>, seg_len=<span class="hljs-built_in">len</span>(vr))
<span class="hljs-meta">&gt;&gt;&gt; </span>video = vr.get_batch(indices).asnumpy()

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;microsoft/xclip-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = processor(videos=<span class="hljs-built_in">list</span>(video), return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values

<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size, num_frames, num_channels, height, width = pixel_values.shape
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = pixel_values.reshape(-<span class="hljs-number">1</span>, num_channels, height, width)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state`}}),{c(){d=s("p"),b=i("Examples:"),_=h(),x(m.$$.fragment)},l(n){d=a(n,"P",{});var p=r(d);b=l(p,"Examples:"),p.forEach(o),_=u(n),P(m.$$.fragment,n)},m(n,p){g(n,d,p),e(d,b),g(n,_,p),C(m,n,p),v=!0},p:Vt,i(n){v||($(m.$$.fragment,n),v=!0)},o(n){w(m.$$.fragment,n),v=!1},d(n){n&&o(d),n&&o(_),I(m,n)}}}function Al(y){let d,b,_,m,v,n,p,L,as,mn,U,ue,Xo,Ge,rs,jo,is,fn,S,ls,Je,ds,cs,Dt,ps,ms,hn,Nt,fs,un,St,ko,hs,gn,Ft,us,_n,Wt,Ke,gs,Rt,_s,vs,vn,ge,oi,bn,Ze,bs,Bt,xs,xn,F,Ps,Qe,Cs,$s,Ye,ws,Is,Pn,G,_e,Mo,et,ys,Eo,Ls,Cn,Ht,Ts,$n,Ut,tt,Xs,ot,js,ks,wn,Gt,Ms,In,J,ve,zo,nt,Es,qo,zs,yn,T,st,qs,Ao,As,Vs,k,Jt,Os,Ds,Kt,Ns,Ss,Zt,Fs,Ws,Vo,Rs,Bs,Qt,Hs,Us,Gs,be,at,Js,rt,Ks,Yt,Zs,Qs,Ys,xe,it,ea,lt,ta,eo,oa,na,Ln,K,Pe,Oo,dt,sa,Do,aa,Tn,M,ct,ra,W,to,ia,la,oo,da,ca,pt,pa,ma,fa,Z,ha,no,ua,ga,so,_a,va,ba,Ce,mt,xa,ft,Pa,ao,Ca,$a,Xn,Q,$e,No,ht,wa,So,Ia,jn,E,ut,ya,Y,La,ro,Ta,Xa,gt,ja,ka,Ma,ee,Ea,io,za,qa,lo,Aa,Va,Oa,we,kn,te,Ie,Fo,_t,Da,Wo,Na,Mn,z,vt,Sa,oe,Fa,co,Wa,Ra,bt,Ba,Ha,Ua,ne,Ga,po,Ja,Ka,mo,Za,Qa,Ya,ye,En,se,Le,Ro,xt,er,Bo,tr,zn,X,Pt,or,Ct,nr,$t,sr,ar,rr,q,wt,ir,ae,lr,fo,dr,cr,Ho,pr,mr,fr,Te,hr,Xe,ur,A,It,gr,re,_r,ho,vr,br,Uo,xr,Pr,Cr,je,$r,ke,wr,V,yt,Ir,ie,yr,uo,Lr,Tr,Go,Xr,jr,kr,Me,Mr,Ee,qn,le,ze,Jo,Lt,Er,Ko,zr,An,de,Tt,qr,O,Xt,Ar,ce,Vr,go,Or,Dr,Zo,Nr,Sr,Fr,qe,Wr,Ae,Vn,pe,Ve,Qo,jt,Rr,Yo,Br,On,me,kt,Hr,D,Mt,Ur,fe,Gr,_o,Jr,Kr,en,Zr,Qr,Yr,Oe,ei,De,Dn;return n=new H({}),Ge=new H({}),et=new H({}),nt=new H({}),st=new j({props:{name:"class transformers.XCLIPProcessor",anchor:"transformers.XCLIPProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XCLIPProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/videomae#transformers.VideoMAEImageProcessor">VideoMAEImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.XCLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/processing_x_clip.py#L25"}}),at=new j({props:{name:"batch_decode",anchor:"transformers.XCLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/processing_x_clip.py#L114"}}),it=new j({props:{name:"decode",anchor:"transformers.XCLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/processing_x_clip.py#L121"}}),dt=new H({}),ct=new j({props:{name:"class transformers.XCLIPConfig",anchor:"transformers.XCLIPConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"prompt_layers",val:" = 2"},{name:"prompt_alpha",val:" = 0.1"},{name:"prompt_hidden_act",val:" = 'quick_gelu'"},{name:"prompt_num_attention_heads",val:" = 8"},{name:"prompt_attention_dropout",val:" = 0.0"},{name:"prompt_projection_dropout",val:" = 0.0"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XCLIPConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPTextConfig">XCLIPTextConfig</a>.`,name:"text_config"},{anchor:"transformers.XCLIPConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPVisionConfig">XCLIPVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.XCLIPConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimentionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.XCLIPConfig.prompt_layers",description:`<strong>prompt_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
Number of layers in the video specific prompt generator.`,name:"prompt_layers"},{anchor:"transformers.XCLIPConfig.prompt_alpha",description:`<strong>prompt_alpha</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Alpha value to use in the video specific prompt generator.`,name:"prompt_alpha"},{anchor:"transformers.XCLIPConfig.prompt_hidden_act",description:`<strong>prompt_hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the video specific prompt generator. 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:"prompt_hidden_act"},{anchor:"transformers.XCLIPConfig.prompt_num_attention_heads",description:`<strong>prompt_num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads in the cross-attention of the video specific prompt generator.`,name:"prompt_num_attention_heads"},{anchor:"transformers.XCLIPConfig.prompt_attention_dropout",description:`<strong>prompt_attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for the attention layers in the video specific prompt generator.`,name:"prompt_attention_dropout"},{anchor:"transformers.XCLIPConfig.prompt_projection_dropout",description:`<strong>prompt_projection_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for the projection layers in the video specific prompt generator.`,name:"prompt_projection_dropout"},{anchor:"transformers.XCLIPConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> parameter. Default is used as per the original XCLIP implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.XCLIPConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/configuration_x_clip.py#L271"}}),mt=new j({props:{name:"from_text_vision_configs",anchor:"transformers.XCLIPConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": XCLIPTextConfig"},{name:"vision_config",val:": XCLIPVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/configuration_x_clip.py#L355",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPConfig"
>XCLIPConfig</a></p>
`}}),ht=new H({}),ut=new j({props:{name:"class transformers.XCLIPTextConfig",anchor:"transformers.XCLIPTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 512"},{name:"intermediate_size",val:" = 2048"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 77"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"dropout",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XCLIPTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the X-CLIP text 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/xclip#transformers.XCLIPModel">XCLIPModel</a>.`,name:"vocab_size"},{anchor:"transformers.XCLIPTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.XCLIPTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.XCLIPTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.XCLIPTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.XCLIPTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.XCLIPTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&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.XCLIPTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.XCLIPTextConfig.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.XCLIPTextConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.XCLIPTextConfig.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.XCLIPTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/configuration_x_clip.py#L32"}}),we=new At({props:{anchor:"transformers.XCLIPTextConfig.example",$$slots:{default:[wl]},$$scope:{ctx:y}}}),_t=new H({}),vt=new j({props:{name:"class transformers.XCLIPVisionConfig",anchor:"transformers.XCLIPVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"mit_hidden_size",val:" = 512"},{name:"mit_intermediate_size",val:" = 2048"},{name:"mit_num_hidden_layers",val:" = 1"},{name:"mit_num_attention_heads",val:" = 8"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"num_frames",val:" = 8"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"dropout",val:" = 0.0"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"drop_path_rate",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XCLIPVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.XCLIPVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.XCLIPVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.XCLIPVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.XCLIPVisionConfig.mit_hidden_size",description:`<strong>mit_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers of the Multiframe Integration Transformer (MIT).`,name:"mit_hidden_size"},{anchor:"transformers.XCLIPVisionConfig.mit_intermediate_size",description:`<strong>mit_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Multiframe Integration Transformer
(MIT).`,name:"mit_intermediate_size"},{anchor:"transformers.XCLIPVisionConfig.mit_num_hidden_layers",description:`<strong>mit_num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of hidden layers in the Multiframe Integration Transformer (MIT).`,name:"mit_num_hidden_layers"},{anchor:"transformers.XCLIPVisionConfig.mit_num_attention_heads",description:`<strong>mit_num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Multiframe Integration Transformer (MIT).`,name:"mit_num_attention_heads"},{anchor:"transformers.XCLIPVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.XCLIPVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.XCLIPVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&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>, <code>&quot;gelu_new&quot;</code> and \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.XCLIPVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.XCLIPVisionConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.XCLIPVisionConfig.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.XCLIPVisionConfig.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.XCLIPVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{anchor:"transformers.XCLIPVisionConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Stochastic depth rate.`,name:"drop_path_rate"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/configuration_x_clip.py#L141"}}),ye=new At({props:{anchor:"transformers.XCLIPVisionConfig.example",$$slots:{default:[Il]},$$scope:{ctx:y}}}),xt=new H({}),Pt=new j({props:{name:"class transformers.XCLIPModel",anchor:"transformers.XCLIPModel",parameters:[{name:"config",val:": XCLIPConfig"}],parametersDescription:[{anchor:"transformers.XCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPConfig">XCLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L1255"}}),wt=new j({props:{name:"forward",anchor:"transformers.XCLIPModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XCLIPModel.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.XCLIPModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XCLIPModel.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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XCLIPModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.XCLIPModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.XCLIPModel.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.XCLIPModel.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.XCLIPModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L1435",returnDescription:`
<p>A <code>transformers.models.x_clip.modeling_x_clip.XCLIPOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.x_clip.configuration_x_clip.XCLIPConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for video-text similarity.</li>
<li><strong>logits_per_video</strong> (<code>torch.FloatTensor</code> of shape <code>(video_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>video_embeds</code> and <code>text_embeds</code>. This represents the video-text
similarity scores.</li>
<li><strong>logits_per_text</strong> (<code>torch.FloatTensor</code> of shape <code>(text_batch_size, video_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>video_embeds</code>. This represents the text-video
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPTextModel"
>XCLIPTextModel</a>.</li>
<li><strong>video_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The video embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPVisionModel"
>XCLIPVisionModel</a>.</li>
<li><strong>text_model_output</strong> (<code>BaseModelOutputWithPooling</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPTextModel"
>XCLIPTextModel</a>.</li>
<li><strong>vision_model_output</strong> (<code>BaseModelOutputWithPooling</code>) \u2014 The output of the <a
  href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPVisionModel"
>XCLIPVisionModel</a>.</li>
<li><strong>mit_output</strong> (<code>BaseModelOutputWithPooling</code>) \u2014 The output of <code>XCLIPMultiframeIntegrationTransformer</code> (MIT for short).</li>
</ul>
`,returnType:`
<p><code>transformers.models.x_clip.modeling_x_clip.XCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new pn({props:{$$slots:{default:[yl]},$$scope:{ctx:y}}}),Xe=new At({props:{anchor:"transformers.XCLIPModel.forward.example",$$slots:{default:[Ll]},$$scope:{ctx:y}}}),It=new j({props:{name:"get_text_features",anchor:"transformers.XCLIPModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XCLIPModel.get_text_features.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.XCLIPModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XCLIPModel.get_text_features.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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XCLIPModel.get_text_features.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.XCLIPModel.get_text_features.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.XCLIPModel.get_text_features.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L1302",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPTextModel"
>XCLIPTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),je=new pn({props:{$$slots:{default:[Tl]},$$scope:{ctx:y}}}),ke=new At({props:{anchor:"transformers.XCLIPModel.get_text_features.example",$$slots:{default:[Xl]},$$scope:{ctx:y}}}),yt=new j({props:{name:"get_video_features",anchor:"transformers.XCLIPModel.get_video_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XCLIPModel.get_video_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.XCLIPModel.get_video_features.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.XCLIPModel.get_video_features.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.XCLIPModel.get_video_features.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L1349",returnDescription:`
<p>The video embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPVisionModel"
>XCLIPVisionModel</a> and
<code>XCLIPMultiframeIntegrationTransformer</code>.</p>
`,returnType:`
<p>video_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Me=new pn({props:{$$slots:{default:[jl]},$$scope:{ctx:y}}}),Ee=new At({props:{anchor:"transformers.XCLIPModel.get_video_features.example",$$slots:{default:[kl]},$$scope:{ctx:y}}}),Lt=new H({}),Tt=new j({props:{name:"class transformers.XCLIPTextModel",anchor:"transformers.XCLIPTextModel",parameters:[{name:"config",val:": XCLIPTextConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L825"}}),Xt=new j({props:{name:"forward",anchor:"transformers.XCLIPTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XCLIPTextModel.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.XCLIPTextModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.XCLIPTextModel.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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.XCLIPTextModel.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.XCLIPTextModel.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.XCLIPTextModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L840",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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.x_clip.configuration_x_clip.XCLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),qe=new pn({props:{$$slots:{default:[Ml]},$$scope:{ctx:y}}}),Ae=new At({props:{anchor:"transformers.XCLIPTextModel.forward.example",$$slots:{default:[El]},$$scope:{ctx:y}}}),jt=new H({}),kt=new j({props:{name:"class transformers.XCLIPVisionModel",anchor:"transformers.XCLIPVisionModel",parameters:[{name:"config",val:": XCLIPVisionConfig"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L1040"}}),Mt=new j({props:{name:"forward",anchor:"transformers.XCLIPVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.XCLIPVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/poolformer#transformers.PoolFormerFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.XCLIPVisionModel.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.XCLIPVisionModel.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.XCLIPVisionModel.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/x_clip/modeling_x_clip.py#L1053",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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.x_clip.configuration_x_clip.XCLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Oe=new pn({props:{$$slots:{default:[zl]},$$scope:{ctx:y}}}),De=new At({props:{anchor:"transformers.XCLIPVisionModel.forward.example",$$slots:{default:[ql]},$$scope:{ctx:y}}}),{c(){d=s("meta"),b=h(),_=s("h1"),m=s("a"),v=s("span"),x(n.$$.fragment),p=h(),L=s("span"),as=i("X-CLIP"),mn=h(),U=s("h2"),ue=s("a"),Xo=s("span"),x(Ge.$$.fragment),rs=h(),jo=s("span"),is=i("Overview"),fn=h(),S=s("p"),ls=i("The X-CLIP model was proposed in "),Je=s("a"),ds=i("Expanding Language-Image Pretrained Models for General Video Recognition"),cs=i(` by Bolin Ni, Houwen Peng, Minghao Chen, Songyang Zhang, Gaofeng Meng, Jianlong Fu, Shiming Xiang, Haibin Ling.
X-CLIP is a minimal extension of `),Dt=s("a"),ps=i("CLIP"),ms=i(" for video. The model consists of a text encoder, a cross-frame vision encoder, a multi-frame integration Transformer, and a video-specific prompt generator."),hn=h(),Nt=s("p"),fs=i("The abstract from the paper is the following:"),un=h(),St=s("p"),ko=s("em"),hs=i("Contrastive language-image pretraining has shown great success in learning visual-textual joint representation from web-scale data, demonstrating remarkable \u201Czero-shot\u201D generalization ability for various image tasks. However, how to effectively expand such new language-image pretraining methods to video domains is still an open problem. In this work, we present a simple yet effective approach that adapts the pretrained language-image models to video recognition directly, instead of pretraining a new model from scratch. More concretely, to capture the long-range dependencies of frames along the temporal dimension, we propose a cross-frame attention mechanism that explicitly exchanges information across frames. Such module is lightweight and can be plugged into pretrained language-image models seamlessly. Moreover, we propose a video-specific prompting scheme, which leverages video content information for generating discriminative textual prompts. Extensive experiments demonstrate that our approach is effective and can be generalized to different video recognition scenarios. In particular, under fully-supervised settings, our approach achieves a top-1 accuracy of 87.1% on Kinectics-400, while using 12 times fewer FLOPs compared with Swin-L and ViViT-H. In zero-shot experiments, our approach surpasses the current state-of-the-art methods by +7.6% and +14.9% in terms of top-1 accuracy under two popular protocols. In few-shot scenarios, our approach outperforms previous best methods by +32.1% and +23.1% when the labeled data is extremely limited."),gn=h(),Ft=s("p"),us=i("Tips:"),_n=h(),Wt=s("ul"),Ke=s("li"),gs=i("Usage of X-CLIP is identical to "),Rt=s("a"),_s=i("CLIP"),vs=i("."),vn=h(),ge=s("img"),bn=h(),Ze=s("small"),bs=i("X-CLIP architecture. Taken from the "),Bt=s("a"),xs=i("original paper."),xn=h(),F=s("p"),Ps=i("This model was contributed by "),Qe=s("a"),Cs=i("nielsr"),$s=i(`.
The original code can be found `),Ye=s("a"),ws=i("here"),Is=i("."),Pn=h(),G=s("h2"),_e=s("a"),Mo=s("span"),x(et.$$.fragment),ys=h(),Eo=s("span"),Ls=i("Resources"),Cn=h(),Ht=s("p"),Ts=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with X-CLIP."),$n=h(),Ut=s("ul"),tt=s("li"),Xs=i("Demo notebooks for X-CLIP can be found "),ot=s("a"),js=i("here"),ks=i("."),wn=h(),Gt=s("p"),Ms=i("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),In=h(),J=s("h2"),ve=s("a"),zo=s("span"),x(nt.$$.fragment),Es=h(),qo=s("span"),zs=i("XCLIPProcessor"),yn=h(),T=s("div"),x(st.$$.fragment),qs=h(),Ao=s("p"),As=i("Constructs an X-CLIP processor which wraps a VideoMAE image processor and a CLIP tokenizer into a single processor."),Vs=h(),k=s("p"),Jt=s("a"),Os=i("XCLIPProcessor"),Ds=i(" offers all the functionalities of "),Kt=s("a"),Ns=i("VideoMAEImageProcessor"),Ss=i(" and "),Zt=s("a"),Fs=i("CLIPTokenizerFast"),Ws=i(`. See the
`),Vo=s("code"),Rs=i("__call__()"),Bs=i(" and "),Qt=s("a"),Hs=i("decode()"),Us=i(" for more information."),Gs=h(),be=s("div"),x(at.$$.fragment),Js=h(),rt=s("p"),Ks=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Yt=s("a"),Zs=i("batch_decode()"),Qs=i(`. Please
refer to the docstring of this method for more information.`),Ys=h(),xe=s("div"),x(it.$$.fragment),ea=h(),lt=s("p"),ta=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),eo=s("a"),oa=i("decode()"),na=i(`. Please refer to
the docstring of this method for more information.`),Ln=h(),K=s("h2"),Pe=s("a"),Oo=s("span"),x(dt.$$.fragment),sa=h(),Do=s("span"),aa=i("XCLIPConfig"),Tn=h(),M=s("div"),x(ct.$$.fragment),ra=h(),W=s("p"),to=s("a"),ia=i("XCLIPConfig"),la=i(" is the configuration class to store the configuration of a "),oo=s("a"),da=i("XCLIPModel"),ca=i(`. It is used to
instantiate X-CLIP model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the X-CLIP
`),pt=s("a"),pa=i("microsoft/xclip-base-patch32"),ma=i(" architecture."),fa=h(),Z=s("p"),ha=i("Configuration objects inherit from "),no=s("a"),ua=i("PretrainedConfig"),ga=i(` and can be used to control the model outputs. Read the
documentation from `),so=s("a"),_a=i("PretrainedConfig"),va=i(" for more information."),ba=h(),Ce=s("div"),x(mt.$$.fragment),xa=h(),ft=s("p"),Pa=i("Instantiate a "),ao=s("a"),Ca=i("XCLIPConfig"),$a=i(` (or a derived class) from xclip text model configuration and xclip vision model
configuration.`),Xn=h(),Q=s("h2"),$e=s("a"),No=s("span"),x(ht.$$.fragment),wa=h(),So=s("span"),Ia=i("XCLIPTextConfig"),jn=h(),E=s("div"),x(ut.$$.fragment),ya=h(),Y=s("p"),La=i("This is the configuration class to store the configuration of a "),ro=s("a"),Ta=i("XCLIPModel"),Xa=i(`. It is used to instantiate an X-CLIP
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 X-CLIP
`),gt=s("a"),ja=i("microsoft/xclip-base-patch32"),ka=i(" architecture."),Ma=h(),ee=s("p"),Ea=i("Configuration objects inherit from "),io=s("a"),za=i("PretrainedConfig"),qa=i(` and can be used to control the model outputs. Read the
documentation from `),lo=s("a"),Aa=i("PretrainedConfig"),Va=i(" for more information."),Oa=h(),x(we.$$.fragment),kn=h(),te=s("h2"),Ie=s("a"),Fo=s("span"),x(_t.$$.fragment),Da=h(),Wo=s("span"),Na=i("XCLIPVisionConfig"),Mn=h(),z=s("div"),x(vt.$$.fragment),Sa=h(),oe=s("p"),Fa=i("This is the configuration class to store the configuration of a "),co=s("a"),Wa=i("XCLIPModel"),Ra=i(`. It is used to instantiate an X-CLIP
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 X-CLIP
`),bt=s("a"),Ba=i("microsoft/xclip-base-patch32"),Ha=i(" architecture."),Ua=h(),ne=s("p"),Ga=i("Configuration objects inherit from "),po=s("a"),Ja=i("PretrainedConfig"),Ka=i(` and can be used to control the model outputs. Read the
documentation from `),mo=s("a"),Za=i("PretrainedConfig"),Qa=i(" for more information."),Ya=h(),x(ye.$$.fragment),En=h(),se=s("h2"),Le=s("a"),Ro=s("span"),x(xt.$$.fragment),er=h(),Bo=s("span"),tr=i("XCLIPModel"),zn=h(),X=s("div"),x(Pt.$$.fragment),or=h(),Ct=s("p"),nr=i("This model is a PyTorch "),$t=s("a"),sr=i("torch.nn.Module"),ar=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rr=h(),q=s("div"),x(wt.$$.fragment),ir=h(),ae=s("p"),lr=i("The "),fo=s("a"),dr=i("XCLIPModel"),cr=i(" forward method, overrides the "),Ho=s("code"),pr=i("__call__"),mr=i(" special method."),fr=h(),x(Te.$$.fragment),hr=h(),x(Xe.$$.fragment),ur=h(),A=s("div"),x(It.$$.fragment),gr=h(),re=s("p"),_r=i("The "),ho=s("a"),vr=i("XCLIPModel"),br=i(" forward method, overrides the "),Uo=s("code"),xr=i("__call__"),Pr=i(" special method."),Cr=h(),x(je.$$.fragment),$r=h(),x(ke.$$.fragment),wr=h(),V=s("div"),x(yt.$$.fragment),Ir=h(),ie=s("p"),yr=i("The "),uo=s("a"),Lr=i("XCLIPModel"),Tr=i(" forward method, overrides the "),Go=s("code"),Xr=i("__call__"),jr=i(" special method."),kr=h(),x(Me.$$.fragment),Mr=h(),x(Ee.$$.fragment),qn=h(),le=s("h2"),ze=s("a"),Jo=s("span"),x(Lt.$$.fragment),Er=h(),Ko=s("span"),zr=i("XCLIPTextModel"),An=h(),de=s("div"),x(Tt.$$.fragment),qr=h(),O=s("div"),x(Xt.$$.fragment),Ar=h(),ce=s("p"),Vr=i("The "),go=s("a"),Or=i("XCLIPTextModel"),Dr=i(" forward method, overrides the "),Zo=s("code"),Nr=i("__call__"),Sr=i(" special method."),Fr=h(),x(qe.$$.fragment),Wr=h(),x(Ae.$$.fragment),Vn=h(),pe=s("h2"),Ve=s("a"),Qo=s("span"),x(jt.$$.fragment),Rr=h(),Yo=s("span"),Br=i("XCLIPVisionModel"),On=h(),me=s("div"),x(kt.$$.fragment),Hr=h(),D=s("div"),x(Mt.$$.fragment),Ur=h(),fe=s("p"),Gr=i("The "),_o=s("a"),Jr=i("XCLIPVisionModel"),Kr=i(" forward method, overrides the "),en=s("code"),Zr=i("__call__"),Qr=i(" special method."),Yr=h(),x(Oe.$$.fragment),ei=h(),x(De.$$.fragment),this.h()},l(t){const f=Pl('[data-svelte="svelte-1phssyn"]',document.head);d=a(f,"META",{name:!0,content:!0}),f.forEach(o),b=u(t),_=a(t,"H1",{class:!0});var Et=r(_);m=a(Et,"A",{id:!0,class:!0,href:!0});var tn=r(m);v=a(tn,"SPAN",{});var on=r(v);P(n.$$.fragment,on),on.forEach(o),tn.forEach(o),p=u(Et),L=a(Et,"SPAN",{});var nn=r(L);as=l(nn,"X-CLIP"),nn.forEach(o),Et.forEach(o),mn=u(t),U=a(t,"H2",{class:!0});var zt=r(U);ue=a(zt,"A",{id:!0,class:!0,href:!0});var sn=r(ue);Xo=a(sn,"SPAN",{});var an=r(Xo);P(Ge.$$.fragment,an),an.forEach(o),sn.forEach(o),rs=u(zt),jo=a(zt,"SPAN",{});var rn=r(jo);is=l(rn,"Overview"),rn.forEach(o),zt.forEach(o),fn=u(t),S=a(t,"P",{});var he=r(S);ls=l(he,"The X-CLIP model was proposed in "),Je=a(he,"A",{href:!0,rel:!0});var ln=r(Je);ds=l(ln,"Expanding Language-Image Pretrained Models for General Video Recognition"),ln.forEach(o),cs=l(he,` by Bolin Ni, Houwen Peng, Minghao Chen, Songyang Zhang, Gaofeng Meng, Jianlong Fu, Shiming Xiang, Haibin Ling.
X-CLIP is a minimal extension of `),Dt=a(he,"A",{href:!0});var dn=r(Dt);ps=l(dn,"CLIP"),dn.forEach(o),ms=l(he," for video. The model consists of a text encoder, a cross-frame vision encoder, a multi-frame integration Transformer, and a video-specific prompt generator."),he.forEach(o),hn=u(t),Nt=a(t,"P",{});var cn=r(Nt);fs=l(cn,"The abstract from the paper is the following:"),cn.forEach(o),un=u(t),St=a(t,"P",{});var ni=r(St);ko=a(ni,"EM",{});var si=r(ko);hs=l(si,"Contrastive language-image pretraining has shown great success in learning visual-textual joint representation from web-scale data, demonstrating remarkable \u201Czero-shot\u201D generalization ability for various image tasks. However, how to effectively expand such new language-image pretraining methods to video domains is still an open problem. In this work, we present a simple yet effective approach that adapts the pretrained language-image models to video recognition directly, instead of pretraining a new model from scratch. More concretely, to capture the long-range dependencies of frames along the temporal dimension, we propose a cross-frame attention mechanism that explicitly exchanges information across frames. Such module is lightweight and can be plugged into pretrained language-image models seamlessly. Moreover, we propose a video-specific prompting scheme, which leverages video content information for generating discriminative textual prompts. Extensive experiments demonstrate that our approach is effective and can be generalized to different video recognition scenarios. In particular, under fully-supervised settings, our approach achieves a top-1 accuracy of 87.1% on Kinectics-400, while using 12 times fewer FLOPs compared with Swin-L and ViViT-H. In zero-shot experiments, our approach surpasses the current state-of-the-art methods by +7.6% and +14.9% in terms of top-1 accuracy under two popular protocols. In few-shot scenarios, our approach outperforms previous best methods by +32.1% and +23.1% when the labeled data is extremely limited."),si.forEach(o),ni.forEach(o),gn=u(t),Ft=a(t,"P",{});var ai=r(Ft);us=l(ai,"Tips:"),ai.forEach(o),_n=u(t),Wt=a(t,"UL",{});var ri=r(Wt);Ke=a(ri,"LI",{});var Nn=r(Ke);gs=l(Nn,"Usage of X-CLIP is identical to "),Rt=a(Nn,"A",{href:!0});var ii=r(Rt);_s=l(ii,"CLIP"),ii.forEach(o),vs=l(Nn,"."),Nn.forEach(o),ri.forEach(o),vn=u(t),ge=a(t,"IMG",{src:!0,alt:!0,width:!0}),bn=u(t),Ze=a(t,"SMALL",{});var ti=r(Ze);bs=l(ti,"X-CLIP architecture. Taken from the "),Bt=a(ti,"A",{href:!0});var li=r(Bt);xs=l(li,"original paper."),li.forEach(o),ti.forEach(o),xn=u(t),F=a(t,"P",{});var vo=r(F);Ps=l(vo,"This model was contributed by "),Qe=a(vo,"A",{href:!0,rel:!0});var di=r(Qe);Cs=l(di,"nielsr"),di.forEach(o),$s=l(vo,`.
The original code can be found `),Ye=a(vo,"A",{href:!0,rel:!0});var ci=r(Ye);ws=l(ci,"here"),ci.forEach(o),Is=l(vo,"."),vo.forEach(o),Pn=u(t),G=a(t,"H2",{class:!0});var Sn=r(G);_e=a(Sn,"A",{id:!0,class:!0,href:!0});var pi=r(_e);Mo=a(pi,"SPAN",{});var mi=r(Mo);P(et.$$.fragment,mi),mi.forEach(o),pi.forEach(o),ys=u(Sn),Eo=a(Sn,"SPAN",{});var fi=r(Eo);Ls=l(fi,"Resources"),fi.forEach(o),Sn.forEach(o),Cn=u(t),Ht=a(t,"P",{});var hi=r(Ht);Ts=l(hi,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with X-CLIP."),hi.forEach(o),$n=u(t),Ut=a(t,"UL",{});var ui=r(Ut);tt=a(ui,"LI",{});var Fn=r(tt);Xs=l(Fn,"Demo notebooks for X-CLIP can be found "),ot=a(Fn,"A",{href:!0,rel:!0});var gi=r(ot);js=l(gi,"here"),gi.forEach(o),ks=l(Fn,"."),Fn.forEach(o),ui.forEach(o),wn=u(t),Gt=a(t,"P",{});var _i=r(Gt);Ms=l(_i,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),_i.forEach(o),In=u(t),J=a(t,"H2",{class:!0});var Wn=r(J);ve=a(Wn,"A",{id:!0,class:!0,href:!0});var vi=r(ve);zo=a(vi,"SPAN",{});var bi=r(zo);P(nt.$$.fragment,bi),bi.forEach(o),vi.forEach(o),Es=u(Wn),qo=a(Wn,"SPAN",{});var xi=r(qo);zs=l(xi,"XCLIPProcessor"),xi.forEach(o),Wn.forEach(o),yn=u(t),T=a(t,"DIV",{class:!0});var R=r(T);P(st.$$.fragment,R),qs=u(R),Ao=a(R,"P",{});var Pi=r(Ao);As=l(Pi,"Constructs an X-CLIP processor which wraps a VideoMAE image processor and a CLIP tokenizer into a single processor."),Pi.forEach(o),Vs=u(R),k=a(R,"P",{});var N=r(k);Jt=a(N,"A",{href:!0});var Ci=r(Jt);Os=l(Ci,"XCLIPProcessor"),Ci.forEach(o),Ds=l(N," offers all the functionalities of "),Kt=a(N,"A",{href:!0});var $i=r(Kt);Ns=l($i,"VideoMAEImageProcessor"),$i.forEach(o),Ss=l(N," and "),Zt=a(N,"A",{href:!0});var wi=r(Zt);Fs=l(wi,"CLIPTokenizerFast"),wi.forEach(o),Ws=l(N,`. See the
`),Vo=a(N,"CODE",{});var Ii=r(Vo);Rs=l(Ii,"__call__()"),Ii.forEach(o),Bs=l(N," and "),Qt=a(N,"A",{href:!0});var yi=r(Qt);Hs=l(yi,"decode()"),yi.forEach(o),Us=l(N," for more information."),N.forEach(o),Gs=u(R),be=a(R,"DIV",{class:!0});var Rn=r(be);P(at.$$.fragment,Rn),Js=u(Rn),rt=a(Rn,"P",{});var Bn=r(rt);Ks=l(Bn,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Yt=a(Bn,"A",{href:!0});var Li=r(Yt);Zs=l(Li,"batch_decode()"),Li.forEach(o),Qs=l(Bn,`. Please
refer to the docstring of this method for more information.`),Bn.forEach(o),Rn.forEach(o),Ys=u(R),xe=a(R,"DIV",{class:!0});var Hn=r(xe);P(it.$$.fragment,Hn),ea=u(Hn),lt=a(Hn,"P",{});var Un=r(lt);ta=l(Un,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),eo=a(Un,"A",{href:!0});var Ti=r(eo);oa=l(Ti,"decode()"),Ti.forEach(o),na=l(Un,`. Please refer to
the docstring of this method for more information.`),Un.forEach(o),Hn.forEach(o),R.forEach(o),Ln=u(t),K=a(t,"H2",{class:!0});var Gn=r(K);Pe=a(Gn,"A",{id:!0,class:!0,href:!0});var Xi=r(Pe);Oo=a(Xi,"SPAN",{});var ji=r(Oo);P(dt.$$.fragment,ji),ji.forEach(o),Xi.forEach(o),sa=u(Gn),Do=a(Gn,"SPAN",{});var ki=r(Do);aa=l(ki,"XCLIPConfig"),ki.forEach(o),Gn.forEach(o),Tn=u(t),M=a(t,"DIV",{class:!0});var Ne=r(M);P(ct.$$.fragment,Ne),ra=u(Ne),W=a(Ne,"P",{});var qt=r(W);to=a(qt,"A",{href:!0});var Mi=r(to);ia=l(Mi,"XCLIPConfig"),Mi.forEach(o),la=l(qt," is the configuration class to store the configuration of a "),oo=a(qt,"A",{href:!0});var Ei=r(oo);da=l(Ei,"XCLIPModel"),Ei.forEach(o),ca=l(qt,`. It is used to
instantiate X-CLIP model according to the specified arguments, defining the text model and vision model configs.
Instantiating a configuration with the defaults will yield a similar configuration to that of the X-CLIP
`),pt=a(qt,"A",{href:!0,rel:!0});var zi=r(pt);pa=l(zi,"microsoft/xclip-base-patch32"),zi.forEach(o),ma=l(qt," architecture."),qt.forEach(o),fa=u(Ne),Z=a(Ne,"P",{});var bo=r(Z);ha=l(bo,"Configuration objects inherit from "),no=a(bo,"A",{href:!0});var qi=r(no);ua=l(qi,"PretrainedConfig"),qi.forEach(o),ga=l(bo,` and can be used to control the model outputs. Read the
documentation from `),so=a(bo,"A",{href:!0});var Ai=r(so);_a=l(Ai,"PretrainedConfig"),Ai.forEach(o),va=l(bo," for more information."),bo.forEach(o),ba=u(Ne),Ce=a(Ne,"DIV",{class:!0});var Jn=r(Ce);P(mt.$$.fragment,Jn),xa=u(Jn),ft=a(Jn,"P",{});var Kn=r(ft);Pa=l(Kn,"Instantiate a "),ao=a(Kn,"A",{href:!0});var Vi=r(ao);Ca=l(Vi,"XCLIPConfig"),Vi.forEach(o),$a=l(Kn,` (or a derived class) from xclip text model configuration and xclip vision model
configuration.`),Kn.forEach(o),Jn.forEach(o),Ne.forEach(o),Xn=u(t),Q=a(t,"H2",{class:!0});var Zn=r(Q);$e=a(Zn,"A",{id:!0,class:!0,href:!0});var Oi=r($e);No=a(Oi,"SPAN",{});var Di=r(No);P(ht.$$.fragment,Di),Di.forEach(o),Oi.forEach(o),wa=u(Zn),So=a(Zn,"SPAN",{});var Ni=r(So);Ia=l(Ni,"XCLIPTextConfig"),Ni.forEach(o),Zn.forEach(o),jn=u(t),E=a(t,"DIV",{class:!0});var Se=r(E);P(ut.$$.fragment,Se),ya=u(Se),Y=a(Se,"P",{});var xo=r(Y);La=l(xo,"This is the configuration class to store the configuration of a "),ro=a(xo,"A",{href:!0});var Si=r(ro);Ta=l(Si,"XCLIPModel"),Si.forEach(o),Xa=l(xo,`. It is used to instantiate an X-CLIP
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 X-CLIP
`),gt=a(xo,"A",{href:!0,rel:!0});var Fi=r(gt);ja=l(Fi,"microsoft/xclip-base-patch32"),Fi.forEach(o),ka=l(xo," architecture."),xo.forEach(o),Ma=u(Se),ee=a(Se,"P",{});var Po=r(ee);Ea=l(Po,"Configuration objects inherit from "),io=a(Po,"A",{href:!0});var Wi=r(io);za=l(Wi,"PretrainedConfig"),Wi.forEach(o),qa=l(Po,` and can be used to control the model outputs. Read the
documentation from `),lo=a(Po,"A",{href:!0});var Ri=r(lo);Aa=l(Ri,"PretrainedConfig"),Ri.forEach(o),Va=l(Po," for more information."),Po.forEach(o),Oa=u(Se),P(we.$$.fragment,Se),Se.forEach(o),kn=u(t),te=a(t,"H2",{class:!0});var Qn=r(te);Ie=a(Qn,"A",{id:!0,class:!0,href:!0});var Bi=r(Ie);Fo=a(Bi,"SPAN",{});var Hi=r(Fo);P(_t.$$.fragment,Hi),Hi.forEach(o),Bi.forEach(o),Da=u(Qn),Wo=a(Qn,"SPAN",{});var Ui=r(Wo);Na=l(Ui,"XCLIPVisionConfig"),Ui.forEach(o),Qn.forEach(o),Mn=u(t),z=a(t,"DIV",{class:!0});var Fe=r(z);P(vt.$$.fragment,Fe),Sa=u(Fe),oe=a(Fe,"P",{});var Co=r(oe);Fa=l(Co,"This is the configuration class to store the configuration of a "),co=a(Co,"A",{href:!0});var Gi=r(co);Wa=l(Gi,"XCLIPModel"),Gi.forEach(o),Ra=l(Co,`. It is used to instantiate an X-CLIP
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 X-CLIP
`),bt=a(Co,"A",{href:!0,rel:!0});var Ji=r(bt);Ba=l(Ji,"microsoft/xclip-base-patch32"),Ji.forEach(o),Ha=l(Co," architecture."),Co.forEach(o),Ua=u(Fe),ne=a(Fe,"P",{});var $o=r(ne);Ga=l($o,"Configuration objects inherit from "),po=a($o,"A",{href:!0});var Ki=r(po);Ja=l(Ki,"PretrainedConfig"),Ki.forEach(o),Ka=l($o,` and can be used to control the model outputs. Read the
documentation from `),mo=a($o,"A",{href:!0});var Zi=r(mo);Za=l(Zi,"PretrainedConfig"),Zi.forEach(o),Qa=l($o," for more information."),$o.forEach(o),Ya=u(Fe),P(ye.$$.fragment,Fe),Fe.forEach(o),En=u(t),se=a(t,"H2",{class:!0});var Yn=r(se);Le=a(Yn,"A",{id:!0,class:!0,href:!0});var Qi=r(Le);Ro=a(Qi,"SPAN",{});var Yi=r(Ro);P(xt.$$.fragment,Yi),Yi.forEach(o),Qi.forEach(o),er=u(Yn),Bo=a(Yn,"SPAN",{});var el=r(Bo);tr=l(el,"XCLIPModel"),el.forEach(o),Yn.forEach(o),zn=u(t),X=a(t,"DIV",{class:!0});var B=r(X);P(Pt.$$.fragment,B),or=u(B),Ct=a(B,"P",{});var es=r(Ct);nr=l(es,"This model is a PyTorch "),$t=a(es,"A",{href:!0,rel:!0});var tl=r($t);sr=l(tl,"torch.nn.Module"),tl.forEach(o),ar=l(es,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),es.forEach(o),rr=u(B),q=a(B,"DIV",{class:!0});var We=r(q);P(wt.$$.fragment,We),ir=u(We),ae=a(We,"P",{});var wo=r(ae);lr=l(wo,"The "),fo=a(wo,"A",{href:!0});var ol=r(fo);dr=l(ol,"XCLIPModel"),ol.forEach(o),cr=l(wo," forward method, overrides the "),Ho=a(wo,"CODE",{});var nl=r(Ho);pr=l(nl,"__call__"),nl.forEach(o),mr=l(wo," special method."),wo.forEach(o),fr=u(We),P(Te.$$.fragment,We),hr=u(We),P(Xe.$$.fragment,We),We.forEach(o),ur=u(B),A=a(B,"DIV",{class:!0});var Re=r(A);P(It.$$.fragment,Re),gr=u(Re),re=a(Re,"P",{});var Io=r(re);_r=l(Io,"The "),ho=a(Io,"A",{href:!0});var sl=r(ho);vr=l(sl,"XCLIPModel"),sl.forEach(o),br=l(Io," forward method, overrides the "),Uo=a(Io,"CODE",{});var al=r(Uo);xr=l(al,"__call__"),al.forEach(o),Pr=l(Io," special method."),Io.forEach(o),Cr=u(Re),P(je.$$.fragment,Re),$r=u(Re),P(ke.$$.fragment,Re),Re.forEach(o),wr=u(B),V=a(B,"DIV",{class:!0});var Be=r(V);P(yt.$$.fragment,Be),Ir=u(Be),ie=a(Be,"P",{});var yo=r(ie);yr=l(yo,"The "),uo=a(yo,"A",{href:!0});var rl=r(uo);Lr=l(rl,"XCLIPModel"),rl.forEach(o),Tr=l(yo," forward method, overrides the "),Go=a(yo,"CODE",{});var il=r(Go);Xr=l(il,"__call__"),il.forEach(o),jr=l(yo," special method."),yo.forEach(o),kr=u(Be),P(Me.$$.fragment,Be),Mr=u(Be),P(Ee.$$.fragment,Be),Be.forEach(o),B.forEach(o),qn=u(t),le=a(t,"H2",{class:!0});var ts=r(le);ze=a(ts,"A",{id:!0,class:!0,href:!0});var ll=r(ze);Jo=a(ll,"SPAN",{});var dl=r(Jo);P(Lt.$$.fragment,dl),dl.forEach(o),ll.forEach(o),Er=u(ts),Ko=a(ts,"SPAN",{});var cl=r(Ko);zr=l(cl,"XCLIPTextModel"),cl.forEach(o),ts.forEach(o),An=u(t),de=a(t,"DIV",{class:!0});var os=r(de);P(Tt.$$.fragment,os),qr=u(os),O=a(os,"DIV",{class:!0});var He=r(O);P(Xt.$$.fragment,He),Ar=u(He),ce=a(He,"P",{});var Lo=r(ce);Vr=l(Lo,"The "),go=a(Lo,"A",{href:!0});var pl=r(go);Or=l(pl,"XCLIPTextModel"),pl.forEach(o),Dr=l(Lo," forward method, overrides the "),Zo=a(Lo,"CODE",{});var ml=r(Zo);Nr=l(ml,"__call__"),ml.forEach(o),Sr=l(Lo," special method."),Lo.forEach(o),Fr=u(He),P(qe.$$.fragment,He),Wr=u(He),P(Ae.$$.fragment,He),He.forEach(o),os.forEach(o),Vn=u(t),pe=a(t,"H2",{class:!0});var ns=r(pe);Ve=a(ns,"A",{id:!0,class:!0,href:!0});var fl=r(Ve);Qo=a(fl,"SPAN",{});var hl=r(Qo);P(jt.$$.fragment,hl),hl.forEach(o),fl.forEach(o),Rr=u(ns),Yo=a(ns,"SPAN",{});var ul=r(Yo);Br=l(ul,"XCLIPVisionModel"),ul.forEach(o),ns.forEach(o),On=u(t),me=a(t,"DIV",{class:!0});var ss=r(me);P(kt.$$.fragment,ss),Hr=u(ss),D=a(ss,"DIV",{class:!0});var Ue=r(D);P(Mt.$$.fragment,Ue),Ur=u(Ue),fe=a(Ue,"P",{});var To=r(fe);Gr=l(To,"The "),_o=a(To,"A",{href:!0});var gl=r(_o);Jr=l(gl,"XCLIPVisionModel"),gl.forEach(o),Kr=l(To," forward method, overrides the "),en=a(To,"CODE",{});var _l=r(en);Zr=l(_l,"__call__"),_l.forEach(o),Qr=l(To," special method."),To.forEach(o),Yr=u(Ue),P(Oe.$$.fragment,Ue),ei=u(Ue),P(De.$$.fragment,Ue),Ue.forEach(o),ss.forEach(o),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Vl)),c(m,"id","xclip"),c(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(m,"href","#xclip"),c(_,"class","relative group"),c(ue,"id","overview"),c(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ue,"href","#overview"),c(U,"class","relative group"),c(Je,"href","https://arxiv.org/abs/2208.02816"),c(Je,"rel","nofollow"),c(Dt,"href","clip"),c(Rt,"href","clip"),Cl(ge.src,oi="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/xclip_architecture.png")||c(ge,"src",oi),c(ge,"alt","drawing"),c(ge,"width","600"),c(Bt,"href","https://arxiv.org/abs/2208.02816"),c(Qe,"href","https://huggingface.co/nielsr"),c(Qe,"rel","nofollow"),c(Ye,"href","https://github.com/microsoft/VideoX/tree/master/X-CLIP"),c(Ye,"rel","nofollow"),c(_e,"id","resources"),c(_e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(_e,"href","#resources"),c(G,"class","relative group"),c(ot,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/X-CLIP"),c(ot,"rel","nofollow"),c(ve,"id","transformers.XCLIPProcessor"),c(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ve,"href","#transformers.XCLIPProcessor"),c(J,"class","relative group"),c(Jt,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPProcessor"),c(Kt,"href","/docs/transformers/main/en/model_doc/videomae#transformers.VideoMAEImageProcessor"),c(Zt,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizerFast"),c(Qt,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPProcessor.decode"),c(Yt,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),c(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(eo,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),c(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Pe,"id","transformers.XCLIPConfig"),c(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Pe,"href","#transformers.XCLIPConfig"),c(K,"class","relative group"),c(to,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPConfig"),c(oo,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPModel"),c(pt,"href","https://huggingface.co/microsoft/xclip-base-patch32"),c(pt,"rel","nofollow"),c(no,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(so,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(ao,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPConfig"),c(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($e,"id","transformers.XCLIPTextConfig"),c($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c($e,"href","#transformers.XCLIPTextConfig"),c(Q,"class","relative group"),c(ro,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPModel"),c(gt,"href","https://huggingface.co/microsoft/xclip-base-patch32"),c(gt,"rel","nofollow"),c(io,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(lo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ie,"id","transformers.XCLIPVisionConfig"),c(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ie,"href","#transformers.XCLIPVisionConfig"),c(te,"class","relative group"),c(co,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPModel"),c(bt,"href","https://huggingface.co/microsoft/xclip-base-patch32"),c(bt,"rel","nofollow"),c(po,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(mo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Le,"id","transformers.XCLIPModel"),c(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Le,"href","#transformers.XCLIPModel"),c(se,"class","relative group"),c($t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c($t,"rel","nofollow"),c(fo,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPModel"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ho,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPModel"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(uo,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPModel"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ze,"id","transformers.XCLIPTextModel"),c(ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ze,"href","#transformers.XCLIPTextModel"),c(le,"class","relative group"),c(go,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPTextModel"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ve,"id","transformers.XCLIPVisionModel"),c(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ve,"href","#transformers.XCLIPVisionModel"),c(pe,"class","relative group"),c(_o,"href","/docs/transformers/main/en/model_doc/xclip#transformers.XCLIPVisionModel"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,f){e(document.head,d),g(t,b,f),g(t,_,f),e(_,m),e(m,v),C(n,v,null),e(_,p),e(_,L),e(L,as),g(t,mn,f),g(t,U,f),e(U,ue),e(ue,Xo),C(Ge,Xo,null),e(U,rs),e(U,jo),e(jo,is),g(t,fn,f),g(t,S,f),e(S,ls),e(S,Je),e(Je,ds),e(S,cs),e(S,Dt),e(Dt,ps),e(S,ms),g(t,hn,f),g(t,Nt,f),e(Nt,fs),g(t,un,f),g(t,St,f),e(St,ko),e(ko,hs),g(t,gn,f),g(t,Ft,f),e(Ft,us),g(t,_n,f),g(t,Wt,f),e(Wt,Ke),e(Ke,gs),e(Ke,Rt),e(Rt,_s),e(Ke,vs),g(t,vn,f),g(t,ge,f),g(t,bn,f),g(t,Ze,f),e(Ze,bs),e(Ze,Bt),e(Bt,xs),g(t,xn,f),g(t,F,f),e(F,Ps),e(F,Qe),e(Qe,Cs),e(F,$s),e(F,Ye),e(Ye,ws),e(F,Is),g(t,Pn,f),g(t,G,f),e(G,_e),e(_e,Mo),C(et,Mo,null),e(G,ys),e(G,Eo),e(Eo,Ls),g(t,Cn,f),g(t,Ht,f),e(Ht,Ts),g(t,$n,f),g(t,Ut,f),e(Ut,tt),e(tt,Xs),e(tt,ot),e(ot,js),e(tt,ks),g(t,wn,f),g(t,Gt,f),e(Gt,Ms),g(t,In,f),g(t,J,f),e(J,ve),e(ve,zo),C(nt,zo,null),e(J,Es),e(J,qo),e(qo,zs),g(t,yn,f),g(t,T,f),C(st,T,null),e(T,qs),e(T,Ao),e(Ao,As),e(T,Vs),e(T,k),e(k,Jt),e(Jt,Os),e(k,Ds),e(k,Kt),e(Kt,Ns),e(k,Ss),e(k,Zt),e(Zt,Fs),e(k,Ws),e(k,Vo),e(Vo,Rs),e(k,Bs),e(k,Qt),e(Qt,Hs),e(k,Us),e(T,Gs),e(T,be),C(at,be,null),e(be,Js),e(be,rt),e(rt,Ks),e(rt,Yt),e(Yt,Zs),e(rt,Qs),e(T,Ys),e(T,xe),C(it,xe,null),e(xe,ea),e(xe,lt),e(lt,ta),e(lt,eo),e(eo,oa),e(lt,na),g(t,Ln,f),g(t,K,f),e(K,Pe),e(Pe,Oo),C(dt,Oo,null),e(K,sa),e(K,Do),e(Do,aa),g(t,Tn,f),g(t,M,f),C(ct,M,null),e(M,ra),e(M,W),e(W,to),e(to,ia),e(W,la),e(W,oo),e(oo,da),e(W,ca),e(W,pt),e(pt,pa),e(W,ma),e(M,fa),e(M,Z),e(Z,ha),e(Z,no),e(no,ua),e(Z,ga),e(Z,so),e(so,_a),e(Z,va),e(M,ba),e(M,Ce),C(mt,Ce,null),e(Ce,xa),e(Ce,ft),e(ft,Pa),e(ft,ao),e(ao,Ca),e(ft,$a),g(t,Xn,f),g(t,Q,f),e(Q,$e),e($e,No),C(ht,No,null),e(Q,wa),e(Q,So),e(So,Ia),g(t,jn,f),g(t,E,f),C(ut,E,null),e(E,ya),e(E,Y),e(Y,La),e(Y,ro),e(ro,Ta),e(Y,Xa),e(Y,gt),e(gt,ja),e(Y,ka),e(E,Ma),e(E,ee),e(ee,Ea),e(ee,io),e(io,za),e(ee,qa),e(ee,lo),e(lo,Aa),e(ee,Va),e(E,Oa),C(we,E,null),g(t,kn,f),g(t,te,f),e(te,Ie),e(Ie,Fo),C(_t,Fo,null),e(te,Da),e(te,Wo),e(Wo,Na),g(t,Mn,f),g(t,z,f),C(vt,z,null),e(z,Sa),e(z,oe),e(oe,Fa),e(oe,co),e(co,Wa),e(oe,Ra),e(oe,bt),e(bt,Ba),e(oe,Ha),e(z,Ua),e(z,ne),e(ne,Ga),e(ne,po),e(po,Ja),e(ne,Ka),e(ne,mo),e(mo,Za),e(ne,Qa),e(z,Ya),C(ye,z,null),g(t,En,f),g(t,se,f),e(se,Le),e(Le,Ro),C(xt,Ro,null),e(se,er),e(se,Bo),e(Bo,tr),g(t,zn,f),g(t,X,f),C(Pt,X,null),e(X,or),e(X,Ct),e(Ct,nr),e(Ct,$t),e($t,sr),e(Ct,ar),e(X,rr),e(X,q),C(wt,q,null),e(q,ir),e(q,ae),e(ae,lr),e(ae,fo),e(fo,dr),e(ae,cr),e(ae,Ho),e(Ho,pr),e(ae,mr),e(q,fr),C(Te,q,null),e(q,hr),C(Xe,q,null),e(X,ur),e(X,A),C(It,A,null),e(A,gr),e(A,re),e(re,_r),e(re,ho),e(ho,vr),e(re,br),e(re,Uo),e(Uo,xr),e(re,Pr),e(A,Cr),C(je,A,null),e(A,$r),C(ke,A,null),e(X,wr),e(X,V),C(yt,V,null),e(V,Ir),e(V,ie),e(ie,yr),e(ie,uo),e(uo,Lr),e(ie,Tr),e(ie,Go),e(Go,Xr),e(ie,jr),e(V,kr),C(Me,V,null),e(V,Mr),C(Ee,V,null),g(t,qn,f),g(t,le,f),e(le,ze),e(ze,Jo),C(Lt,Jo,null),e(le,Er),e(le,Ko),e(Ko,zr),g(t,An,f),g(t,de,f),C(Tt,de,null),e(de,qr),e(de,O),C(Xt,O,null),e(O,Ar),e(O,ce),e(ce,Vr),e(ce,go),e(go,Or),e(ce,Dr),e(ce,Zo),e(Zo,Nr),e(ce,Sr),e(O,Fr),C(qe,O,null),e(O,Wr),C(Ae,O,null),g(t,Vn,f),g(t,pe,f),e(pe,Ve),e(Ve,Qo),C(jt,Qo,null),e(pe,Rr),e(pe,Yo),e(Yo,Br),g(t,On,f),g(t,me,f),C(kt,me,null),e(me,Hr),e(me,D),C(Mt,D,null),e(D,Ur),e(D,fe),e(fe,Gr),e(fe,_o),e(_o,Jr),e(fe,Kr),e(fe,en),e(en,Zr),e(fe,Qr),e(D,Yr),C(Oe,D,null),e(D,ei),C(De,D,null),Dn=!0},p(t,[f]){const Et={};f&2&&(Et.$$scope={dirty:f,ctx:t}),we.$set(Et);const tn={};f&2&&(tn.$$scope={dirty:f,ctx:t}),ye.$set(tn);const on={};f&2&&(on.$$scope={dirty:f,ctx:t}),Te.$set(on);const nn={};f&2&&(nn.$$scope={dirty:f,ctx:t}),Xe.$set(nn);const zt={};f&2&&(zt.$$scope={dirty:f,ctx:t}),je.$set(zt);const sn={};f&2&&(sn.$$scope={dirty:f,ctx:t}),ke.$set(sn);const an={};f&2&&(an.$$scope={dirty:f,ctx:t}),Me.$set(an);const rn={};f&2&&(rn.$$scope={dirty:f,ctx:t}),Ee.$set(rn);const he={};f&2&&(he.$$scope={dirty:f,ctx:t}),qe.$set(he);const ln={};f&2&&(ln.$$scope={dirty:f,ctx:t}),Ae.$set(ln);const dn={};f&2&&(dn.$$scope={dirty:f,ctx:t}),Oe.$set(dn);const cn={};f&2&&(cn.$$scope={dirty:f,ctx:t}),De.$set(cn)},i(t){Dn||($(n.$$.fragment,t),$(Ge.$$.fragment,t),$(et.$$.fragment,t),$(nt.$$.fragment,t),$(st.$$.fragment,t),$(at.$$.fragment,t),$(it.$$.fragment,t),$(dt.$$.fragment,t),$(ct.$$.fragment,t),$(mt.$$.fragment,t),$(ht.$$.fragment,t),$(ut.$$.fragment,t),$(we.$$.fragment,t),$(_t.$$.fragment,t),$(vt.$$.fragment,t),$(ye.$$.fragment,t),$(xt.$$.fragment,t),$(Pt.$$.fragment,t),$(wt.$$.fragment,t),$(Te.$$.fragment,t),$(Xe.$$.fragment,t),$(It.$$.fragment,t),$(je.$$.fragment,t),$(ke.$$.fragment,t),$(yt.$$.fragment,t),$(Me.$$.fragment,t),$(Ee.$$.fragment,t),$(Lt.$$.fragment,t),$(Tt.$$.fragment,t),$(Xt.$$.fragment,t),$(qe.$$.fragment,t),$(Ae.$$.fragment,t),$(jt.$$.fragment,t),$(kt.$$.fragment,t),$(Mt.$$.fragment,t),$(Oe.$$.fragment,t),$(De.$$.fragment,t),Dn=!0)},o(t){w(n.$$.fragment,t),w(Ge.$$.fragment,t),w(et.$$.fragment,t),w(nt.$$.fragment,t),w(st.$$.fragment,t),w(at.$$.fragment,t),w(it.$$.fragment,t),w(dt.$$.fragment,t),w(ct.$$.fragment,t),w(mt.$$.fragment,t),w(ht.$$.fragment,t),w(ut.$$.fragment,t),w(we.$$.fragment,t),w(_t.$$.fragment,t),w(vt.$$.fragment,t),w(ye.$$.fragment,t),w(xt.$$.fragment,t),w(Pt.$$.fragment,t),w(wt.$$.fragment,t),w(Te.$$.fragment,t),w(Xe.$$.fragment,t),w(It.$$.fragment,t),w(je.$$.fragment,t),w(ke.$$.fragment,t),w(yt.$$.fragment,t),w(Me.$$.fragment,t),w(Ee.$$.fragment,t),w(Lt.$$.fragment,t),w(Tt.$$.fragment,t),w(Xt.$$.fragment,t),w(qe.$$.fragment,t),w(Ae.$$.fragment,t),w(jt.$$.fragment,t),w(kt.$$.fragment,t),w(Mt.$$.fragment,t),w(Oe.$$.fragment,t),w(De.$$.fragment,t),Dn=!1},d(t){o(d),t&&o(b),t&&o(_),I(n),t&&o(mn),t&&o(U),I(Ge),t&&o(fn),t&&o(S),t&&o(hn),t&&o(Nt),t&&o(un),t&&o(St),t&&o(gn),t&&o(Ft),t&&o(_n),t&&o(Wt),t&&o(vn),t&&o(ge),t&&o(bn),t&&o(Ze),t&&o(xn),t&&o(F),t&&o(Pn),t&&o(G),I(et),t&&o(Cn),t&&o(Ht),t&&o($n),t&&o(Ut),t&&o(wn),t&&o(Gt),t&&o(In),t&&o(J),I(nt),t&&o(yn),t&&o(T),I(st),I(at),I(it),t&&o(Ln),t&&o(K),I(dt),t&&o(Tn),t&&o(M),I(ct),I(mt),t&&o(Xn),t&&o(Q),I(ht),t&&o(jn),t&&o(E),I(ut),I(we),t&&o(kn),t&&o(te),I(_t),t&&o(Mn),t&&o(z),I(vt),I(ye),t&&o(En),t&&o(se),I(xt),t&&o(zn),t&&o(X),I(Pt),I(wt),I(Te),I(Xe),I(It),I(je),I(ke),I(yt),I(Me),I(Ee),t&&o(qn),t&&o(le),I(Lt),t&&o(An),t&&o(de),I(Tt),I(Xt),I(qe),I(Ae),t&&o(Vn),t&&o(pe),I(jt),t&&o(On),t&&o(me),I(kt),I(Mt),I(Oe),I(De)}}}const Vl={local:"xclip",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.XCLIPProcessor",title:"XCLIPProcessor"},{local:"transformers.XCLIPConfig",title:"XCLIPConfig"},{local:"transformers.XCLIPTextConfig",title:"XCLIPTextConfig"},{local:"transformers.XCLIPVisionConfig",title:"XCLIPVisionConfig"},{local:"transformers.XCLIPModel",title:"XCLIPModel"},{local:"transformers.XCLIPTextModel",title:"XCLIPTextModel"},{local:"transformers.XCLIPVisionModel",title:"XCLIPVisionModel"}],title:"X-CLIP"};function Ol(y){return $l(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bl extends vl{constructor(d){super();bl(this,d,Ol,Al,xl,{})}}export{Bl as default,Vl as metadata};
