import{S as Rd,i as Bd,s as Wd,e as n,k as h,w as v,t as i,M as Ud,c as s,d as t,m,a as r,x as P,h as l,b as c,G as e,g as _,y as b,q as I,o as y,B as L,v as Hd,L as fo}from"../../chunks/vendor-hf-doc-builder.js";import{T as cs}from"../../chunks/Tip-hf-doc-builder.js";import{D as w}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ye}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as H}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as po}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Jd(T){let d,$,u,f,C;return f=new ye({props:{code:`from transformers import ChineseCLIPConfig, ChineseCLIPModel

# Initializing a ChineseCLIPConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration
configuration = ChineseCLIPConfig()

# Initializing a ChineseCLIPModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration
model = ChineseCLIPModel(configuration)

# Accessing the model configuration
configuration = model.config

# We can also initialize a ChineseCLIPConfig from a ChineseCLIPTextConfig and a ChineseCLIPVisionConfig

# Initializing a ChineseCLIPTextConfig and ChineseCLIPVisionConfig configuration
config_text = ChineseCLIPTextConfig()
config_vision = ChineseCLIPVisionConfig()

config = ChineseCLIPConfig.from_text_vision_configs(config_text, config_vision)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChineseCLIPConfig, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChineseCLIPConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel(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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also initialize a ChineseCLIPConfig from a ChineseCLIPTextConfig and a ChineseCLIPVisionConfig</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPTextConfig and ChineseCLIPVisionConfig configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = ChineseCLIPTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = ChineseCLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = ChineseCLIPConfig.from_text_vision_configs(config_text, config_vision)`}}),{c(){d=n("p"),$=i("Example:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Example:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function Gd(T){let d,$,u,f,C;return f=new ye({props:{code:`from transformers import ChineseCLIPTextConfig, ChineseCLIPTextModel

# Initializing a ChineseCLIPTextConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration
configuration = ChineseCLIPTextConfig()

# Initializing a ChineseCLIPTextModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration
model = ChineseCLIPTextModel(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> ChineseCLIPTextConfig, ChineseCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPTextConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChineseCLIPTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPTextModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPTextModel(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=n("p"),$=i("Example:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Example:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function Yd(T){let d,$,u,f,C;return f=new ye({props:{code:`from transformers import ChineseCLIPVisionConfig, ChineseCLIPVisionModel

# Initializing a ChineseCLIPVisionConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration
configuration = ChineseCLIPVisionConfig()

# Initializing a ChineseCLIPVisionModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration
model = ChineseCLIPVisionModel(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> ChineseCLIPVisionConfig, ChineseCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPVisionConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChineseCLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPVisionModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPVisionModel(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=n("p"),$=i("Example:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Example:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function Zd(T){let d,$,u,f,C;return{c(){d=n("p"),$=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),C=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(a){d=s(a,"P",{});var p=r(d);$=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var x=r(u);f=l(x,"Module"),x.forEach(t),C=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(t)},m(a,p){_(a,d,p),e(d,$),e(d,u),e(u,f),e(d,C)},d(a){a&&t(d)}}}function Kd(T){let d,$,u,f,C;return f=new ye({props:{code:`from PIL import Image
import requests
from transformers import ChineseCLIPProcessor, ChineseCLIPModel

model = ChineseCLIPModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
processor = ChineseCLIPProcessor.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")

url = "https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(text=["\u6770\u5C3C\u9F9F", "\u5999\u86D9\u79CD\u5B50", "\u5C0F\u706B\u9F99", "\u76AE\u5361\u4E18"], images=image, return_tensors="pt", padding=True)

outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # we can take the softmax to get the label probabilities`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChineseCLIPProcessor, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ChineseCLIPProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=[<span class="hljs-string">&quot;\u6770\u5C3C\u9F9F&quot;</span>, <span class="hljs-string">&quot;\u5999\u86D9\u79CD\u5B50&quot;</span>, <span class="hljs-string">&quot;\u5C0F\u706B\u9F99&quot;</span>, <span class="hljs-string">&quot;\u76AE\u5361\u4E18&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){d=n("p"),$=i("Examples:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Examples:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function Xd(T){let d,$,u,f,C;return{c(){d=n("p"),$=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),C=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(a){d=s(a,"P",{});var p=r(d);$=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var x=r(u);f=l(x,"Module"),x.forEach(t),C=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(t)},m(a,p){_(a,d,p),e(d,$),e(d,u),e(u,f),e(d,C)},d(a){a&&t(d)}}}function Qd(T){let d,$,u,f,C;return f=new ye({props:{code:`from transformers import BertTokenizer, ChineseCLIPModel

model = ChineseCLIPModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
tokenizer = BertTokenizer.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")

inputs = tokenizer(["\u6770\u5C3C\u9F9F", "\u5999\u86D9\u79CD\u5B50", "\u5C0F\u706B\u9F99", "\u76AE\u5361\u4E18"], padding=True, return_tensors="pt")
text_features = model.get_text_features(**inputs)
text_features = text_features / text_features.norm(p=2, dim=-1, keepdim=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;\u6770\u5C3C\u9F9F&quot;</span>, <span class="hljs-string">&quot;\u5999\u86D9\u79CD\u5B50&quot;</span>, <span class="hljs-string">&quot;\u5C0F\u706B\u9F99&quot;</span>, <span class="hljs-string">&quot;\u76AE\u5361\u4E18&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)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = text_features / text_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)`}}),{c(){d=n("p"),$=i("Examples:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Examples:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function eh(T){let d,$,u,f,C;return{c(){d=n("p"),$=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),C=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(a){d=s(a,"P",{});var p=r(d);$=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var x=r(u);f=l(x,"Module"),x.forEach(t),C=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(t)},m(a,p){_(a,d,p),e(d,$),e(d,u),e(u,f),e(d,C)},d(a){a&&t(d)}}}function oh(T){let d,$,u,f,C;return f=new ye({props:{code:`from PIL import Image
import requests
from transformers import ChineseCLIPProcessor, ChineseCLIPModel

model = ChineseCLIPModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
processor = ChineseCLIPProcessor.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")

url = "https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(images=image, return_tensors="pt")

image_features = model.get_image_features(**inputs)
image_features = image_features / image_features.norm(p=2, dim=-1, keepdim=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChineseCLIPProcessor, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ChineseCLIPProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = image_features / image_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)`}}),{c(){d=n("p"),$=i("Examples:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Examples:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function th(T){let d,$,u,f,C;return{c(){d=n("p"),$=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),C=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(a){d=s(a,"P",{});var p=r(d);$=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var x=r(u);f=l(x,"Module"),x.forEach(t),C=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(t)},m(a,p){_(a,d,p),e(d,$),e(d,u),e(u,f),e(d,C)},d(a){a&&t(d)}}}function nh(T){let d,$,u,f,C;return f=new ye({props:{code:`from transformers import BertTokenizer, ChineseCLIPTextModel
import torch

tokenizer = BertTokenizer.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
model = ChineseCLIPTextModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BertTokenizer, ChineseCLIPTextModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = BertTokenizer.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</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_states = outputs.last_hidden_state`}}),{c(){d=n("p"),$=i("Example:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Example:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function sh(T){let d,$,u,f,C;return{c(){d=n("p"),$=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),C=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(a){d=s(a,"P",{});var p=r(d);$=l(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var x=r(u);f=l(x,"Module"),x.forEach(t),C=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(t)},m(a,p){_(a,d,p),e(d,$),e(d,u),e(u,f),e(d,C)},d(a){a&&t(d)}}}function rh(T){let d,$,u,f,C;return f=new ye({props:{code:`from PIL import Image
import requests
from transformers import CLIPProcessor, ChineseCLIPVisionModel

model = ChineseCLIPVisionModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
processor = CLIPProcessor.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")

url = "https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(images=image, return_tensors="pt")

outputs = model(**inputs)
last_hidden_state = outputs.last_hidden_state
pooled_output = outputs.pooler_output  # pooled CLS states`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPProcessor, ChineseCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = CLIPProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, 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 CLS states</span>`}}),{c(){d=n("p"),$=i("Examples:"),u=h(),v(f.$$.fragment)},l(a){d=s(a,"P",{});var p=r(d);$=l(p,"Examples:"),p.forEach(t),u=m(a),P(f.$$.fragment,a)},m(a,p){_(a,d,p),e(d,$),_(a,u,p),b(f,a,p),C=!0},p:fo,i(a){C||(I(f.$$.fragment,a),C=!0)},o(a){y(f.$$.fragment,a),C=!1},d(a){a&&t(d),a&&t(u),L(f,a)}}}function ah(T){let d,$,u,f,C,a,p,x,fr,ds,te,Le,sn,go,gr,rn,ur,hs,Z,_r,uo,Cr,vr,_o,Pr,br,ms,Pt,Ir,ps,bt,an,yr,fs,ne,$e,ln,Co,Lr,cn,$r,gs,It,Tr,us,vo,_s,yt,wr,Cs,D,dn,Po,xr,zr,hn,bo,kr,Er,mn,Io,jr,Mr,pn,yo,Ar,vs,Te,qr,Lo,Sr,Or,Ps,se,we,fn,$o,Fr,gn,Nr,bs,E,To,Dr,K,Lt,Vr,Rr,$t,Br,Wr,wo,Ur,Hr,Jr,re,Gr,Tt,Yr,Zr,wt,Kr,Xr,Qr,xe,ea,ze,xo,oa,ae,ta,xt,na,sa,zt,ra,aa,Is,ie,ke,un,zo,ia,_n,la,ys,F,ko,ca,Eo,da,kt,ha,ma,pa,le,fa,Et,ga,ua,jt,_a,Ca,va,Ee,Ls,ce,je,Cn,jo,Pa,vn,ba,$s,N,Mo,Ia,Ao,ya,Mt,La,$a,Ta,de,wa,At,xa,za,qt,ka,Ea,ja,Me,Ts,he,Ae,Pn,qo,Ma,bn,Aa,ws,J,So,qa,In,Sa,Oa,qe,Oo,Fa,yn,Na,xs,me,Se,Ln,Fo,Da,$n,Va,zs,z,No,Ra,Tn,Ba,Wa,Oe,Do,Ua,Vo,Ha,wn,Ja,Ga,Ya,Fe,Ro,Za,xn,Ka,Xa,Ne,Bo,Qa,zn,ei,oi,De,Wo,ti,kn,ni,si,Ve,Uo,ri,En,ai,ks,pe,Re,jn,Ho,ii,Mn,li,Es,j,Jo,ci,An,di,hi,q,St,mi,pi,Ot,fi,gi,Ft,ui,_i,qn,Ci,vi,Nt,Pi,bi,Ii,Be,Go,yi,Yo,Li,Dt,$i,Ti,wi,We,Zo,xi,Ko,zi,Vt,ki,Ei,js,fe,Ue,Sn,Xo,ji,On,Mi,Ms,M,Qo,Ai,et,qi,ot,Si,Oi,Fi,V,tt,Ni,ge,Di,Rt,Vi,Ri,Fn,Bi,Wi,Ui,He,Hi,Je,Ji,R,nt,Gi,ue,Yi,Bt,Zi,Ki,Nn,Xi,Qi,el,Ge,ol,Ye,tl,B,st,nl,_e,sl,Wt,rl,al,Dn,il,ll,cl,Ze,dl,Ke,As,Ce,Xe,Vn,rt,hl,Rn,ml,qs,A,at,pl,it,fl,lt,gl,ul,_l,ct,Cl,dt,vl,Pl,bl,k,Il,Bn,yl,Ll,Wn,$l,Tl,Un,wl,xl,Hn,zl,kl,Jn,El,jl,Gn,Ml,Al,ql,W,ht,Sl,ve,Ol,Ut,Fl,Nl,Yn,Dl,Vl,Rl,Qe,Bl,eo,Ss,Pe,oo,Zn,mt,Wl,Kn,Ul,Os,G,pt,Hl,ft,Jl,gt,Gl,Yl,Zl,U,ut,Kl,be,Xl,Ht,Ql,ec,Xn,oc,tc,nc,to,sc,no,Fs;return a=new H({}),go=new H({}),Co=new H({}),vo=new ye({props:{code:`from PIL import Image
import requests
from transformers import ChineseCLIPProcessor, ChineseCLIPModel

model = ChineseCLIPModel.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")
processor = ChineseCLIPProcessor.from_pretrained("OFA-Sys/chinese-clip-vit-base-patch16")

url = "https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg"
image = Image.open(requests.get(url, stream=True).raw)
# Squirtle, Bulbasaur, Charmander, Pikachu in English
texts = ["\u6770\u5C3C\u9F9F", "\u5999\u86D9\u79CD\u5B50", "\u5C0F\u706B\u9F99", "\u76AE\u5361\u4E18"]

# compute image feature
inputs = processor(images=image, return_tensors="pt")
image_features = model.get_image_features(**inputs)
image_features = image_features / image_features.norm(p=2, dim=-1, keepdim=True)  # normalize

# compute text features
inputs = processor(text=texts, padding=True, return_tensors="pt")
text_features = model.get_text_features(**inputs)
text_features = text_features / text_features.norm(p=2, dim=-1, keepdim=True)  # normalize

# compute image-text similarity scores
inputs = processor(text=texts, images=image, return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image  # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1)  # probs: [[1.2686e-03, 5.4499e-02, 6.7968e-04, 9.4355e-01]]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChineseCLIPProcessor, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ChineseCLIPProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Squirtle, Bulbasaur, Charmander, Pikachu in English</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>texts = [<span class="hljs-string">&quot;\u6770\u5C3C\u9F9F&quot;</span>, <span class="hljs-string">&quot;\u5999\u86D9\u79CD\u5B50&quot;</span>, <span class="hljs-string">&quot;\u5C0F\u706B\u9F99&quot;</span>, <span class="hljs-string">&quot;\u76AE\u5361\u4E18&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute image feature</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = image_features / image_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)  <span class="hljs-comment"># normalize</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute text features</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, 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)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = text_features / text_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)  <span class="hljs-comment"># normalize</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute image-text similarity scores</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># probs: [[1.2686e-03, 5.4499e-02, 6.7968e-04, 9.4355e-01]]</span>`}}),$o=new H({}),To=new w({props:{name:"class transformers.ChineseCLIPConfig",anchor:"transformers.ChineseCLIPConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPConfig.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/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPTextConfig">ChineseCLIPTextConfig</a>.`,name:"text_config"},{anchor:"transformers.ChineseCLIPConfig.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/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionConfig">ChineseCLIPVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.ChineseCLIPConfig.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.ChineseCLIPConfig.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> paramter. Default is used as per the original ChineseCLIP
implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.ChineseCLIPConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L274"}}),xe=new po({props:{anchor:"transformers.ChineseCLIPConfig.example",$$slots:{default:[Jd]},$$scope:{ctx:T}}}),xo=new w({props:{name:"from_text_vision_configs",anchor:"transformers.ChineseCLIPConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": ChineseCLIPTextConfig"},{name:"vision_config",val:": ChineseCLIPVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L353"}}),zo=new H({}),ko=new w({props:{name:"class transformers.ChineseCLIPTextConfig",anchor:"transformers.ChineseCLIPTextConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the CHINESE_CLIP model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a>.`,name:"vocab_size"},{anchor:"transformers.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ChineseCLIPTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.ChineseCLIPTextConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ChineseCLIPTextConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ChineseCLIPTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#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.ChineseCLIPTextConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ChineseCLIPTextConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.ChineseCLIPTextConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.ChineseCLIPTextConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L41"}}),Ee=new po({props:{anchor:"transformers.ChineseCLIPTextConfig.example",$$slots:{default:[Gd]},$$scope:{ctx:T}}}),jo=new H({}),Mo=new w({props:{name:"class transformers.ChineseCLIPVisionConfig",anchor:"transformers.ChineseCLIPVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"projection_dim",val:" = 512"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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. layer_norm_eps (<code>float</code>, <em>optional</em>,
defaults to 1e-5): The epsilon used by the layer normalization layers.`,name:"hidden_act"},{anchor:"transformers.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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/v4.25.1/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L167"}}),Me=new po({props:{anchor:"transformers.ChineseCLIPVisionConfig.example",$$slots:{default:[Yd]},$$scope:{ctx:T}}}),qo=new H({}),So=new w({props:{name:"class transformers.ChineseCLIPImageProcessor",anchor:"transformers.ChineseCLIPImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ChineseCLIPImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ChineseCLIPImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.ChineseCLIPImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.ChineseCLIPImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.ChineseCLIPImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.ChineseCLIPImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ChineseCLIPImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.ChineseCLIPImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L58"}}),Oo=new w({props:{name:"preprocess",anchor:"transformers.ChineseCLIPImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L224"}}),Fo=new H({}),No=new w({props:{name:"class transformers.ChineseCLIPImageProcessor",anchor:"transformers.ChineseCLIPImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.ChineseCLIPImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.ChineseCLIPImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.ChineseCLIPImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.ChineseCLIPImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.ChineseCLIPImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.ChineseCLIPImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ChineseCLIPImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.ChineseCLIPImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L58"}}),Do=new w({props:{name:"center_crop",anchor:"transformers.ChineseCLIPImageProcessor.center_crop",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": typing.Dict[str, int]"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.center_crop.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to center crop.`,name:"image"},{anchor:"transformers.ChineseCLIPImageProcessor.center_crop.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>) &#x2014;
Size of the output image in the form of a dictionary with keys <code>height</code> and <code>width</code>.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessor.center_crop.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L159"}}),Ro=new w({props:{name:"normalize",anchor:"transformers.ChineseCLIPImageProcessor.normalize",parameters:[{name:"image",val:": ndarray"},{name:"mean",val:": typing.Union[float, typing.List[float]]"},{name:"std",val:": typing.Union[float, typing.List[float]]"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.normalize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to normalize.`,name:"image"},{anchor:"transformers.ChineseCLIPImageProcessor.normalize.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.ChineseCLIPImageProcessor.normalize.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.ChineseCLIPImageProcessor.normalize.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L201"}}),Bo=new w({props:{name:"preprocess",anchor:"transformers.ChineseCLIPImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L224"}}),Wo=new w({props:{name:"rescale",anchor:"transformers.ChineseCLIPImageProcessor.rescale",parameters:[{name:"image",val:": ndarray"},{name:"scale",val:": typing.Union[int, float]"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.rescale.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to rescale.`,name:"image"},{anchor:"transformers.ChineseCLIPImageProcessor.rescale.scale",description:`<strong>scale</strong> (<code>int</code> or <code>float</code>) &#x2014;
Scale to apply to the image.`,name:"scale"},{anchor:"transformers.ChineseCLIPImageProcessor.rescale.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L181"}}),Uo=new w({props:{name:"resize",anchor:"transformers.ChineseCLIPImageProcessor.resize",parameters:[{name:"image",val:": ndarray"},{name:"size",val:": typing.Dict[str, int]"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.resize.image",description:`<strong>image</strong> (<code>np.ndarray</code>) &#x2014;
Image to resize.`,name:"image"},{anchor:"transformers.ChineseCLIPImageProcessor.resize.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>) &#x2014;
Size of the output image.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessor.resize.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use when resiizing the image.`,name:"resample"},{anchor:"transformers.ChineseCLIPImageProcessor.resize.data_format",description:`<strong>data_format</strong> (<code>str</code> or <code>ChannelDimension</code>, <em>optional</em>) &#x2014;
The channel dimension format of the image. If not provided, it will be the same as the input image.`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L131"}}),Ho=new H({}),Jo=new w({props:{name:"class transformers.ChineseCLIPProcessor",anchor:"transformers.ChineseCLIPProcessor",parameters:[{name:"feature_extractor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPProcessor.feature_extractor",description:`<strong>feature_extractor</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPFeatureExtractor</a>) &#x2014;
The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.ChineseCLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/processing_chinese_clip.py#L22"}}),Go=new w({props:{name:"batch_decode",anchor:"transformers.ChineseCLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/processing_chinese_clip.py#L97"}}),Zo=new w({props:{name:"decode",anchor:"transformers.ChineseCLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/processing_chinese_clip.py#L104"}}),Xo=new H({}),Qo=new w({props:{name:"class transformers.ChineseCLIPModel",anchor:"transformers.ChineseCLIPModel",parameters:[{name:"config",val:": ChineseCLIPConfig"}],parametersDescription:[{anchor:"transformers.ChineseCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</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/v4.25.1/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/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1345"}}),tt=new w({props:{name:"forward",anchor:"transformers.ChineseCLIPModel.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:"token_type_ids",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.ChineseCLIPModel.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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/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.ChineseCLIPModel.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.ChineseCLIPModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.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/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPFeatureExtractor</a>. See <a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">ChineseCLIPFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.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.ChineseCLIPModel.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.ChineseCLIPModel.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1480",returnDescription:`
<p>A <code>transformers.models.chinese_clip.modeling_chinese_clip.ChineseCLIPOutput</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.chinese_clip.configuration_chinese_clip.ChineseCLIPConfig'&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 image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
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/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel"
>ChineseCLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel"
>ChineseCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPoolingAndCrossAttentions</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel"
>ChineseCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPoolingAndCrossAttentions</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel"
>ChineseCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.chinese_clip.modeling_chinese_clip.ChineseCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),He=new cs({props:{$$slots:{default:[Zd]},$$scope:{ctx:T}}}),Je=new po({props:{anchor:"transformers.ChineseCLIPModel.forward.example",$$slots:{default:[Kd]},$$scope:{ctx:T}}}),nt=new w({props:{name:"get_text_features",anchor:"transformers.ChineseCLIPModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",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.ChineseCLIPModel.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/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.ChineseCLIPModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.ChineseCLIPModel.get_text_features.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.get_text_features.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ChineseCLIPModel.get_text_features.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.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.ChineseCLIPModel.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1380",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the final [CLS] hidden state of Text-Transformer.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Ge=new cs({props:{$$slots:{default:[Xd]},$$scope:{ctx:T}}}),Ye=new po({props:{anchor:"transformers.ChineseCLIPModel.get_text_features.example",$$slots:{default:[Qd]},$$scope:{ctx:T}}}),st=new w({props:{name:"get_image_features",anchor:"transformers.ChineseCLIPModel.get_image_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.ChineseCLIPModel.get_image_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/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPFeatureExtractor</a>. See <a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">ChineseCLIPFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPModel.get_image_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.ChineseCLIPModel.get_image_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.ChineseCLIPModel.get_image_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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1430",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the final [CLS] hidden state of Vision-Transformer.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Ze=new cs({props:{$$slots:{default:[eh]},$$scope:{ctx:T}}}),Ke=new po({props:{anchor:"transformers.ChineseCLIPModel.get_image_features.example",$$slots:{default:[oh]},$$scope:{ctx:T}}}),rt=new H({}),at=new w({props:{name:"class transformers.ChineseCLIPTextModel",anchor:"transformers.ChineseCLIPTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.ChineseCLIPTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</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/v4.25.1/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/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1108"}}),ht=new w({props:{name:"forward",anchor:"transformers.ChineseCLIPTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ChineseCLIPTextModel.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/v4.25.1/en/model_doc/bert#transformers.BertTokenizer">BertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.1/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.ChineseCLIPTextModel.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.ChineseCLIPTextModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ChineseCLIPTextModel.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.ChineseCLIPTextModel.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/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPFeatureExtractor</a>. See <a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">ChineseCLIPFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPTextModel.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.ChineseCLIPTextModel.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.ChineseCLIPTextModel.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.ChineseCLIPTextModel.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ChineseCLIPTextModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.ChineseCLIPTextModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.ChineseCLIPTextModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.ChineseCLIPTextModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1149",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig"
>ChineseCLIPConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \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>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=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 of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qe=new cs({props:{$$slots:{default:[th]},$$scope:{ctx:T}}}),eo=new po({props:{anchor:"transformers.ChineseCLIPTextModel.forward.example",$$slots:{default:[nh]},$$scope:{ctx:T}}}),mt=new H({}),pt=new w({props:{name:"class transformers.ChineseCLIPVisionModel",anchor:"transformers.ChineseCLIPVisionModel",parameters:[{name:"config",val:": ChineseCLIPVisionConfig"}],parametersDescription:[{anchor:"transformers.ChineseCLIPVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</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/v4.25.1/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/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1290"}}),ut=new w({props:{name:"forward",anchor:"transformers.ChineseCLIPVisionModel.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.ChineseCLIPVisionModel.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/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPFeatureExtractor</a>. See <a href="/docs/transformers/v4.25.1/en/model_doc/deit#transformers.DeiTImageProcessor.__call__">ChineseCLIPFeatureExtractor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPVisionModel.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.ChineseCLIPVisionModel.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.ChineseCLIPVisionModel.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/v4.25.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1303",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.1/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.chinese_clip.configuration_chinese_clip.ChineseCLIPVisionConfig'&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/v4.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),to=new cs({props:{$$slots:{default:[sh]},$$scope:{ctx:T}}}),no=new po({props:{anchor:"transformers.ChineseCLIPVisionModel.forward.example",$$slots:{default:[rh]},$$scope:{ctx:T}}}),{c(){d=n("meta"),$=h(),u=n("h1"),f=n("a"),C=n("span"),v(a.$$.fragment),p=h(),x=n("span"),fr=i("Chinese-CLIP"),ds=h(),te=n("h2"),Le=n("a"),sn=n("span"),v(go.$$.fragment),gr=h(),rn=n("span"),ur=i("Overview"),hs=h(),Z=n("p"),_r=i("The Chinese-CLIP model was proposed in "),uo=n("a"),Cr=i("Chinese CLIP: Contrastive Vision-Language Pretraining in Chinese"),vr=i(` by An Yang, Junshu Pan, Junyang Lin, Rui Men, Yichang Zhang, Jingren Zhou, Chang Zhou.
Chinese-CLIP is an implementation of CLIP (Radford et al., 2021) on a large-scale dataset of Chinese image-text pairs. It is capable of performing cross-modal retrieval and also playing as a vision backbone for vision tasks like zero-shot image classification, open-domain object detection, etc. The original Chinese-CLIP code is released `),_o=n("a"),Pr=i("at this link"),br=i("."),ms=h(),Pt=n("p"),Ir=i("The abstract from the paper is the following:"),ps=h(),bt=n("p"),an=n("em"),yr=i("The tremendous success of CLIP (Radford et al., 2021) has promoted the research and application of contrastive learning for vision-language pretraining. In this work, we construct a large-scale dataset of image-text pairs in Chinese, where most data are retrieved from publicly available datasets, and we pretrain Chinese CLIP models on the new dataset. We develop 5 Chinese CLIP models of multiple sizes, spanning from 77 to 958 million parameters. Furthermore, we propose a two-stage pretraining method, where the model is first trained with the image encoder frozen and then trained with all parameters being optimized, to achieve enhanced model performance. Our comprehensive experiments demonstrate that Chinese CLIP can achieve the state-of-the-art performance on MUGE, Flickr30K-CN, and COCO-CN in the setups of zero-shot learning and finetuning, and it is able to achieve competitive performance in zero-shot image classification based on the evaluation on the ELEVATER benchmark (Li et al., 2022). Our codes, pretrained models, and demos have been released."),fs=h(),ne=n("h2"),$e=n("a"),ln=n("span"),v(Co.$$.fragment),Lr=h(),cn=n("span"),$r=i("Usage"),gs=h(),It=n("p"),Tr=i("The code snippet below shows how to compute image & text features and similarities:"),us=h(),v(vo.$$.fragment),_s=h(),yt=n("p"),wr=i("Currently, we release the following scales of pretrained Chinese-CLIP models at HF Model Hub:"),Cs=h(),D=n("ul"),dn=n("li"),Po=n("a"),xr=i("OFA-Sys/chinese-clip-vit-base-patch16"),zr=h(),hn=n("li"),bo=n("a"),kr=i("OFA-Sys/chinese-clip-vit-large-patch14"),Er=h(),mn=n("li"),Io=n("a"),jr=i("OFA-Sys/chinese-clip-vit-large-patch14-336px"),Mr=h(),pn=n("li"),yo=n("a"),Ar=i("OFA-Sys/chinese-clip-vit-huge-patch14"),vs=h(),Te=n("p"),qr=i("The Chinese-CLIP model was contributed by "),Lo=n("a"),Sr=i("OFA-Sys"),Or=i("."),Ps=h(),se=n("h2"),we=n("a"),fn=n("span"),v($o.$$.fragment),Fr=h(),gn=n("span"),Nr=i("ChineseCLIPConfig"),bs=h(),E=n("div"),v(To.$$.fragment),Dr=h(),K=n("p"),Lt=n("a"),Vr=i("ChineseCLIPConfig"),Rr=i(" is the configuration class to store the configuration of a "),$t=n("a"),Br=i("ChineseCLIPModel"),Wr=i(`. It is used
to instantiate Chinese-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
Chinese-CLIP `),wo=n("a"),Ur=i("OFA-Sys/chinese-clip-vit-base-patch16"),Hr=i(`
architecture.`),Jr=h(),re=n("p"),Gr=i("Configuration objects inherit from "),Tt=n("a"),Yr=i("PretrainedConfig"),Zr=i(` and can be used to control the model outputs. Read the
documentation from `),wt=n("a"),Kr=i("PretrainedConfig"),Xr=i(" for more information."),Qr=h(),v(xe.$$.fragment),ea=h(),ze=n("div"),v(xo.$$.fragment),oa=h(),ae=n("p"),ta=i("Instantiate a "),xt=n("a"),na=i("ChineseCLIPConfig"),sa=i(` (or a derived class) from Chinese-CLIP text model configuration and
Chinese-CLIP vision model configuration. Returns:
`),zt=n("a"),ra=i("ChineseCLIPConfig"),aa=i(": An instance of a configuration object"),Is=h(),ie=n("h2"),ke=n("a"),un=n("span"),v(zo.$$.fragment),ia=h(),_n=n("span"),la=i("ChineseCLIPTextConfig"),ys=h(),F=n("div"),v(ko.$$.fragment),ca=h(),Eo=n("p"),da=i("This is the configuration class to store the configuration of a "),kt=n("a"),ha=i("ChineseCLIPModel"),ma=i(`. It is used to instantiate a
Chinese 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 Chinese CLIP
[OFA-Sys/chinese-clip-vit-base-patch16](https:
//huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.`),pa=h(),le=n("p"),fa=i("Configuration objects inherit from "),Et=n("a"),ga=i("PretrainedConfig"),ua=i(` and can be used to control the model outputs. Read the
documentation from `),jt=n("a"),_a=i("PretrainedConfig"),Ca=i(" for more information."),va=h(),v(Ee.$$.fragment),Ls=h(),ce=n("h2"),je=n("a"),Cn=n("span"),v(jo.$$.fragment),Pa=h(),vn=n("span"),ba=i("ChineseCLIPVisionConfig"),$s=h(),N=n("div"),v(Mo.$$.fragment),Ia=h(),Ao=n("p"),ya=i("This is the configuration class to store the configuration of a "),Mt=n("a"),La=i("ChineseCLIPModel"),$a=i(`. It is used to instantiate an
ChineseCLIP 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 ChineseCLIP
[OFA-Sys/chinese-clip-vit-base-patch16](https:
//huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.`),Ta=h(),de=n("p"),wa=i("Configuration objects inherit from "),At=n("a"),xa=i("PretrainedConfig"),za=i(` and can be used to control the model outputs. Read the
documentation from `),qt=n("a"),ka=i("PretrainedConfig"),Ea=i(" for more information."),ja=h(),v(Me.$$.fragment),Ts=h(),he=n("h2"),Ae=n("a"),Pn=n("span"),v(qo.$$.fragment),Ma=h(),bn=n("span"),Aa=i("ChineseCLIPImageProcessor"),ws=h(),J=n("div"),v(So.$$.fragment),qa=h(),In=n("p"),Sa=i("Constructs a Chinese-CLIP image processor."),Oa=h(),qe=n("div"),v(Oo.$$.fragment),Fa=h(),yn=n("p"),Na=i("Preprocess an image or batch of images."),xs=h(),me=n("h2"),Se=n("a"),Ln=n("span"),v(Fo.$$.fragment),Da=h(),$n=n("span"),Va=i("ChineseCLIPFeatureExtractor"),zs=h(),z=n("div"),v(No.$$.fragment),Ra=h(),Tn=n("p"),Ba=i("Constructs a Chinese-CLIP image processor."),Wa=h(),Oe=n("div"),v(Do.$$.fragment),Ua=h(),Vo=n("p"),Ha=i(`Center crop an image. If the image is too small to be cropped to the size given, it will be padded (so the
returned result will always be of size `),wn=n("code"),Ja=i("size"),Ga=i(")."),Ya=h(),Fe=n("div"),v(Ro.$$.fragment),Za=h(),xn=n("p"),Ka=i("Normalize an image. image = (image - image_mean) / image_std."),Xa=h(),Ne=n("div"),v(Bo.$$.fragment),Qa=h(),zn=n("p"),ei=i("Preprocess an image or batch of images."),oi=h(),De=n("div"),v(Wo.$$.fragment),ti=h(),kn=n("p"),ni=i("Rescale an image by a scale factor. image = image * scale."),si=h(),Ve=n("div"),v(Uo.$$.fragment),ri=h(),En=n("p"),ai=i(`Resize an image. The shortest edge of the image is resized to size[\u201Cshortest_edge\u201D], with the longest edge
resized to keep the input aspect ratio.`),ks=h(),pe=n("h2"),Re=n("a"),jn=n("span"),v(Ho.$$.fragment),ii=h(),Mn=n("span"),li=i("ChineseCLIPProcessor"),Es=h(),j=n("div"),v(Jo.$$.fragment),ci=h(),An=n("p"),di=i(`Constructs a Chinese-CLIP processor which wraps a Chinese-CLIP feature extractor and a Chinese-CLIP tokenizer into
a single processor.`),hi=h(),q=n("p"),St=n("a"),mi=i("ChineseCLIPProcessor"),pi=i(" offers all the functionalities of "),Ot=n("a"),fi=i("ChineseCLIPFeatureExtractor"),gi=i(` and
`),Ft=n("a"),ui=i("BertTokenizerFast"),_i=i(". See the "),qn=n("code"),Ci=i("__call__()"),vi=i(" and "),Nt=n("a"),Pi=i("decode()"),bi=i(` for more
information.`),Ii=h(),Be=n("div"),v(Go.$$.fragment),yi=h(),Yo=n("p"),Li=i("This method forwards all its arguments to BertTokenizerFast\u2019s "),Dt=n("a"),$i=i("batch_decode()"),Ti=i(`. Please
refer to the docstring of this method for more information.`),wi=h(),We=n("div"),v(Zo.$$.fragment),xi=h(),Ko=n("p"),zi=i("This method forwards all its arguments to BertTokenizerFast\u2019s "),Vt=n("a"),ki=i("decode()"),Ei=i(`. Please refer to
the docstring of this method for more information.`),js=h(),fe=n("h2"),Ue=n("a"),Sn=n("span"),v(Xo.$$.fragment),ji=h(),On=n("span"),Mi=i("ChineseCLIPModel"),Ms=h(),M=n("div"),v(Qo.$$.fragment),Ai=h(),et=n("p"),qi=i("This model is a PyTorch "),ot=n("a"),Si=i("torch.nn.Module"),Oi=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Fi=h(),V=n("div"),v(tt.$$.fragment),Ni=h(),ge=n("p"),Di=i("The "),Rt=n("a"),Vi=i("ChineseCLIPModel"),Ri=i(" forward method, overrides the "),Fn=n("code"),Bi=i("__call__"),Wi=i(" special method."),Ui=h(),v(He.$$.fragment),Hi=h(),v(Je.$$.fragment),Ji=h(),R=n("div"),v(nt.$$.fragment),Gi=h(),ue=n("p"),Yi=i("The "),Bt=n("a"),Zi=i("ChineseCLIPModel"),Ki=i(" forward method, overrides the "),Nn=n("code"),Xi=i("__call__"),Qi=i(" special method."),el=h(),v(Ge.$$.fragment),ol=h(),v(Ye.$$.fragment),tl=h(),B=n("div"),v(st.$$.fragment),nl=h(),_e=n("p"),sl=i("The "),Wt=n("a"),rl=i("ChineseCLIPModel"),al=i(" forward method, overrides the "),Dn=n("code"),il=i("__call__"),ll=i(" special method."),cl=h(),v(Ze.$$.fragment),dl=h(),v(Ke.$$.fragment),As=h(),Ce=n("h2"),Xe=n("a"),Vn=n("span"),v(rt.$$.fragment),hl=h(),Rn=n("span"),ml=i("ChineseCLIPTextModel"),qs=h(),A=n("div"),v(at.$$.fragment),pl=h(),it=n("p"),fl=i(`The text model from CHINESE_CLIP without any head or projection on top.
This model is a PyTorch `),lt=n("a"),gl=i("torch.nn.Module"),ul=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_l=h(),ct=n("p"),Cl=i(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),dt=n("a"),vl=i(`Attention is
all you need`),Pl=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),bl=h(),k=n("p"),Il=i("To behave as an decoder the model needs to be initialized with the "),Bn=n("code"),yl=i("is_decoder"),Ll=i(` argument of the configuration set
to `),Wn=n("code"),$l=i("True"),Tl=i(". To be used in a Seq2Seq model, the model needs to initialized with both "),Un=n("code"),wl=i("is_decoder"),xl=i(` argument and
`),Hn=n("code"),zl=i("add_cross_attention"),kl=i(" set to "),Jn=n("code"),El=i("True"),jl=i("; an "),Gn=n("code"),Ml=i("encoder_hidden_states"),Al=i(" is then expected as an input to the forward pass."),ql=h(),W=n("div"),v(ht.$$.fragment),Sl=h(),ve=n("p"),Ol=i("The "),Ut=n("a"),Fl=i("ChineseCLIPTextModel"),Nl=i(" forward method, overrides the "),Yn=n("code"),Dl=i("__call__"),Vl=i(" special method."),Rl=h(),v(Qe.$$.fragment),Bl=h(),v(eo.$$.fragment),Ss=h(),Pe=n("h2"),oo=n("a"),Zn=n("span"),v(mt.$$.fragment),Wl=h(),Kn=n("span"),Ul=i("ChineseCLIPVisionModel"),Os=h(),G=n("div"),v(pt.$$.fragment),Hl=h(),ft=n("p"),Jl=i(`The vision model from CHINESE_CLIP without any head or projection on top.
This model is a PyTorch `),gt=n("a"),Gl=i("torch.nn.Module"),Yl=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Zl=h(),U=n("div"),v(ut.$$.fragment),Kl=h(),be=n("p"),Xl=i("The "),Ht=n("a"),Ql=i("ChineseCLIPVisionModel"),ec=i(" forward method, overrides the "),Xn=n("code"),oc=i("__call__"),tc=i(" special method."),nc=h(),v(to.$$.fragment),sc=h(),v(no.$$.fragment),this.h()},l(o){const g=Ud('[data-svelte="svelte-1phssyn"]',document.head);d=s(g,"META",{name:!0,content:!0}),g.forEach(t),$=m(o),u=s(o,"H1",{class:!0});var _t=r(u);f=s(_t,"A",{id:!0,class:!0,href:!0});var Qn=r(f);C=s(Qn,"SPAN",{});var es=r(C);P(a.$$.fragment,es),es.forEach(t),Qn.forEach(t),p=m(_t),x=s(_t,"SPAN",{});var os=r(x);fr=l(os,"Chinese-CLIP"),os.forEach(t),_t.forEach(t),ds=m(o),te=s(o,"H2",{class:!0});var Ct=r(te);Le=s(Ct,"A",{id:!0,class:!0,href:!0});var ts=r(Le);sn=s(ts,"SPAN",{});var ns=r(sn);P(go.$$.fragment,ns),ns.forEach(t),ts.forEach(t),gr=m(Ct),rn=s(Ct,"SPAN",{});var ss=r(rn);ur=l(ss,"Overview"),ss.forEach(t),Ct.forEach(t),hs=m(o),Z=s(o,"P",{});var Ie=r(Z);_r=l(Ie,"The Chinese-CLIP model was proposed in "),uo=s(Ie,"A",{href:!0,rel:!0});var rs=r(uo);Cr=l(rs,"Chinese CLIP: Contrastive Vision-Language Pretraining in Chinese"),rs.forEach(t),vr=l(Ie,` by An Yang, Junshu Pan, Junyang Lin, Rui Men, Yichang Zhang, Jingren Zhou, Chang Zhou.
Chinese-CLIP is an implementation of CLIP (Radford et al., 2021) on a large-scale dataset of Chinese image-text pairs. It is capable of performing cross-modal retrieval and also playing as a vision backbone for vision tasks like zero-shot image classification, open-domain object detection, etc. The original Chinese-CLIP code is released `),_o=s(Ie,"A",{href:!0,rel:!0});var as=r(_o);Pr=l(as,"at this link"),as.forEach(t),br=l(Ie,"."),Ie.forEach(t),ms=m(o),Pt=s(o,"P",{});var is=r(Pt);Ir=l(is,"The abstract from the paper is the following:"),is.forEach(t),ps=m(o),bt=s(o,"P",{});var ls=r(bt);an=s(ls,"EM",{});var rc=r(an);yr=l(rc,"The tremendous success of CLIP (Radford et al., 2021) has promoted the research and application of contrastive learning for vision-language pretraining. In this work, we construct a large-scale dataset of image-text pairs in Chinese, where most data are retrieved from publicly available datasets, and we pretrain Chinese CLIP models on the new dataset. We develop 5 Chinese CLIP models of multiple sizes, spanning from 77 to 958 million parameters. Furthermore, we propose a two-stage pretraining method, where the model is first trained with the image encoder frozen and then trained with all parameters being optimized, to achieve enhanced model performance. Our comprehensive experiments demonstrate that Chinese CLIP can achieve the state-of-the-art performance on MUGE, Flickr30K-CN, and COCO-CN in the setups of zero-shot learning and finetuning, and it is able to achieve competitive performance in zero-shot image classification based on the evaluation on the ELEVATER benchmark (Li et al., 2022). Our codes, pretrained models, and demos have been released."),rc.forEach(t),ls.forEach(t),fs=m(o),ne=s(o,"H2",{class:!0});var Ns=r(ne);$e=s(Ns,"A",{id:!0,class:!0,href:!0});var ac=r($e);ln=s(ac,"SPAN",{});var ic=r(ln);P(Co.$$.fragment,ic),ic.forEach(t),ac.forEach(t),Lr=m(Ns),cn=s(Ns,"SPAN",{});var lc=r(cn);$r=l(lc,"Usage"),lc.forEach(t),Ns.forEach(t),gs=m(o),It=s(o,"P",{});var cc=r(It);Tr=l(cc,"The code snippet below shows how to compute image & text features and similarities:"),cc.forEach(t),us=m(o),P(vo.$$.fragment,o),_s=m(o),yt=s(o,"P",{});var dc=r(yt);wr=l(dc,"Currently, we release the following scales of pretrained Chinese-CLIP models at HF Model Hub:"),dc.forEach(t),Cs=m(o),D=s(o,"UL",{});var so=r(D);dn=s(so,"LI",{});var hc=r(dn);Po=s(hc,"A",{href:!0,rel:!0});var mc=r(Po);xr=l(mc,"OFA-Sys/chinese-clip-vit-base-patch16"),mc.forEach(t),hc.forEach(t),zr=m(so),hn=s(so,"LI",{});var pc=r(hn);bo=s(pc,"A",{href:!0,rel:!0});var fc=r(bo);kr=l(fc,"OFA-Sys/chinese-clip-vit-large-patch14"),fc.forEach(t),pc.forEach(t),Er=m(so),mn=s(so,"LI",{});var gc=r(mn);Io=s(gc,"A",{href:!0,rel:!0});var uc=r(Io);jr=l(uc,"OFA-Sys/chinese-clip-vit-large-patch14-336px"),uc.forEach(t),gc.forEach(t),Mr=m(so),pn=s(so,"LI",{});var _c=r(pn);yo=s(_c,"A",{href:!0,rel:!0});var Cc=r(yo);Ar=l(Cc,"OFA-Sys/chinese-clip-vit-huge-patch14"),Cc.forEach(t),_c.forEach(t),so.forEach(t),vs=m(o),Te=s(o,"P",{});var Ds=r(Te);qr=l(Ds,"The Chinese-CLIP model was contributed by "),Lo=s(Ds,"A",{href:!0,rel:!0});var vc=r(Lo);Sr=l(vc,"OFA-Sys"),vc.forEach(t),Or=l(Ds,"."),Ds.forEach(t),Ps=m(o),se=s(o,"H2",{class:!0});var Vs=r(se);we=s(Vs,"A",{id:!0,class:!0,href:!0});var Pc=r(we);fn=s(Pc,"SPAN",{});var bc=r(fn);P($o.$$.fragment,bc),bc.forEach(t),Pc.forEach(t),Fr=m(Vs),gn=s(Vs,"SPAN",{});var Ic=r(gn);Nr=l(Ic,"ChineseCLIPConfig"),Ic.forEach(t),Vs.forEach(t),bs=m(o),E=s(o,"DIV",{class:!0});var X=r(E);P(To.$$.fragment,X),Dr=m(X),K=s(X,"P",{});var vt=r(K);Lt=s(vt,"A",{href:!0});var yc=r(Lt);Vr=l(yc,"ChineseCLIPConfig"),yc.forEach(t),Rr=l(vt," is the configuration class to store the configuration of a "),$t=s(vt,"A",{href:!0});var Lc=r($t);Br=l(Lc,"ChineseCLIPModel"),Lc.forEach(t),Wr=l(vt,`. It is used
to instantiate Chinese-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
Chinese-CLIP `),wo=s(vt,"A",{href:!0,rel:!0});var $c=r(wo);Ur=l($c,"OFA-Sys/chinese-clip-vit-base-patch16"),$c.forEach(t),Hr=l(vt,`
architecture.`),vt.forEach(t),Jr=m(X),re=s(X,"P",{});var Jt=r(re);Gr=l(Jt,"Configuration objects inherit from "),Tt=s(Jt,"A",{href:!0});var Tc=r(Tt);Yr=l(Tc,"PretrainedConfig"),Tc.forEach(t),Zr=l(Jt,` and can be used to control the model outputs. Read the
documentation from `),wt=s(Jt,"A",{href:!0});var wc=r(wt);Kr=l(wc,"PretrainedConfig"),wc.forEach(t),Xr=l(Jt," for more information."),Jt.forEach(t),Qr=m(X),P(xe.$$.fragment,X),ea=m(X),ze=s(X,"DIV",{class:!0});var Rs=r(ze);P(xo.$$.fragment,Rs),oa=m(Rs),ae=s(Rs,"P",{});var Gt=r(ae);ta=l(Gt,"Instantiate a "),xt=s(Gt,"A",{href:!0});var xc=r(xt);na=l(xc,"ChineseCLIPConfig"),xc.forEach(t),sa=l(Gt,` (or a derived class) from Chinese-CLIP text model configuration and
Chinese-CLIP vision model configuration. Returns:
`),zt=s(Gt,"A",{href:!0});var zc=r(zt);ra=l(zc,"ChineseCLIPConfig"),zc.forEach(t),aa=l(Gt,": An instance of a configuration object"),Gt.forEach(t),Rs.forEach(t),X.forEach(t),Is=m(o),ie=s(o,"H2",{class:!0});var Bs=r(ie);ke=s(Bs,"A",{id:!0,class:!0,href:!0});var kc=r(ke);un=s(kc,"SPAN",{});var Ec=r(un);P(zo.$$.fragment,Ec),Ec.forEach(t),kc.forEach(t),ia=m(Bs),_n=s(Bs,"SPAN",{});var jc=r(_n);la=l(jc,"ChineseCLIPTextConfig"),jc.forEach(t),Bs.forEach(t),ys=m(o),F=s(o,"DIV",{class:!0});var ro=r(F);P(ko.$$.fragment,ro),ca=m(ro),Eo=s(ro,"P",{});var Ws=r(Eo);da=l(Ws,"This is the configuration class to store the configuration of a "),kt=s(Ws,"A",{href:!0});var Mc=r(kt);ha=l(Mc,"ChineseCLIPModel"),Mc.forEach(t),ma=l(Ws,`. It is used to instantiate a
Chinese 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 Chinese CLIP
[OFA-Sys/chinese-clip-vit-base-patch16](https:
//huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.`),Ws.forEach(t),pa=m(ro),le=s(ro,"P",{});var Yt=r(le);fa=l(Yt,"Configuration objects inherit from "),Et=s(Yt,"A",{href:!0});var Ac=r(Et);ga=l(Ac,"PretrainedConfig"),Ac.forEach(t),ua=l(Yt,` and can be used to control the model outputs. Read the
documentation from `),jt=s(Yt,"A",{href:!0});var qc=r(jt);_a=l(qc,"PretrainedConfig"),qc.forEach(t),Ca=l(Yt," for more information."),Yt.forEach(t),va=m(ro),P(Ee.$$.fragment,ro),ro.forEach(t),Ls=m(o),ce=s(o,"H2",{class:!0});var Us=r(ce);je=s(Us,"A",{id:!0,class:!0,href:!0});var Sc=r(je);Cn=s(Sc,"SPAN",{});var Oc=r(Cn);P(jo.$$.fragment,Oc),Oc.forEach(t),Sc.forEach(t),Pa=m(Us),vn=s(Us,"SPAN",{});var Fc=r(vn);ba=l(Fc,"ChineseCLIPVisionConfig"),Fc.forEach(t),Us.forEach(t),$s=m(o),N=s(o,"DIV",{class:!0});var ao=r(N);P(Mo.$$.fragment,ao),Ia=m(ao),Ao=s(ao,"P",{});var Hs=r(Ao);ya=l(Hs,"This is the configuration class to store the configuration of a "),Mt=s(Hs,"A",{href:!0});var Nc=r(Mt);La=l(Nc,"ChineseCLIPModel"),Nc.forEach(t),$a=l(Hs,`. It is used to instantiate an
ChineseCLIP 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 ChineseCLIP
[OFA-Sys/chinese-clip-vit-base-patch16](https:
//huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.`),Hs.forEach(t),Ta=m(ao),de=s(ao,"P",{});var Zt=r(de);wa=l(Zt,"Configuration objects inherit from "),At=s(Zt,"A",{href:!0});var Dc=r(At);xa=l(Dc,"PretrainedConfig"),Dc.forEach(t),za=l(Zt,` and can be used to control the model outputs. Read the
documentation from `),qt=s(Zt,"A",{href:!0});var Vc=r(qt);ka=l(Vc,"PretrainedConfig"),Vc.forEach(t),Ea=l(Zt," for more information."),Zt.forEach(t),ja=m(ao),P(Me.$$.fragment,ao),ao.forEach(t),Ts=m(o),he=s(o,"H2",{class:!0});var Js=r(he);Ae=s(Js,"A",{id:!0,class:!0,href:!0});var Rc=r(Ae);Pn=s(Rc,"SPAN",{});var Bc=r(Pn);P(qo.$$.fragment,Bc),Bc.forEach(t),Rc.forEach(t),Ma=m(Js),bn=s(Js,"SPAN",{});var Wc=r(bn);Aa=l(Wc,"ChineseCLIPImageProcessor"),Wc.forEach(t),Js.forEach(t),ws=m(o),J=s(o,"DIV",{class:!0});var Kt=r(J);P(So.$$.fragment,Kt),qa=m(Kt),In=s(Kt,"P",{});var Uc=r(In);Sa=l(Uc,"Constructs a Chinese-CLIP image processor."),Uc.forEach(t),Oa=m(Kt),qe=s(Kt,"DIV",{class:!0});var Gs=r(qe);P(Oo.$$.fragment,Gs),Fa=m(Gs),yn=s(Gs,"P",{});var Hc=r(yn);Na=l(Hc,"Preprocess an image or batch of images."),Hc.forEach(t),Gs.forEach(t),Kt.forEach(t),xs=m(o),me=s(o,"H2",{class:!0});var Ys=r(me);Se=s(Ys,"A",{id:!0,class:!0,href:!0});var Jc=r(Se);Ln=s(Jc,"SPAN",{});var Gc=r(Ln);P(Fo.$$.fragment,Gc),Gc.forEach(t),Jc.forEach(t),Da=m(Ys),$n=s(Ys,"SPAN",{});var Yc=r($n);Va=l(Yc,"ChineseCLIPFeatureExtractor"),Yc.forEach(t),Ys.forEach(t),zs=m(o),z=s(o,"DIV",{class:!0});var S=r(z);P(No.$$.fragment,S),Ra=m(S),Tn=s(S,"P",{});var Zc=r(Tn);Ba=l(Zc,"Constructs a Chinese-CLIP image processor."),Zc.forEach(t),Wa=m(S),Oe=s(S,"DIV",{class:!0});var Zs=r(Oe);P(Do.$$.fragment,Zs),Ua=m(Zs),Vo=s(Zs,"P",{});var Ks=r(Vo);Ha=l(Ks,`Center crop an image. If the image is too small to be cropped to the size given, it will be padded (so the
returned result will always be of size `),wn=s(Ks,"CODE",{});var Kc=r(wn);Ja=l(Kc,"size"),Kc.forEach(t),Ga=l(Ks,")."),Ks.forEach(t),Zs.forEach(t),Ya=m(S),Fe=s(S,"DIV",{class:!0});var Xs=r(Fe);P(Ro.$$.fragment,Xs),Za=m(Xs),xn=s(Xs,"P",{});var Xc=r(xn);Ka=l(Xc,"Normalize an image. image = (image - image_mean) / image_std."),Xc.forEach(t),Xs.forEach(t),Xa=m(S),Ne=s(S,"DIV",{class:!0});var Qs=r(Ne);P(Bo.$$.fragment,Qs),Qa=m(Qs),zn=s(Qs,"P",{});var Qc=r(zn);ei=l(Qc,"Preprocess an image or batch of images."),Qc.forEach(t),Qs.forEach(t),oi=m(S),De=s(S,"DIV",{class:!0});var er=r(De);P(Wo.$$.fragment,er),ti=m(er),kn=s(er,"P",{});var ed=r(kn);ni=l(ed,"Rescale an image by a scale factor. image = image * scale."),ed.forEach(t),er.forEach(t),si=m(S),Ve=s(S,"DIV",{class:!0});var or=r(Ve);P(Uo.$$.fragment,or),ri=m(or),En=s(or,"P",{});var od=r(En);ai=l(od,`Resize an image. The shortest edge of the image is resized to size[\u201Cshortest_edge\u201D], with the longest edge
resized to keep the input aspect ratio.`),od.forEach(t),or.forEach(t),S.forEach(t),ks=m(o),pe=s(o,"H2",{class:!0});var tr=r(pe);Re=s(tr,"A",{id:!0,class:!0,href:!0});var td=r(Re);jn=s(td,"SPAN",{});var nd=r(jn);P(Ho.$$.fragment,nd),nd.forEach(t),td.forEach(t),ii=m(tr),Mn=s(tr,"SPAN",{});var sd=r(Mn);li=l(sd,"ChineseCLIPProcessor"),sd.forEach(t),tr.forEach(t),Es=m(o),j=s(o,"DIV",{class:!0});var Q=r(j);P(Jo.$$.fragment,Q),ci=m(Q),An=s(Q,"P",{});var rd=r(An);di=l(rd,`Constructs a Chinese-CLIP processor which wraps a Chinese-CLIP feature extractor and a Chinese-CLIP tokenizer into
a single processor.`),rd.forEach(t),hi=m(Q),q=s(Q,"P",{});var Y=r(q);St=s(Y,"A",{href:!0});var ad=r(St);mi=l(ad,"ChineseCLIPProcessor"),ad.forEach(t),pi=l(Y," offers all the functionalities of "),Ot=s(Y,"A",{href:!0});var id=r(Ot);fi=l(id,"ChineseCLIPFeatureExtractor"),id.forEach(t),gi=l(Y,` and
`),Ft=s(Y,"A",{href:!0});var ld=r(Ft);ui=l(ld,"BertTokenizerFast"),ld.forEach(t),_i=l(Y,". See the "),qn=s(Y,"CODE",{});var cd=r(qn);Ci=l(cd,"__call__()"),cd.forEach(t),vi=l(Y," and "),Nt=s(Y,"A",{href:!0});var dd=r(Nt);Pi=l(dd,"decode()"),dd.forEach(t),bi=l(Y,` for more
information.`),Y.forEach(t),Ii=m(Q),Be=s(Q,"DIV",{class:!0});var nr=r(Be);P(Go.$$.fragment,nr),yi=m(nr),Yo=s(nr,"P",{});var sr=r(Yo);Li=l(sr,"This method forwards all its arguments to BertTokenizerFast\u2019s "),Dt=s(sr,"A",{href:!0});var hd=r(Dt);$i=l(hd,"batch_decode()"),hd.forEach(t),Ti=l(sr,`. Please
refer to the docstring of this method for more information.`),sr.forEach(t),nr.forEach(t),wi=m(Q),We=s(Q,"DIV",{class:!0});var rr=r(We);P(Zo.$$.fragment,rr),xi=m(rr),Ko=s(rr,"P",{});var ar=r(Ko);zi=l(ar,"This method forwards all its arguments to BertTokenizerFast\u2019s "),Vt=s(ar,"A",{href:!0});var md=r(Vt);ki=l(md,"decode()"),md.forEach(t),Ei=l(ar,`. Please refer to
the docstring of this method for more information.`),ar.forEach(t),rr.forEach(t),Q.forEach(t),js=m(o),fe=s(o,"H2",{class:!0});var ir=r(fe);Ue=s(ir,"A",{id:!0,class:!0,href:!0});var pd=r(Ue);Sn=s(pd,"SPAN",{});var fd=r(Sn);P(Xo.$$.fragment,fd),fd.forEach(t),pd.forEach(t),ji=m(ir),On=s(ir,"SPAN",{});var gd=r(On);Mi=l(gd,"ChineseCLIPModel"),gd.forEach(t),ir.forEach(t),Ms=m(o),M=s(o,"DIV",{class:!0});var ee=r(M);P(Qo.$$.fragment,ee),Ai=m(ee),et=s(ee,"P",{});var lr=r(et);qi=l(lr,"This model is a PyTorch "),ot=s(lr,"A",{href:!0,rel:!0});var ud=r(ot);Si=l(ud,"torch.nn.Module"),ud.forEach(t),Oi=l(lr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),lr.forEach(t),Fi=m(ee),V=s(ee,"DIV",{class:!0});var io=r(V);P(tt.$$.fragment,io),Ni=m(io),ge=s(io,"P",{});var Xt=r(ge);Di=l(Xt,"The "),Rt=s(Xt,"A",{href:!0});var _d=r(Rt);Vi=l(_d,"ChineseCLIPModel"),_d.forEach(t),Ri=l(Xt," forward method, overrides the "),Fn=s(Xt,"CODE",{});var Cd=r(Fn);Bi=l(Cd,"__call__"),Cd.forEach(t),Wi=l(Xt," special method."),Xt.forEach(t),Ui=m(io),P(He.$$.fragment,io),Hi=m(io),P(Je.$$.fragment,io),io.forEach(t),Ji=m(ee),R=s(ee,"DIV",{class:!0});var lo=r(R);P(nt.$$.fragment,lo),Gi=m(lo),ue=s(lo,"P",{});var Qt=r(ue);Yi=l(Qt,"The "),Bt=s(Qt,"A",{href:!0});var vd=r(Bt);Zi=l(vd,"ChineseCLIPModel"),vd.forEach(t),Ki=l(Qt," forward method, overrides the "),Nn=s(Qt,"CODE",{});var Pd=r(Nn);Xi=l(Pd,"__call__"),Pd.forEach(t),Qi=l(Qt," special method."),Qt.forEach(t),el=m(lo),P(Ge.$$.fragment,lo),ol=m(lo),P(Ye.$$.fragment,lo),lo.forEach(t),tl=m(ee),B=s(ee,"DIV",{class:!0});var co=r(B);P(st.$$.fragment,co),nl=m(co),_e=s(co,"P",{});var en=r(_e);sl=l(en,"The "),Wt=s(en,"A",{href:!0});var bd=r(Wt);rl=l(bd,"ChineseCLIPModel"),bd.forEach(t),al=l(en," forward method, overrides the "),Dn=s(en,"CODE",{});var Id=r(Dn);il=l(Id,"__call__"),Id.forEach(t),ll=l(en," special method."),en.forEach(t),cl=m(co),P(Ze.$$.fragment,co),dl=m(co),P(Ke.$$.fragment,co),co.forEach(t),ee.forEach(t),As=m(o),Ce=s(o,"H2",{class:!0});var cr=r(Ce);Xe=s(cr,"A",{id:!0,class:!0,href:!0});var yd=r(Xe);Vn=s(yd,"SPAN",{});var Ld=r(Vn);P(rt.$$.fragment,Ld),Ld.forEach(t),yd.forEach(t),hl=m(cr),Rn=s(cr,"SPAN",{});var $d=r(Rn);ml=l($d,"ChineseCLIPTextModel"),$d.forEach(t),cr.forEach(t),qs=m(o),A=s(o,"DIV",{class:!0});var oe=r(A);P(at.$$.fragment,oe),pl=m(oe),it=s(oe,"P",{});var dr=r(it);fl=l(dr,`The text model from CHINESE_CLIP without any head or projection on top.
This model is a PyTorch `),lt=s(dr,"A",{href:!0,rel:!0});var Td=r(lt);gl=l(Td,"torch.nn.Module"),Td.forEach(t),ul=l(dr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),dr.forEach(t),_l=m(oe),ct=s(oe,"P",{});var hr=r(ct);Cl=l(hr,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),dt=s(hr,"A",{href:!0,rel:!0});var wd=r(dt);vl=l(wd,`Attention is
all you need`),wd.forEach(t),Pl=l(hr,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),hr.forEach(t),bl=m(oe),k=s(oe,"P",{});var O=r(k);Il=l(O,"To behave as an decoder the model needs to be initialized with the "),Bn=s(O,"CODE",{});var xd=r(Bn);yl=l(xd,"is_decoder"),xd.forEach(t),Ll=l(O,` argument of the configuration set
to `),Wn=s(O,"CODE",{});var zd=r(Wn);$l=l(zd,"True"),zd.forEach(t),Tl=l(O,". To be used in a Seq2Seq model, the model needs to initialized with both "),Un=s(O,"CODE",{});var kd=r(Un);wl=l(kd,"is_decoder"),kd.forEach(t),xl=l(O,` argument and
`),Hn=s(O,"CODE",{});var Ed=r(Hn);zl=l(Ed,"add_cross_attention"),Ed.forEach(t),kl=l(O," set to "),Jn=s(O,"CODE",{});var jd=r(Jn);El=l(jd,"True"),jd.forEach(t),jl=l(O,"; an "),Gn=s(O,"CODE",{});var Md=r(Gn);Ml=l(Md,"encoder_hidden_states"),Md.forEach(t),Al=l(O," is then expected as an input to the forward pass."),O.forEach(t),ql=m(oe),W=s(oe,"DIV",{class:!0});var ho=r(W);P(ht.$$.fragment,ho),Sl=m(ho),ve=s(ho,"P",{});var on=r(ve);Ol=l(on,"The "),Ut=s(on,"A",{href:!0});var Ad=r(Ut);Fl=l(Ad,"ChineseCLIPTextModel"),Ad.forEach(t),Nl=l(on," forward method, overrides the "),Yn=s(on,"CODE",{});var qd=r(Yn);Dl=l(qd,"__call__"),qd.forEach(t),Vl=l(on," special method."),on.forEach(t),Rl=m(ho),P(Qe.$$.fragment,ho),Bl=m(ho),P(eo.$$.fragment,ho),ho.forEach(t),oe.forEach(t),Ss=m(o),Pe=s(o,"H2",{class:!0});var mr=r(Pe);oo=s(mr,"A",{id:!0,class:!0,href:!0});var Sd=r(oo);Zn=s(Sd,"SPAN",{});var Od=r(Zn);P(mt.$$.fragment,Od),Od.forEach(t),Sd.forEach(t),Wl=m(mr),Kn=s(mr,"SPAN",{});var Fd=r(Kn);Ul=l(Fd,"ChineseCLIPVisionModel"),Fd.forEach(t),mr.forEach(t),Os=m(o),G=s(o,"DIV",{class:!0});var tn=r(G);P(pt.$$.fragment,tn),Hl=m(tn),ft=s(tn,"P",{});var pr=r(ft);Jl=l(pr,`The vision model from CHINESE_CLIP without any head or projection on top.
This model is a PyTorch `),gt=s(pr,"A",{href:!0,rel:!0});var Nd=r(gt);Gl=l(Nd,"torch.nn.Module"),Nd.forEach(t),Yl=l(pr,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pr.forEach(t),Zl=m(tn),U=s(tn,"DIV",{class:!0});var mo=r(U);P(ut.$$.fragment,mo),Kl=m(mo),be=s(mo,"P",{});var nn=r(be);Xl=l(nn,"The "),Ht=s(nn,"A",{href:!0});var Dd=r(Ht);Ql=l(Dd,"ChineseCLIPVisionModel"),Dd.forEach(t),ec=l(nn," forward method, overrides the "),Xn=s(nn,"CODE",{});var Vd=r(Xn);oc=l(Vd,"__call__"),Vd.forEach(t),tc=l(nn," special method."),nn.forEach(t),nc=m(mo),P(to.$$.fragment,mo),sc=m(mo),P(no.$$.fragment,mo),mo.forEach(t),tn.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(ih)),c(f,"id","chineseclip"),c(f,"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(f,"href","#chineseclip"),c(u,"class","relative group"),c(Le,"id","overview"),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","#overview"),c(te,"class","relative group"),c(uo,"href","https://arxiv.org/abs/2211.01335"),c(uo,"rel","nofollow"),c(_o,"href","https://github.com/OFA-Sys/Chinese-CLIP"),c(_o,"rel","nofollow"),c($e,"id","usage"),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","#usage"),c(ne,"class","relative group"),c(Po,"href","https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16"),c(Po,"rel","nofollow"),c(bo,"href","https://huggingface.co/OFA-Sys/chinese-clip-vit-large-patch14"),c(bo,"rel","nofollow"),c(Io,"href","https://huggingface.co/OFA-Sys/chinese-clip-vit-large-patch14-336px"),c(Io,"rel","nofollow"),c(yo,"href","https://huggingface.co/OFA-Sys/chinese-clip-vit-huge-patch14"),c(yo,"rel","nofollow"),c(Lo,"href","https://huggingface.co/OFA-Sys"),c(Lo,"rel","nofollow"),c(we,"id","transformers.ChineseCLIPConfig"),c(we,"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(we,"href","#transformers.ChineseCLIPConfig"),c(se,"class","relative group"),c(Lt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig"),c($t,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel"),c(wo,"href","https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16"),c(wo,"rel","nofollow"),c(Tt,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(wt,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(xt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig"),c(zt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig"),c(ze,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ke,"id","transformers.ChineseCLIPTextConfig"),c(ke,"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(ke,"href","#transformers.ChineseCLIPTextConfig"),c(ie,"class","relative group"),c(kt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel"),c(Et,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(jt,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(je,"id","transformers.ChineseCLIPVisionConfig"),c(je,"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(je,"href","#transformers.ChineseCLIPVisionConfig"),c(ce,"class","relative group"),c(Mt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel"),c(At,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(qt,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ae,"id","transformers.ChineseCLIPImageProcessor"),c(Ae,"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(Ae,"href","#transformers.ChineseCLIPImageProcessor"),c(he,"class","relative group"),c(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Se,"id","transformers.ChineseCLIPImageProcessor"),c(Se,"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(Se,"href","#transformers.ChineseCLIPImageProcessor"),c(me,"class","relative group"),c(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ne,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Re,"id","transformers.ChineseCLIPProcessor"),c(Re,"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(Re,"href","#transformers.ChineseCLIPProcessor"),c(pe,"class","relative group"),c(St,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPProcessor"),c(Ot,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor"),c(Ft,"href","/docs/transformers/v4.25.1/en/model_doc/bert#transformers.BertTokenizerFast"),c(Nt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPProcessor.decode"),c(Dt,"href","/docs/transformers/v4.25.1/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(Vt,"href","/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),c(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ue,"id","transformers.ChineseCLIPModel"),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","#transformers.ChineseCLIPModel"),c(fe,"class","relative group"),c(ot,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(ot,"rel","nofollow"),c(Rt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel"),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(Bt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Wt,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPModel"),c(B,"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(Xe,"id","transformers.ChineseCLIPTextModel"),c(Xe,"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(Xe,"href","#transformers.ChineseCLIPTextModel"),c(Ce,"class","relative group"),c(lt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(lt,"rel","nofollow"),c(dt,"href","https://arxiv.org/abs/1706.03762"),c(dt,"rel","nofollow"),c(Ut,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(oo,"id","transformers.ChineseCLIPVisionModel"),c(oo,"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(oo,"href","#transformers.ChineseCLIPVisionModel"),c(Pe,"class","relative group"),c(gt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(gt,"rel","nofollow"),c(Ht,"href","/docs/transformers/v4.25.1/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,d),_(o,$,g),_(o,u,g),e(u,f),e(f,C),b(a,C,null),e(u,p),e(u,x),e(x,fr),_(o,ds,g),_(o,te,g),e(te,Le),e(Le,sn),b(go,sn,null),e(te,gr),e(te,rn),e(rn,ur),_(o,hs,g),_(o,Z,g),e(Z,_r),e(Z,uo),e(uo,Cr),e(Z,vr),e(Z,_o),e(_o,Pr),e(Z,br),_(o,ms,g),_(o,Pt,g),e(Pt,Ir),_(o,ps,g),_(o,bt,g),e(bt,an),e(an,yr),_(o,fs,g),_(o,ne,g),e(ne,$e),e($e,ln),b(Co,ln,null),e(ne,Lr),e(ne,cn),e(cn,$r),_(o,gs,g),_(o,It,g),e(It,Tr),_(o,us,g),b(vo,o,g),_(o,_s,g),_(o,yt,g),e(yt,wr),_(o,Cs,g),_(o,D,g),e(D,dn),e(dn,Po),e(Po,xr),e(D,zr),e(D,hn),e(hn,bo),e(bo,kr),e(D,Er),e(D,mn),e(mn,Io),e(Io,jr),e(D,Mr),e(D,pn),e(pn,yo),e(yo,Ar),_(o,vs,g),_(o,Te,g),e(Te,qr),e(Te,Lo),e(Lo,Sr),e(Te,Or),_(o,Ps,g),_(o,se,g),e(se,we),e(we,fn),b($o,fn,null),e(se,Fr),e(se,gn),e(gn,Nr),_(o,bs,g),_(o,E,g),b(To,E,null),e(E,Dr),e(E,K),e(K,Lt),e(Lt,Vr),e(K,Rr),e(K,$t),e($t,Br),e(K,Wr),e(K,wo),e(wo,Ur),e(K,Hr),e(E,Jr),e(E,re),e(re,Gr),e(re,Tt),e(Tt,Yr),e(re,Zr),e(re,wt),e(wt,Kr),e(re,Xr),e(E,Qr),b(xe,E,null),e(E,ea),e(E,ze),b(xo,ze,null),e(ze,oa),e(ze,ae),e(ae,ta),e(ae,xt),e(xt,na),e(ae,sa),e(ae,zt),e(zt,ra),e(ae,aa),_(o,Is,g),_(o,ie,g),e(ie,ke),e(ke,un),b(zo,un,null),e(ie,ia),e(ie,_n),e(_n,la),_(o,ys,g),_(o,F,g),b(ko,F,null),e(F,ca),e(F,Eo),e(Eo,da),e(Eo,kt),e(kt,ha),e(Eo,ma),e(F,pa),e(F,le),e(le,fa),e(le,Et),e(Et,ga),e(le,ua),e(le,jt),e(jt,_a),e(le,Ca),e(F,va),b(Ee,F,null),_(o,Ls,g),_(o,ce,g),e(ce,je),e(je,Cn),b(jo,Cn,null),e(ce,Pa),e(ce,vn),e(vn,ba),_(o,$s,g),_(o,N,g),b(Mo,N,null),e(N,Ia),e(N,Ao),e(Ao,ya),e(Ao,Mt),e(Mt,La),e(Ao,$a),e(N,Ta),e(N,de),e(de,wa),e(de,At),e(At,xa),e(de,za),e(de,qt),e(qt,ka),e(de,Ea),e(N,ja),b(Me,N,null),_(o,Ts,g),_(o,he,g),e(he,Ae),e(Ae,Pn),b(qo,Pn,null),e(he,Ma),e(he,bn),e(bn,Aa),_(o,ws,g),_(o,J,g),b(So,J,null),e(J,qa),e(J,In),e(In,Sa),e(J,Oa),e(J,qe),b(Oo,qe,null),e(qe,Fa),e(qe,yn),e(yn,Na),_(o,xs,g),_(o,me,g),e(me,Se),e(Se,Ln),b(Fo,Ln,null),e(me,Da),e(me,$n),e($n,Va),_(o,zs,g),_(o,z,g),b(No,z,null),e(z,Ra),e(z,Tn),e(Tn,Ba),e(z,Wa),e(z,Oe),b(Do,Oe,null),e(Oe,Ua),e(Oe,Vo),e(Vo,Ha),e(Vo,wn),e(wn,Ja),e(Vo,Ga),e(z,Ya),e(z,Fe),b(Ro,Fe,null),e(Fe,Za),e(Fe,xn),e(xn,Ka),e(z,Xa),e(z,Ne),b(Bo,Ne,null),e(Ne,Qa),e(Ne,zn),e(zn,ei),e(z,oi),e(z,De),b(Wo,De,null),e(De,ti),e(De,kn),e(kn,ni),e(z,si),e(z,Ve),b(Uo,Ve,null),e(Ve,ri),e(Ve,En),e(En,ai),_(o,ks,g),_(o,pe,g),e(pe,Re),e(Re,jn),b(Ho,jn,null),e(pe,ii),e(pe,Mn),e(Mn,li),_(o,Es,g),_(o,j,g),b(Jo,j,null),e(j,ci),e(j,An),e(An,di),e(j,hi),e(j,q),e(q,St),e(St,mi),e(q,pi),e(q,Ot),e(Ot,fi),e(q,gi),e(q,Ft),e(Ft,ui),e(q,_i),e(q,qn),e(qn,Ci),e(q,vi),e(q,Nt),e(Nt,Pi),e(q,bi),e(j,Ii),e(j,Be),b(Go,Be,null),e(Be,yi),e(Be,Yo),e(Yo,Li),e(Yo,Dt),e(Dt,$i),e(Yo,Ti),e(j,wi),e(j,We),b(Zo,We,null),e(We,xi),e(We,Ko),e(Ko,zi),e(Ko,Vt),e(Vt,ki),e(Ko,Ei),_(o,js,g),_(o,fe,g),e(fe,Ue),e(Ue,Sn),b(Xo,Sn,null),e(fe,ji),e(fe,On),e(On,Mi),_(o,Ms,g),_(o,M,g),b(Qo,M,null),e(M,Ai),e(M,et),e(et,qi),e(et,ot),e(ot,Si),e(et,Oi),e(M,Fi),e(M,V),b(tt,V,null),e(V,Ni),e(V,ge),e(ge,Di),e(ge,Rt),e(Rt,Vi),e(ge,Ri),e(ge,Fn),e(Fn,Bi),e(ge,Wi),e(V,Ui),b(He,V,null),e(V,Hi),b(Je,V,null),e(M,Ji),e(M,R),b(nt,R,null),e(R,Gi),e(R,ue),e(ue,Yi),e(ue,Bt),e(Bt,Zi),e(ue,Ki),e(ue,Nn),e(Nn,Xi),e(ue,Qi),e(R,el),b(Ge,R,null),e(R,ol),b(Ye,R,null),e(M,tl),e(M,B),b(st,B,null),e(B,nl),e(B,_e),e(_e,sl),e(_e,Wt),e(Wt,rl),e(_e,al),e(_e,Dn),e(Dn,il),e(_e,ll),e(B,cl),b(Ze,B,null),e(B,dl),b(Ke,B,null),_(o,As,g),_(o,Ce,g),e(Ce,Xe),e(Xe,Vn),b(rt,Vn,null),e(Ce,hl),e(Ce,Rn),e(Rn,ml),_(o,qs,g),_(o,A,g),b(at,A,null),e(A,pl),e(A,it),e(it,fl),e(it,lt),e(lt,gl),e(it,ul),e(A,_l),e(A,ct),e(ct,Cl),e(ct,dt),e(dt,vl),e(ct,Pl),e(A,bl),e(A,k),e(k,Il),e(k,Bn),e(Bn,yl),e(k,Ll),e(k,Wn),e(Wn,$l),e(k,Tl),e(k,Un),e(Un,wl),e(k,xl),e(k,Hn),e(Hn,zl),e(k,kl),e(k,Jn),e(Jn,El),e(k,jl),e(k,Gn),e(Gn,Ml),e(k,Al),e(A,ql),e(A,W),b(ht,W,null),e(W,Sl),e(W,ve),e(ve,Ol),e(ve,Ut),e(Ut,Fl),e(ve,Nl),e(ve,Yn),e(Yn,Dl),e(ve,Vl),e(W,Rl),b(Qe,W,null),e(W,Bl),b(eo,W,null),_(o,Ss,g),_(o,Pe,g),e(Pe,oo),e(oo,Zn),b(mt,Zn,null),e(Pe,Wl),e(Pe,Kn),e(Kn,Ul),_(o,Os,g),_(o,G,g),b(pt,G,null),e(G,Hl),e(G,ft),e(ft,Jl),e(ft,gt),e(gt,Gl),e(ft,Yl),e(G,Zl),e(G,U),b(ut,U,null),e(U,Kl),e(U,be),e(be,Xl),e(be,Ht),e(Ht,Ql),e(be,ec),e(be,Xn),e(Xn,oc),e(be,tc),e(U,nc),b(to,U,null),e(U,sc),b(no,U,null),Fs=!0},p(o,[g]){const _t={};g&2&&(_t.$$scope={dirty:g,ctx:o}),xe.$set(_t);const Qn={};g&2&&(Qn.$$scope={dirty:g,ctx:o}),Ee.$set(Qn);const es={};g&2&&(es.$$scope={dirty:g,ctx:o}),Me.$set(es);const os={};g&2&&(os.$$scope={dirty:g,ctx:o}),He.$set(os);const Ct={};g&2&&(Ct.$$scope={dirty:g,ctx:o}),Je.$set(Ct);const ts={};g&2&&(ts.$$scope={dirty:g,ctx:o}),Ge.$set(ts);const ns={};g&2&&(ns.$$scope={dirty:g,ctx:o}),Ye.$set(ns);const ss={};g&2&&(ss.$$scope={dirty:g,ctx:o}),Ze.$set(ss);const Ie={};g&2&&(Ie.$$scope={dirty:g,ctx:o}),Ke.$set(Ie);const rs={};g&2&&(rs.$$scope={dirty:g,ctx:o}),Qe.$set(rs);const as={};g&2&&(as.$$scope={dirty:g,ctx:o}),eo.$set(as);const is={};g&2&&(is.$$scope={dirty:g,ctx:o}),to.$set(is);const ls={};g&2&&(ls.$$scope={dirty:g,ctx:o}),no.$set(ls)},i(o){Fs||(I(a.$$.fragment,o),I(go.$$.fragment,o),I(Co.$$.fragment,o),I(vo.$$.fragment,o),I($o.$$.fragment,o),I(To.$$.fragment,o),I(xe.$$.fragment,o),I(xo.$$.fragment,o),I(zo.$$.fragment,o),I(ko.$$.fragment,o),I(Ee.$$.fragment,o),I(jo.$$.fragment,o),I(Mo.$$.fragment,o),I(Me.$$.fragment,o),I(qo.$$.fragment,o),I(So.$$.fragment,o),I(Oo.$$.fragment,o),I(Fo.$$.fragment,o),I(No.$$.fragment,o),I(Do.$$.fragment,o),I(Ro.$$.fragment,o),I(Bo.$$.fragment,o),I(Wo.$$.fragment,o),I(Uo.$$.fragment,o),I(Ho.$$.fragment,o),I(Jo.$$.fragment,o),I(Go.$$.fragment,o),I(Zo.$$.fragment,o),I(Xo.$$.fragment,o),I(Qo.$$.fragment,o),I(tt.$$.fragment,o),I(He.$$.fragment,o),I(Je.$$.fragment,o),I(nt.$$.fragment,o),I(Ge.$$.fragment,o),I(Ye.$$.fragment,o),I(st.$$.fragment,o),I(Ze.$$.fragment,o),I(Ke.$$.fragment,o),I(rt.$$.fragment,o),I(at.$$.fragment,o),I(ht.$$.fragment,o),I(Qe.$$.fragment,o),I(eo.$$.fragment,o),I(mt.$$.fragment,o),I(pt.$$.fragment,o),I(ut.$$.fragment,o),I(to.$$.fragment,o),I(no.$$.fragment,o),Fs=!0)},o(o){y(a.$$.fragment,o),y(go.$$.fragment,o),y(Co.$$.fragment,o),y(vo.$$.fragment,o),y($o.$$.fragment,o),y(To.$$.fragment,o),y(xe.$$.fragment,o),y(xo.$$.fragment,o),y(zo.$$.fragment,o),y(ko.$$.fragment,o),y(Ee.$$.fragment,o),y(jo.$$.fragment,o),y(Mo.$$.fragment,o),y(Me.$$.fragment,o),y(qo.$$.fragment,o),y(So.$$.fragment,o),y(Oo.$$.fragment,o),y(Fo.$$.fragment,o),y(No.$$.fragment,o),y(Do.$$.fragment,o),y(Ro.$$.fragment,o),y(Bo.$$.fragment,o),y(Wo.$$.fragment,o),y(Uo.$$.fragment,o),y(Ho.$$.fragment,o),y(Jo.$$.fragment,o),y(Go.$$.fragment,o),y(Zo.$$.fragment,o),y(Xo.$$.fragment,o),y(Qo.$$.fragment,o),y(tt.$$.fragment,o),y(He.$$.fragment,o),y(Je.$$.fragment,o),y(nt.$$.fragment,o),y(Ge.$$.fragment,o),y(Ye.$$.fragment,o),y(st.$$.fragment,o),y(Ze.$$.fragment,o),y(Ke.$$.fragment,o),y(rt.$$.fragment,o),y(at.$$.fragment,o),y(ht.$$.fragment,o),y(Qe.$$.fragment,o),y(eo.$$.fragment,o),y(mt.$$.fragment,o),y(pt.$$.fragment,o),y(ut.$$.fragment,o),y(to.$$.fragment,o),y(no.$$.fragment,o),Fs=!1},d(o){t(d),o&&t($),o&&t(u),L(a),o&&t(ds),o&&t(te),L(go),o&&t(hs),o&&t(Z),o&&t(ms),o&&t(Pt),o&&t(ps),o&&t(bt),o&&t(fs),o&&t(ne),L(Co),o&&t(gs),o&&t(It),o&&t(us),L(vo,o),o&&t(_s),o&&t(yt),o&&t(Cs),o&&t(D),o&&t(vs),o&&t(Te),o&&t(Ps),o&&t(se),L($o),o&&t(bs),o&&t(E),L(To),L(xe),L(xo),o&&t(Is),o&&t(ie),L(zo),o&&t(ys),o&&t(F),L(ko),L(Ee),o&&t(Ls),o&&t(ce),L(jo),o&&t($s),o&&t(N),L(Mo),L(Me),o&&t(Ts),o&&t(he),L(qo),o&&t(ws),o&&t(J),L(So),L(Oo),o&&t(xs),o&&t(me),L(Fo),o&&t(zs),o&&t(z),L(No),L(Do),L(Ro),L(Bo),L(Wo),L(Uo),o&&t(ks),o&&t(pe),L(Ho),o&&t(Es),o&&t(j),L(Jo),L(Go),L(Zo),o&&t(js),o&&t(fe),L(Xo),o&&t(Ms),o&&t(M),L(Qo),L(tt),L(He),L(Je),L(nt),L(Ge),L(Ye),L(st),L(Ze),L(Ke),o&&t(As),o&&t(Ce),L(rt),o&&t(qs),o&&t(A),L(at),L(ht),L(Qe),L(eo),o&&t(Ss),o&&t(Pe),L(mt),o&&t(Os),o&&t(G),L(pt),L(ut),L(to),L(no)}}}const ih={local:"chineseclip",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"transformers.ChineseCLIPConfig",title:"ChineseCLIPConfig"},{local:"transformers.ChineseCLIPTextConfig",title:"ChineseCLIPTextConfig"},{local:"transformers.ChineseCLIPVisionConfig",title:"ChineseCLIPVisionConfig"},{local:"transformers.ChineseCLIPImageProcessor",title:"ChineseCLIPImageProcessor"},{local:"transformers.ChineseCLIPImageProcessor",title:"ChineseCLIPFeatureExtractor"},{local:"transformers.ChineseCLIPProcessor",title:"ChineseCLIPProcessor"},{local:"transformers.ChineseCLIPModel",title:"ChineseCLIPModel"},{local:"transformers.ChineseCLIPTextModel",title:"ChineseCLIPTextModel"},{local:"transformers.ChineseCLIPVisionModel",title:"ChineseCLIPVisionModel"}],title:"Chinese-CLIP"};function lh(T){return Hd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gh extends Rd{constructor(d){super();Bd(this,d,lh,ah,Wd,{})}}export{gh as default,ih as metadata};
