import{S as od,i as sd,s as nd,e as a,k as p,w,t as s,M as ad,c as r,d as o,m,a as i,x as y,h as n,b as d,N as rd,G as e,g,y as $,q as T,o as k,B as x,v as id,L as It}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ei}from"../../chunks/Tip-hf-doc-builder.js";import{D as S}from"../../chunks/Docstring-hf-doc-builder.js";import{C as qt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as he}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Mt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ld(G){let c,b,_,h,v;return h=new qt({props:{code:`from transformers import GitVisionConfig, GitVisionModel

# Initializing a GitVisionConfig with microsoft/git-base style configuration
configuration = GitVisionConfig()

# Initializing a GitVisionModel (with random weights) from the microsoft/git-base style configuration
model = GitVisionModel(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> GitVisionConfig, GitVisionModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GitVisionModel (with random weights) from the microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitVisionModel(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(){c=a("p"),b=s("Example:"),_=p(),w(h.$$.fragment)},l(l){c=r(l,"P",{});var u=i(c);b=n(u,"Example:"),u.forEach(o),_=m(l),y(h.$$.fragment,l)},m(l,u){g(l,c,u),e(c,b),g(l,_,u),$(h,l,u),v=!0},p:It,i(l){v||(T(h.$$.fragment,l),v=!0)},o(l){k(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(_),x(h,l)}}}function dd(G){let c,b,_,h,v;return{c(){c=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
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(l){c=r(l,"P",{});var u=i(c);b=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(u,"CODE",{});var z=i(_);h=n(z,"Module"),z.forEach(o),v=n(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){g(l,c,u),e(c,b),e(c,_),e(_,h),e(c,v)},d(l){l&&o(c)}}}function cd(G){let c,b,_,h,v;return h=new qt({props:{code:`from PIL import Image
import requests
from transformers import AutoProcessor, GitVisionModel

processor = AutoProcessor.from_pretrained("microsoft/git-base")
model = GitVisionModel.from_pretrained("microsoft/git-base")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
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`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, GitVisionModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>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`}}),{c(){c=a("p"),b=s("Examples:"),_=p(),w(h.$$.fragment)},l(l){c=r(l,"P",{});var u=i(c);b=n(u,"Examples:"),u.forEach(o),_=m(l),y(h.$$.fragment,l)},m(l,u){g(l,c,u),e(c,b),g(l,_,u),$(h,l,u),v=!0},p:It,i(l){v||(T(h.$$.fragment,l),v=!0)},o(l){k(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(_),x(h,l)}}}function pd(G){let c,b,_,h,v;return h=new qt({props:{code:`from transformers import GitConfig, GitModel

# Initializing a GIT microsoft/git-base style configuration
configuration = GitConfig()

# Initializing a model (with random weights) from the microsoft/git-base style configuration
model = GitModel(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> GitConfig, GitModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GIT microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GitConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitModel(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(){c=a("p"),b=s("Examples:"),_=p(),w(h.$$.fragment)},l(l){c=r(l,"P",{});var u=i(c);b=n(u,"Examples:"),u.forEach(o),_=m(l),y(h.$$.fragment,l)},m(l,u){g(l,c,u),e(c,b),g(l,_,u),$(h,l,u),v=!0},p:It,i(l){v||(T(h.$$.fragment,l),v=!0)},o(l){k(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(_),x(h,l)}}}function md(G){let c,b,_,h,v;return{c(){c=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
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(l){c=r(l,"P",{});var u=i(c);b=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(u,"CODE",{});var z=i(_);h=n(z,"Module"),z.forEach(o),v=n(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){g(l,c,u),e(c,b),e(c,_),e(_,h),e(c,v)},d(l){l&&o(c)}}}function hd(G){let c,b,_,h,v;return h=new qt({props:{code:`from transformers import AutoProcessor, AutoModel
import requests
from PIL import Image

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

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

text = "this is an image of two cats"

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

outputs = model(**inputs)
last_hidden_state = 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> AutoProcessor, AutoModel
<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> PIL <span class="hljs-keyword">import</span> Image

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;this is an image of two cats&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text, 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`}}),{c(){c=a("p"),b=s("Examples:"),_=p(),w(h.$$.fragment)},l(l){c=r(l,"P",{});var u=i(c);b=n(u,"Examples:"),u.forEach(o),_=m(l),y(h.$$.fragment,l)},m(l,u){g(l,c,u),e(c,b),g(l,_,u),$(h,l,u),v=!0},p:It,i(l){v||(T(h.$$.fragment,l),v=!0)},o(l){k(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(_),x(h,l)}}}function fd(G){let c,b,_,h,v;return{c(){c=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),v=s(`
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(l){c=r(l,"P",{});var u=i(c);b=n(u,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(u,"CODE",{});var z=i(_);h=n(z,"Module"),z.forEach(o),v=n(u,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),u.forEach(o)},m(l,u){g(l,c,u),e(c,b),e(c,_),e(_,h),e(c,v)},d(l){l&&o(c)}}}function ud(G){let c,b,_,h,v;return h=new qt({props:{code:`from transformers import AutoProcessor, AutoModelForCausalLM
import requests
from PIL import Image

processor = AutoProcessor.from_pretrained("microsoft/git-base-coco")
model = AutoModelForCausalLM.from_pretrained("microsoft/git-base-coco")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

pixel_values = processor(images=image, return_tensors="pt").pixel_values

generated_ids = model.generate(pixel_values=pixel_values, max_length=50)
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(generated_caption)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM
<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> PIL <span class="hljs-keyword">import</span> Image

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

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, max_length=<span class="hljs-number">50</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_caption)
two cats sleeping on a pink blanket <span class="hljs-built_in">next</span> to remotes.`}}),{c(){c=a("p"),b=s("Image captioning example:"),_=p(),w(h.$$.fragment)},l(l){c=r(l,"P",{});var u=i(c);b=n(u,"Image captioning example:"),u.forEach(o),_=m(l),y(h.$$.fragment,l)},m(l,u){g(l,c,u),e(c,b),g(l,_,u),$(h,l,u),v=!0},p:It,i(l){v||(T(h.$$.fragment,l),v=!0)},o(l){k(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(_),x(h,l)}}}function gd(G){let c,b,_,h,v;return h=new qt({props:{code:`from transformers import AutoProcessor, AutoModelForCausalLM
from huggingface_hub import hf_hub_download
from PIL import Image

processor = AutoProcessor.from_pretrained("microsoft/git-base-textvqa")
model = AutoModelForCausalLM.from_pretrained("microsoft/git-base-textvqa")

file_path = hf_hub_download(repo_id="nielsr/textvqa-sample", filename="bus.png", repo_type="dataset")
image = Image.open(file_path).convert("RGB")

pixel_values = processor(images=image, return_tensors="pt").pixel_values

question = "what does the front of the bus say at the top?"

input_ids = processor(text=question, add_special_tokens=False).input_ids
input_ids = [processor.tokenizer.cls_token_id] + input_ids
input_ids = torch.tensor(input_ids).unsqueeze(0)

generated_ids = model.generate(pixel_values=pixel_values, input_ids=input_ids, max_length=50)
print(processor.batch_decode(generated_ids, skip_special_tokens=True))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

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

<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(repo_id=<span class="hljs-string">&quot;nielsr/textvqa-sample&quot;</span>, filename=<span class="hljs-string">&quot;bus.png&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(file_path).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>question = <span class="hljs-string">&quot;what does the front of the bus say at the top?&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = processor(text=question, add_special_tokens=<span class="hljs-literal">False</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = [processor.tokenizer.cls_token_id] + input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(input_ids).unsqueeze(<span class="hljs-number">0</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, input_ids=input_ids, max_length=<span class="hljs-number">50</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>))
[<span class="hljs-string">&#x27;what does the front of the bus say at the top? special&#x27;</span>]`}}),{c(){c=a("p"),b=s("Visual question answering (VQA) example:"),_=p(),w(h.$$.fragment)},l(l){c=r(l,"P",{});var u=i(c);b=n(u,"Visual question answering (VQA) example:"),u.forEach(o),_=m(l),y(h.$$.fragment,l)},m(l,u){g(l,c,u),e(c,b),g(l,_,u),$(h,l,u),v=!0},p:It,i(l){v||(T(h.$$.fragment,l),v=!0)},o(l){k(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(_),x(h,l)}}}function _d(G){let c,b,_,h,v;return h=new qt({props:{code:`import av
import numpy as np
from PIL import Image
from huggingface_hub import hf_hub_download
from transformers import AutoProcessor, AutoModelForCausalLM

processor = AutoProcessor.from_pretrained("microsoft/git-base-vatex")
model = AutoModelForCausalLM.from_pretrained("microsoft/git-base-vatex")

# set seed for reproducability
np.random.seed(45)


def read_video_pyav(container, indices):
    '''
    Decode the video with PyAV decoder.
    Args:
        container (\`av.container.input.InputContainer\`): PyAV container.
        indices (\`List[int]\`): List of frame indices to decode.
    Returns:
        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
    '''
    frames = []
    container.seek(0)
    start_index = indices[0]
    end_index = indices[-1]
    for i, frame in enumerate(container.decode(video=0)):
        if i > end_index:
            break
        if i >= start_index and i in indices:
            frames.append(frame)
    return np.stack([x.to_ndarray(format="rgb24") for x in frames])


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


# load video
file_path = hf_hub_download(
    repo_id="nielsr/video-demo", filename="eating_spaghetti.mp4", repo_type="dataset"
)
container = av.open(file_path)

# sample frames
num_frames = model.config.num_image_with_embedding
indices = sample_frame_indices(
    clip_len=num_frames, frame_sample_rate=4, seg_len=container.streams.video[0].frames
)
frames = read_video_pyav(container, indices)

pixel_values = processor(images=list(frames), return_tensors="pt").pixel_values

generated_ids = model.generate(pixel_values=pixel_values, max_length=50)

print("Generated caption:", processor.batch_decode(generated_ids, skip_special_tokens=True))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> av
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># set seed for reproducability</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">45</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">read_video_pyav</span>(<span class="hljs-params">container, indices</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Decode the video with PyAV decoder.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        container (\`av.container.input.InputContainer\`): PyAV container.
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of frame indices to decode.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</span>
<span class="hljs-meta">... </span>    frames = []
<span class="hljs-meta">... </span>    container.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">... </span>    start_index = indices[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    end_index = indices[-<span class="hljs-number">1</span>]
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i, frame <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(container.decode(video=<span class="hljs-number">0</span>)):
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt; end_index:
<span class="hljs-meta">... </span>            <span class="hljs-keyword">break</span>
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt;= start_index <span class="hljs-keyword">and</span> i <span class="hljs-keyword">in</span> indices:
<span class="hljs-meta">... </span>            frames.append(frame)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> np.stack([x.to_ndarray(<span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;rgb24&quot;</span>) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> frames])


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


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load video</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>container = av.<span class="hljs-built_in">open</span>(file_path)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_frames = model.config.num_image_with_embedding
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(
<span class="hljs-meta">... </span>    clip_len=num_frames, frame_sample_rate=<span class="hljs-number">4</span>, seg_len=container.streams.video[<span class="hljs-number">0</span>].frames
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>frames = read_video_pyav(container, indices)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, max_length=<span class="hljs-number">50</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Generated caption:&quot;</span>, processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>))
Generated caption: [<span class="hljs-string">&#x27;a woman is sitting at a table and she is talking about the food she is holding.&#x27;</span>]`}}),{c(){c=a("p"),b=s("Video captioning example:"),_=p(),w(h.$$.fragment)},l(l){c=r(l,"P",{});var u=i(c);b=n(u,"Video captioning example:"),u.forEach(o),_=m(l),y(h.$$.fragment,l)},m(l,u){g(l,c,u),e(c,b),g(l,_,u),$(h,l,u),v=!0},p:It,i(l){v||(T(h.$$.fragment,l),v=!0)},o(l){k(h.$$.fragment,l),v=!1},d(l){l&&o(c),l&&o(_),x(h,l)}}}function vd(G){let c,b,_,h,v,l,u,z,on,ds,J,fe,go,Se,sn,_o,nn,cs,W,an,We,rn,ln,zt,dn,cn,ps,At,pn,ms,Lt,vo,mn,hs,Ft,hn,fs,ue,Re,fn,bo,un,gn,_n,Q,vn,Vt,bn,wn,wo,yn,$n,us,ge,Mi,gs,_e,Tn,Be,kn,xn,_s,R,jn,He,Gn,Pn,Ue,Cn,En,vs,X,ve,yo,Ze,Mn,$o,In,bs,Ot,qn,ws,be,Je,zn,Qe,An,Ln,Fn,Nt,Vn,Dt,On,ys,St,Nn,$s,K,we,To,Xe,Dn,ko,Sn,Ts,F,Ke,Wn,Y,Rn,Wt,Bn,Hn,Ye,Un,Zn,Jn,ee,Qn,Rt,Xn,Kn,Bt,Yn,ea,ta,ye,ks,te,$e,xo,et,oa,jo,sa,xs,E,tt,na,Go,aa,ra,ot,ia,Ht,la,da,ca,st,pa,nt,ma,ha,fa,O,at,ua,oe,ga,Ut,_a,va,Po,ba,wa,ya,Te,$a,ke,js,se,xe,Co,rt,Ta,Eo,ka,Gs,M,it,xa,ne,ja,Zt,Ga,Pa,lt,Ca,Ea,Ma,ae,Ia,Jt,qa,za,Qt,Aa,La,Fa,je,Va,Ge,dt,Oa,re,Na,Xt,Da,Sa,Mo,Wa,Ra,Ps,ie,Pe,Io,ct,Ba,qo,Ha,Cs,V,pt,Ua,zo,Za,Ja,A,Kt,Qa,Xa,Yt,Ka,Ya,eo,er,tr,mt,Ao,or,sr,nr,Lo,ar,rr,ir,Ce,ht,lr,j,dr,Fo,cr,pr,Vo,mr,hr,ft,Oo,fr,ur,gr,No,_r,vr,Do,br,wr,So,yr,$r,Wo,Tr,kr,ut,Ro,xr,jr,Gr,Bo,Pr,Cr,Ho,Er,Mr,Es,le,Ee,Uo,gt,Ir,Zo,qr,Ms,I,_t,zr,Jo,Ar,Lr,vt,Fr,to,Vr,Or,Nr,bt,Dr,wt,Sr,Wr,Rr,N,yt,Br,de,Hr,oo,Ur,Zr,Qo,Jr,Qr,Xr,Me,Kr,Ie,Is,ce,qe,Xo,$t,Yr,Ko,ei,qs,q,Tt,ti,kt,oi,Yo,si,ni,ai,xt,ri,so,ii,li,di,jt,ci,Gt,pi,mi,hi,C,Pt,fi,pe,ui,no,gi,_i,es,vi,bi,wi,ze,yi,ts,$i,Ti,Ae,ki,Le,xi,Fe,zs;return l=new he({}),Se=new he({}),Ze=new he({}),Xe=new he({}),Ke=new S({props:{name:"class transformers.GitVisionConfig",anchor:"transformers.GitVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{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:" = 16"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.GitVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.GitVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GitVisionConfig.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.GitVisionConfig.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"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/git/configuration_git.py#L31"}}),ye=new Mt({props:{anchor:"transformers.GitVisionConfig.example",$$slots:{default:[ld]},$$scope:{ctx:G}}}),et=new he({}),tt=new S({props:{name:"class transformers.GitVisionModel",anchor:"transformers.GitVisionModel",parameters:[{name:"config",val:": GitVisionConfig"}],parametersDescription:[{anchor:"transformers.GitVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitConfig">GitConfig</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.27.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.27.1/src/transformers/models/git/modeling_git.py#L993"}}),at=new S({props:{name:"forward",anchor:"transformers.GitVisionModel.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.GitVisionModel.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.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitVisionModel.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.GitVisionModel.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.GitVisionModel.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.27.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.27.1/src/transformers/models/git/modeling_git.py#L1007",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</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.git.configuration_git.GitVisionConfig'&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>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.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new Ei({props:{$$slots:{default:[dd]},$$scope:{ctx:G}}}),ke=new Mt({props:{anchor:"transformers.GitVisionModel.forward.example",$$slots:{default:[cd]},$$scope:{ctx:G}}}),rt=new he({}),it=new S({props:{name:"class transformers.GitConfig",anchor:"transformers.GitConfig",parameters:[{name:"vision_config",val:" = None"},{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 6"},{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:" = 1024"},{name:"initializer_range",val:" = 0.02"},{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:"tie_word_embeddings",val:" = False"},{name:"bos_token_id",val:" = 101"},{name:"eos_token_id",val:" = 102"},{name:"num_image_with_embedding",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitConfig.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.27.1/en/model_doc/git#transformers.GitVisionConfig">GitVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.GitConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the GIT 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.27.1/en/model_doc/git#transformers.GitModel">GitModel</a>.`,name:"vocab_size"},{anchor:"transformers.GitConfig.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.GitConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#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.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.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).`,name:"use_cache"},{anchor:"transformers.GitConfig.num_image_with_embedding",description:`<strong>num_image_with_embedding</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of temporal embeddings to add, in case the model is used for video captioning/VQA.`,name:"num_image_with_embedding"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/git/configuration_git.py#L127"}}),je=new Mt({props:{anchor:"transformers.GitConfig.example",$$slots:{default:[pd]},$$scope:{ctx:G}}}),dt=new S({props:{name:"to_dict",anchor:"transformers.GitConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/git/configuration_git.py#L241"}}),ct=new he({}),pt=new S({props:{name:"class transformers.GitProcessor",anchor:"transformers.GitProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.GitProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.GitProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/git/processing_git.py#L23"}}),ht=new S({props:{name:"__call__",anchor:"transformers.GitProcessor.__call__",parameters:[{name:"text",val:" = None"},{name:"images",val:" = None"},{name:"return_tensors",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitProcessor.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.GitProcessor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape (C, H, W), where C is a
number of channels, H and W are image height and width.`,name:"images"},{anchor:"transformers.GitProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.27.1/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/git/processing_git.py#L44",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li><strong>input_ids</strong> \u2014 List of token ids to be fed to a model. Returned when <code>text</code> is not <code>None</code>.</li>
<li><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code> and if <code>text</code> is not
<code>None</code>).</li>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model. Returned when <code>images</code> is not <code>None</code>.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),gt=new he({}),_t=new S({props:{name:"class transformers.GitModel",anchor:"transformers.GitModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GitModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitConfig">GitConfig</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.27.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.27.1/src/transformers/models/git/modeling_git.py#L1065"}}),yt=new S({props:{name:"forward",anchor:"transformers.GitModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"pixel_values",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:"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.GitModel.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.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.GitModel.forward.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.GitModel.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.GitModel.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. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitModel.forward.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.GitModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GitModel.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.GitModel.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.GitModel.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GitModel.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.GitModel.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.27.1/src/transformers/models/git/modeling_git.py#L1155",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.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 (<a
  href="/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitConfig"
>GitConfig</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new Ei({props:{$$slots:{default:[md]},$$scope:{ctx:G}}}),Ie=new Mt({props:{anchor:"transformers.GitModel.forward.example",$$slots:{default:[hd]},$$scope:{ctx:G}}}),$t=new he({}),Tt=new S({props:{name:"class transformers.GitForCausalLM",anchor:"transformers.GitForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GitForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitConfig">GitConfig</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.27.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.27.1/src/transformers/models/git/modeling_git.py#L1326"}}),Pt=new S({props:{name:"forward",anchor:"transformers.GitForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"pixel_values",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:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = 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.GitForCausalLM.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.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.GitForCausalLM.forward.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.GitForCausalLM.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.GitForCausalLM.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. Pixel values can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitForCausalLM.forward.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.GitForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GitForCausalLM.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.GitForCausalLM.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.GitForCausalLM.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.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GitForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.GitForCausalLM.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.GitForCausalLM.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.27.1/src/transformers/models/git/modeling_git.py#L1342",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitConfig"
>GitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \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>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \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.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ze=new Ei({props:{$$slots:{default:[fd]},$$scope:{ctx:G}}}),Ae=new Mt({props:{anchor:"transformers.GitForCausalLM.forward.example",$$slots:{default:[ud]},$$scope:{ctx:G}}}),Le=new Mt({props:{anchor:"transformers.GitForCausalLM.forward.example-2",$$slots:{default:[gd]},$$scope:{ctx:G}}}),Fe=new Mt({props:{anchor:"transformers.GitForCausalLM.forward.example-3",$$slots:{default:[_d]},$$scope:{ctx:G}}}),{c(){c=a("meta"),b=p(),_=a("h1"),h=a("a"),v=a("span"),w(l.$$.fragment),u=p(),z=a("span"),on=s("GIT"),ds=p(),J=a("h2"),fe=a("a"),go=a("span"),w(Se.$$.fragment),sn=p(),_o=a("span"),nn=s("Overview"),cs=p(),W=a("p"),an=s("The GIT model was proposed in "),We=a("a"),rn=s("GIT: A Generative Image-to-text Transformer for Vision and Language"),ln=s(` by
Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, Lijuan Wang. GIT is a decoder-only Transformer
that leverages `),zt=a("a"),dn=s("CLIP"),cn=s(`\u2019s vision encoder to condition the model on vision inputs besides text. The model obtains state-of-the-art results on
image captioning and visual question answering benchmarks.`),ps=p(),At=a("p"),pn=s("The abstract from the paper is the following:"),ms=p(),Lt=a("p"),vo=a("em"),mn=s("In this paper, we design and train a Generative Image-to-text Transformer, GIT, to unify vision-language tasks such as image/video captioning and question answering. While generative models provide a consistent network architecture between pre-training and fine-tuning, existing work typically contains complex structures (uni/multi-modal encoder/decoder) and depends on external modules such as object detectors/taggers and optical character recognition (OCR). In GIT, we simplify the architecture as one image encoder and one text decoder under a single language modeling task. We also scale up the pre-training data and the model size to boost the model performance. Without bells and whistles, our GIT establishes new state of the arts on 12 challenging benchmarks with a large margin. For instance, our model surpasses the human performance for the first time on TextCaps (138.2 vs. 125.5 in CIDEr). Furthermore, we present a new scheme of generation-based image classification and scene text recognition, achieving decent performance on standard benchmarks."),hs=p(),Ft=a("p"),hn=s("Tips:"),fs=p(),ue=a("ul"),Re=a("li"),fn=s("GIT is implemented in a very similar way to GPT-2, the only difference being that the model is also conditioned on "),bo=a("code"),un=s("pixel_values"),gn=s("."),_n=p(),Q=a("li"),vn=s("One can use "),Vt=a("a"),bn=s("GitProcessor"),wn=s(" to prepare images for the model, and the "),wo=a("code"),yn=s("generate"),$n=s(" method for autoregressive generation."),us=p(),ge=a("img"),gs=p(),_e=a("small"),Tn=s("GIT architecture. Taken from the "),Be=a("a"),kn=s("original paper"),xn=s("."),_s=p(),R=a("p"),jn=s("This model was contributed by "),He=a("a"),Gn=s("nielsr"),Pn=s(`.
The original code can be found `),Ue=a("a"),Cn=s("here"),En=s("."),vs=p(),X=a("h2"),ve=a("a"),yo=a("span"),w(Ze.$$.fragment),Mn=p(),$o=a("span"),In=s("Resources"),bs=p(),Ot=a("p"),qn=s("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with GIT."),ws=p(),be=a("ul"),Je=a("li"),zn=s("Demo notebooks regarding inference + fine-tuning GIT on custom data can be found "),Qe=a("a"),An=s("here"),Ln=s("."),Fn=p(),Nt=a("li"),Vn=s("See also: "),Dt=a("a"),On=s("Causal language modeling task guide"),ys=p(),St=a("p"),Nn=s(`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),$s=p(),K=a("h2"),we=a("a"),To=a("span"),w(Xe.$$.fragment),Dn=p(),ko=a("span"),Sn=s("GitVisionConfig"),Ts=p(),F=a("div"),w(Ke.$$.fragment),Wn=p(),Y=a("p"),Rn=s("This is the configuration class to store the configuration of a "),Wt=a("a"),Bn=s("GitVisionModel"),Hn=s(`. It is used to instantiate a GIT
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the GIT
`),Ye=a("a"),Un=s("microsoft/git-base"),Zn=s(" architecture."),Jn=p(),ee=a("p"),Qn=s("Configuration objects inherit from "),Rt=a("a"),Xn=s("PretrainedConfig"),Kn=s(` and can be used to control the model outputs. Read the
documentation from `),Bt=a("a"),Yn=s("PretrainedConfig"),ea=s(" for more information."),ta=p(),w(ye.$$.fragment),ks=p(),te=a("h2"),$e=a("a"),xo=a("span"),w(et.$$.fragment),oa=p(),jo=a("span"),sa=s("GitVisionModel"),xs=p(),E=a("div"),w(tt.$$.fragment),na=p(),Go=a("p"),aa=s("The vision model from CLIP, used in GIT, without any head or projection on top."),ra=p(),ot=a("p"),ia=s("This model inherits from "),Ht=a("a"),la=s("PreTrainedModel"),da=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ca=p(),st=a("p"),pa=s("This model is also a PyTorch "),nt=a("a"),ma=s("torch.nn.Module"),ha=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fa=p(),O=a("div"),w(at.$$.fragment),ua=p(),oe=a("p"),ga=s("The "),Ut=a("a"),_a=s("GitVisionModel"),va=s(" forward method, overrides the "),Po=a("code"),ba=s("__call__"),wa=s(" special method."),ya=p(),w(Te.$$.fragment),$a=p(),w(ke.$$.fragment),js=p(),se=a("h2"),xe=a("a"),Co=a("span"),w(rt.$$.fragment),Ta=p(),Eo=a("span"),ka=s("GitConfig"),Gs=p(),M=a("div"),w(it.$$.fragment),xa=p(),ne=a("p"),ja=s("This is the configuration class to store the configuration of a "),Zt=a("a"),Ga=s("GitModel"),Pa=s(`. It is used to instantiate a GIT 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 GIT
`),lt=a("a"),Ca=s("microsoft/git-base"),Ea=s(" architecture."),Ma=p(),ae=a("p"),Ia=s("Configuration objects inherit from "),Jt=a("a"),qa=s("PretrainedConfig"),za=s(` and can be used to control the model outputs. Read the
documentation from `),Qt=a("a"),Aa=s("PretrainedConfig"),La=s(" for more information."),Fa=p(),w(je.$$.fragment),Va=p(),Ge=a("div"),w(dt.$$.fragment),Oa=p(),re=a("p"),Na=s("Serializes this instance to a Python dictionary. Override the default "),Xt=a("a"),Da=s("to_dict()"),Sa=s(`. Returns:
`),Mo=a("code"),Wa=s("Dict[str, any]"),Ra=s(": Dictionary of all the attributes that make up this configuration instance,"),Ps=p(),ie=a("h2"),Pe=a("a"),Io=a("span"),w(ct.$$.fragment),Ba=p(),qo=a("span"),Ha=s("GitProcessor"),Cs=p(),V=a("div"),w(pt.$$.fragment),Ua=p(),zo=a("p"),Za=s("Constructs a GIT processor which wraps a CLIP image processor and a BERT tokenizer into a single processor."),Ja=p(),A=a("p"),Kt=a("a"),Qa=s("GitProcessor"),Xa=s(" offers all the functionalities of "),Yt=a("a"),Ka=s("CLIPImageProcessor"),Ya=s(" and "),eo=a("a"),er=s("BertTokenizerFast"),tr=s(`. See the
`),mt=a("a"),Ao=a("strong"),or=s("call"),sr=s("()"),nr=s(" and "),Lo=a("code"),ar=s("decode()"),rr=s(" for more information."),ir=p(),Ce=a("div"),w(ht.$$.fragment),lr=p(),j=a("p"),dr=s("Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the "),Fo=a("code"),cr=s("text"),pr=s(`
and `),Vo=a("code"),mr=s("kwargs"),hr=s(" arguments to BertTokenizerFast\u2019s "),ft=a("a"),Oo=a("strong"),fr=s("call"),ur=s("()"),gr=s(" if "),No=a("code"),_r=s("text"),vr=s(" is not "),Do=a("code"),br=s("None"),wr=s(` to encode
the text. To prepare the image(s), this method forwards the `),So=a("code"),yr=s("images"),$r=s(" and "),Wo=a("code"),Tr=s("kwrags"),kr=s(` arguments to
CLIPImageProcessor\u2019s `),ut=a("a"),Ro=a("strong"),xr=s("call"),jr=s("()"),Gr=s(" if "),Bo=a("code"),Pr=s("images"),Cr=s(" is not "),Ho=a("code"),Er=s("None"),Mr=s(`. Please refer to the doctsring
of the above two methods for more information.`),Es=p(),le=a("h2"),Ee=a("a"),Uo=a("span"),w(gt.$$.fragment),Ir=p(),Zo=a("span"),qr=s("GitModel"),Ms=p(),I=a("div"),w(_t.$$.fragment),zr=p(),Jo=a("p"),Ar=s("The bare GIT Model transformer consisting of a CLIP image encoder and text decoder outputting raw hidden-states without any specific head on top."),Lr=p(),vt=a("p"),Fr=s("This model inherits from "),to=a("a"),Vr=s("PreTrainedModel"),Or=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Nr=p(),bt=a("p"),Dr=s("This model is also a PyTorch "),wt=a("a"),Sr=s("torch.nn.Module"),Wr=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rr=p(),N=a("div"),w(yt.$$.fragment),Br=p(),de=a("p"),Hr=s("The "),oo=a("a"),Ur=s("GitModel"),Zr=s(" forward method, overrides the "),Qo=a("code"),Jr=s("__call__"),Qr=s(" special method."),Xr=p(),w(Me.$$.fragment),Kr=p(),w(Ie.$$.fragment),Is=p(),ce=a("h2"),qe=a("a"),Xo=a("span"),w($t.$$.fragment),Yr=p(),Ko=a("span"),ei=s("GitForCausalLM"),qs=p(),q=a("div"),w(Tt.$$.fragment),ti=p(),kt=a("p"),oi=s("GIT Model with a "),Yo=a("code"),si=s("language modeling"),ni=s(" head on top for autoregressive language modeling."),ai=p(),xt=a("p"),ri=s("This model inherits from "),so=a("a"),ii=s("PreTrainedModel"),li=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),di=p(),jt=a("p"),ci=s("This model is also a PyTorch "),Gt=a("a"),pi=s("torch.nn.Module"),mi=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hi=p(),C=a("div"),w(Pt.$$.fragment),fi=p(),pe=a("p"),ui=s("The "),no=a("a"),gi=s("GitForCausalLM"),_i=s(" forward method, overrides the "),es=a("code"),vi=s("__call__"),bi=s(" special method."),wi=p(),w(ze.$$.fragment),yi=p(),ts=a("p"),$i=s("Examples:"),Ti=p(),w(Ae.$$.fragment),ki=p(),w(Le.$$.fragment),xi=p(),w(Fe.$$.fragment),this.h()},l(t){const f=ad('[data-svelte="svelte-1phssyn"]',document.head);c=r(f,"META",{name:!0,content:!0}),f.forEach(o),b=m(t),_=r(t,"H1",{class:!0});var Ct=i(_);h=r(Ct,"A",{id:!0,class:!0,href:!0});var os=i(h);v=r(os,"SPAN",{});var ss=i(v);y(l.$$.fragment,ss),ss.forEach(o),os.forEach(o),u=m(Ct),z=r(Ct,"SPAN",{});var ns=i(z);on=n(ns,"GIT"),ns.forEach(o),Ct.forEach(o),ds=m(t),J=r(t,"H2",{class:!0});var Et=i(J);fe=r(Et,"A",{id:!0,class:!0,href:!0});var as=i(fe);go=r(as,"SPAN",{});var rs=i(go);y(Se.$$.fragment,rs),rs.forEach(o),as.forEach(o),sn=m(Et),_o=r(Et,"SPAN",{});var is=i(_o);nn=n(is,"Overview"),is.forEach(o),Et.forEach(o),cs=m(t),W=r(t,"P",{});var me=i(W);an=n(me,"The GIT model was proposed in "),We=r(me,"A",{href:!0,rel:!0});var ls=i(We);rn=n(ls,"GIT: A Generative Image-to-text Transformer for Vision and Language"),ls.forEach(o),ln=n(me,` by
Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, Lijuan Wang. GIT is a decoder-only Transformer
that leverages `),zt=r(me,"A",{href:!0});var Ii=i(zt);dn=n(Ii,"CLIP"),Ii.forEach(o),cn=n(me,`\u2019s vision encoder to condition the model on vision inputs besides text. The model obtains state-of-the-art results on
image captioning and visual question answering benchmarks.`),me.forEach(o),ps=m(t),At=r(t,"P",{});var qi=i(At);pn=n(qi,"The abstract from the paper is the following:"),qi.forEach(o),ms=m(t),Lt=r(t,"P",{});var zi=i(Lt);vo=r(zi,"EM",{});var Ai=i(vo);mn=n(Ai,"In this paper, we design and train a Generative Image-to-text Transformer, GIT, to unify vision-language tasks such as image/video captioning and question answering. While generative models provide a consistent network architecture between pre-training and fine-tuning, existing work typically contains complex structures (uni/multi-modal encoder/decoder) and depends on external modules such as object detectors/taggers and optical character recognition (OCR). In GIT, we simplify the architecture as one image encoder and one text decoder under a single language modeling task. We also scale up the pre-training data and the model size to boost the model performance. Without bells and whistles, our GIT establishes new state of the arts on 12 challenging benchmarks with a large margin. For instance, our model surpasses the human performance for the first time on TextCaps (138.2 vs. 125.5 in CIDEr). Furthermore, we present a new scheme of generation-based image classification and scene text recognition, achieving decent performance on standard benchmarks."),Ai.forEach(o),zi.forEach(o),hs=m(t),Ft=r(t,"P",{});var Li=i(Ft);hn=n(Li,"Tips:"),Li.forEach(o),fs=m(t),ue=r(t,"UL",{});var As=i(ue);Re=r(As,"LI",{});var Ls=i(Re);fn=n(Ls,"GIT is implemented in a very similar way to GPT-2, the only difference being that the model is also conditioned on "),bo=r(Ls,"CODE",{});var Fi=i(bo);un=n(Fi,"pixel_values"),Fi.forEach(o),gn=n(Ls,"."),Ls.forEach(o),_n=m(As),Q=r(As,"LI",{});var ao=i(Q);vn=n(ao,"One can use "),Vt=r(ao,"A",{href:!0});var Vi=i(Vt);bn=n(Vi,"GitProcessor"),Vi.forEach(o),wn=n(ao," to prepare images for the model, and the "),wo=r(ao,"CODE",{});var Oi=i(wo);yn=n(Oi,"generate"),Oi.forEach(o),$n=n(ao," method for autoregressive generation."),ao.forEach(o),As.forEach(o),us=m(t),ge=r(t,"IMG",{src:!0,alt:!0,width:!0}),gs=m(t),_e=r(t,"SMALL",{});var Fs=i(_e);Tn=n(Fs,"GIT architecture. Taken from the "),Be=r(Fs,"A",{href:!0,target:!0});var Ni=i(Be);kn=n(Ni,"original paper"),Ni.forEach(o),xn=n(Fs,"."),Fs.forEach(o),_s=m(t),R=r(t,"P",{});var ro=i(R);jn=n(ro,"This model was contributed by "),He=r(ro,"A",{href:!0,rel:!0});var Di=i(He);Gn=n(Di,"nielsr"),Di.forEach(o),Pn=n(ro,`.
The original code can be found `),Ue=r(ro,"A",{href:!0,rel:!0});var Si=i(Ue);Cn=n(Si,"here"),Si.forEach(o),En=n(ro,"."),ro.forEach(o),vs=m(t),X=r(t,"H2",{class:!0});var Vs=i(X);ve=r(Vs,"A",{id:!0,class:!0,href:!0});var Wi=i(ve);yo=r(Wi,"SPAN",{});var Ri=i(yo);y(Ze.$$.fragment,Ri),Ri.forEach(o),Wi.forEach(o),Mn=m(Vs),$o=r(Vs,"SPAN",{});var Bi=i($o);In=n(Bi,"Resources"),Bi.forEach(o),Vs.forEach(o),bs=m(t),Ot=r(t,"P",{});var Hi=i(Ot);qn=n(Hi,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with GIT."),Hi.forEach(o),ws=m(t),be=r(t,"UL",{});var Os=i(be);Je=r(Os,"LI",{});var Ns=i(Je);zn=n(Ns,"Demo notebooks regarding inference + fine-tuning GIT on custom data can be found "),Qe=r(Ns,"A",{href:!0,rel:!0});var Ui=i(Qe);An=n(Ui,"here"),Ui.forEach(o),Ln=n(Ns,"."),Ns.forEach(o),Fn=m(Os),Nt=r(Os,"LI",{});var ji=i(Nt);Vn=n(ji,"See also: "),Dt=r(ji,"A",{href:!0});var Zi=i(Dt);On=n(Zi,"Causal language modeling task guide"),Zi.forEach(o),ji.forEach(o),Os.forEach(o),ys=m(t),St=r(t,"P",{});var Ji=i(St);Nn=n(Ji,`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),Ji.forEach(o),$s=m(t),K=r(t,"H2",{class:!0});var Ds=i(K);we=r(Ds,"A",{id:!0,class:!0,href:!0});var Qi=i(we);To=r(Qi,"SPAN",{});var Xi=i(To);y(Xe.$$.fragment,Xi),Xi.forEach(o),Qi.forEach(o),Dn=m(Ds),ko=r(Ds,"SPAN",{});var Ki=i(ko);Sn=n(Ki,"GitVisionConfig"),Ki.forEach(o),Ds.forEach(o),Ts=m(t),F=r(t,"DIV",{class:!0});var Ve=i(F);y(Ke.$$.fragment,Ve),Wn=m(Ve),Y=r(Ve,"P",{});var io=i(Y);Rn=n(io,"This is the configuration class to store the configuration of a "),Wt=r(io,"A",{href:!0});var Yi=i(Wt);Bn=n(Yi,"GitVisionModel"),Yi.forEach(o),Hn=n(io,`. It is used to instantiate a GIT
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the GIT
`),Ye=r(io,"A",{href:!0,rel:!0});var el=i(Ye);Un=n(el,"microsoft/git-base"),el.forEach(o),Zn=n(io," architecture."),io.forEach(o),Jn=m(Ve),ee=r(Ve,"P",{});var lo=i(ee);Qn=n(lo,"Configuration objects inherit from "),Rt=r(lo,"A",{href:!0});var tl=i(Rt);Xn=n(tl,"PretrainedConfig"),tl.forEach(o),Kn=n(lo,` and can be used to control the model outputs. Read the
documentation from `),Bt=r(lo,"A",{href:!0});var ol=i(Bt);Yn=n(ol,"PretrainedConfig"),ol.forEach(o),ea=n(lo," for more information."),lo.forEach(o),ta=m(Ve),y(ye.$$.fragment,Ve),Ve.forEach(o),ks=m(t),te=r(t,"H2",{class:!0});var Ss=i(te);$e=r(Ss,"A",{id:!0,class:!0,href:!0});var sl=i($e);xo=r(sl,"SPAN",{});var nl=i(xo);y(et.$$.fragment,nl),nl.forEach(o),sl.forEach(o),oa=m(Ss),jo=r(Ss,"SPAN",{});var al=i(jo);sa=n(al,"GitVisionModel"),al.forEach(o),Ss.forEach(o),xs=m(t),E=r(t,"DIV",{class:!0});var B=i(E);y(tt.$$.fragment,B),na=m(B),Go=r(B,"P",{});var rl=i(Go);aa=n(rl,"The vision model from CLIP, used in GIT, without any head or projection on top."),rl.forEach(o),ra=m(B),ot=r(B,"P",{});var Ws=i(ot);ia=n(Ws,"This model inherits from "),Ht=r(Ws,"A",{href:!0});var il=i(Ht);la=n(il,"PreTrainedModel"),il.forEach(o),da=n(Ws,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ws.forEach(o),ca=m(B),st=r(B,"P",{});var Rs=i(st);pa=n(Rs,"This model is also a PyTorch "),nt=r(Rs,"A",{href:!0,rel:!0});var ll=i(nt);ma=n(ll,"torch.nn.Module"),ll.forEach(o),ha=n(Rs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rs.forEach(o),fa=m(B),O=r(B,"DIV",{class:!0});var Oe=i(O);y(at.$$.fragment,Oe),ua=m(Oe),oe=r(Oe,"P",{});var co=i(oe);ga=n(co,"The "),Ut=r(co,"A",{href:!0});var dl=i(Ut);_a=n(dl,"GitVisionModel"),dl.forEach(o),va=n(co," forward method, overrides the "),Po=r(co,"CODE",{});var cl=i(Po);ba=n(cl,"__call__"),cl.forEach(o),wa=n(co," special method."),co.forEach(o),ya=m(Oe),y(Te.$$.fragment,Oe),$a=m(Oe),y(ke.$$.fragment,Oe),Oe.forEach(o),B.forEach(o),js=m(t),se=r(t,"H2",{class:!0});var Bs=i(se);xe=r(Bs,"A",{id:!0,class:!0,href:!0});var pl=i(xe);Co=r(pl,"SPAN",{});var ml=i(Co);y(rt.$$.fragment,ml),ml.forEach(o),pl.forEach(o),Ta=m(Bs),Eo=r(Bs,"SPAN",{});var hl=i(Eo);ka=n(hl,"GitConfig"),hl.forEach(o),Bs.forEach(o),Gs=m(t),M=r(t,"DIV",{class:!0});var H=i(M);y(it.$$.fragment,H),xa=m(H),ne=r(H,"P",{});var po=i(ne);ja=n(po,"This is the configuration class to store the configuration of a "),Zt=r(po,"A",{href:!0});var fl=i(Zt);Ga=n(fl,"GitModel"),fl.forEach(o),Pa=n(po,`. It is used to instantiate a GIT 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 GIT
`),lt=r(po,"A",{href:!0,rel:!0});var ul=i(lt);Ca=n(ul,"microsoft/git-base"),ul.forEach(o),Ea=n(po," architecture."),po.forEach(o),Ma=m(H),ae=r(H,"P",{});var mo=i(ae);Ia=n(mo,"Configuration objects inherit from "),Jt=r(mo,"A",{href:!0});var gl=i(Jt);qa=n(gl,"PretrainedConfig"),gl.forEach(o),za=n(mo,` and can be used to control the model outputs. Read the
documentation from `),Qt=r(mo,"A",{href:!0});var _l=i(Qt);Aa=n(_l,"PretrainedConfig"),_l.forEach(o),La=n(mo," for more information."),mo.forEach(o),Fa=m(H),y(je.$$.fragment,H),Va=m(H),Ge=r(H,"DIV",{class:!0});var Hs=i(Ge);y(dt.$$.fragment,Hs),Oa=m(Hs),re=r(Hs,"P",{});var ho=i(re);Na=n(ho,"Serializes this instance to a Python dictionary. Override the default "),Xt=r(ho,"A",{href:!0});var vl=i(Xt);Da=n(vl,"to_dict()"),vl.forEach(o),Sa=n(ho,`. Returns:
`),Mo=r(ho,"CODE",{});var bl=i(Mo);Wa=n(bl,"Dict[str, any]"),bl.forEach(o),Ra=n(ho,": Dictionary of all the attributes that make up this configuration instance,"),ho.forEach(o),Hs.forEach(o),H.forEach(o),Ps=m(t),ie=r(t,"H2",{class:!0});var Us=i(ie);Pe=r(Us,"A",{id:!0,class:!0,href:!0});var wl=i(Pe);Io=r(wl,"SPAN",{});var yl=i(Io);y(ct.$$.fragment,yl),yl.forEach(o),wl.forEach(o),Ba=m(Us),qo=r(Us,"SPAN",{});var $l=i(qo);Ha=n($l,"GitProcessor"),$l.forEach(o),Us.forEach(o),Cs=m(t),V=r(t,"DIV",{class:!0});var Ne=i(V);y(pt.$$.fragment,Ne),Ua=m(Ne),zo=r(Ne,"P",{});var Tl=i(zo);Za=n(Tl,"Constructs a GIT processor which wraps a CLIP image processor and a BERT tokenizer into a single processor."),Tl.forEach(o),Ja=m(Ne),A=r(Ne,"P",{});var D=i(A);Kt=r(D,"A",{href:!0});var kl=i(Kt);Qa=n(kl,"GitProcessor"),kl.forEach(o),Xa=n(D," offers all the functionalities of "),Yt=r(D,"A",{href:!0});var xl=i(Yt);Ka=n(xl,"CLIPImageProcessor"),xl.forEach(o),Ya=n(D," and "),eo=r(D,"A",{href:!0});var jl=i(eo);er=n(jl,"BertTokenizerFast"),jl.forEach(o),tr=n(D,`. See the
`),mt=r(D,"A",{href:!0});var Gi=i(mt);Ao=r(Gi,"STRONG",{});var Gl=i(Ao);or=n(Gl,"call"),Gl.forEach(o),sr=n(Gi,"()"),Gi.forEach(o),nr=n(D," and "),Lo=r(D,"CODE",{});var Pl=i(Lo);ar=n(Pl,"decode()"),Pl.forEach(o),rr=n(D," for more information."),D.forEach(o),ir=m(Ne),Ce=r(Ne,"DIV",{class:!0});var Zs=i(Ce);y(ht.$$.fragment,Zs),lr=m(Zs),j=r(Zs,"P",{});var P=i(j);dr=n(P,"Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the "),Fo=r(P,"CODE",{});var Cl=i(Fo);cr=n(Cl,"text"),Cl.forEach(o),pr=n(P,`
and `),Vo=r(P,"CODE",{});var El=i(Vo);mr=n(El,"kwargs"),El.forEach(o),hr=n(P," arguments to BertTokenizerFast\u2019s "),ft=r(P,"A",{href:!0});var Pi=i(ft);Oo=r(Pi,"STRONG",{});var Ml=i(Oo);fr=n(Ml,"call"),Ml.forEach(o),ur=n(Pi,"()"),Pi.forEach(o),gr=n(P," if "),No=r(P,"CODE",{});var Il=i(No);_r=n(Il,"text"),Il.forEach(o),vr=n(P," is not "),Do=r(P,"CODE",{});var ql=i(Do);br=n(ql,"None"),ql.forEach(o),wr=n(P,` to encode
the text. To prepare the image(s), this method forwards the `),So=r(P,"CODE",{});var zl=i(So);yr=n(zl,"images"),zl.forEach(o),$r=n(P," and "),Wo=r(P,"CODE",{});var Al=i(Wo);Tr=n(Al,"kwrags"),Al.forEach(o),kr=n(P,` arguments to
CLIPImageProcessor\u2019s `),ut=r(P,"A",{href:!0});var Ci=i(ut);Ro=r(Ci,"STRONG",{});var Ll=i(Ro);xr=n(Ll,"call"),Ll.forEach(o),jr=n(Ci,"()"),Ci.forEach(o),Gr=n(P," if "),Bo=r(P,"CODE",{});var Fl=i(Bo);Pr=n(Fl,"images"),Fl.forEach(o),Cr=n(P," is not "),Ho=r(P,"CODE",{});var Vl=i(Ho);Er=n(Vl,"None"),Vl.forEach(o),Mr=n(P,`. Please refer to the doctsring
of the above two methods for more information.`),P.forEach(o),Zs.forEach(o),Ne.forEach(o),Es=m(t),le=r(t,"H2",{class:!0});var Js=i(le);Ee=r(Js,"A",{id:!0,class:!0,href:!0});var Ol=i(Ee);Uo=r(Ol,"SPAN",{});var Nl=i(Uo);y(gt.$$.fragment,Nl),Nl.forEach(o),Ol.forEach(o),Ir=m(Js),Zo=r(Js,"SPAN",{});var Dl=i(Zo);qr=n(Dl,"GitModel"),Dl.forEach(o),Js.forEach(o),Ms=m(t),I=r(t,"DIV",{class:!0});var U=i(I);y(_t.$$.fragment,U),zr=m(U),Jo=r(U,"P",{});var Sl=i(Jo);Ar=n(Sl,"The bare GIT Model transformer consisting of a CLIP image encoder and text decoder outputting raw hidden-states without any specific head on top."),Sl.forEach(o),Lr=m(U),vt=r(U,"P",{});var Qs=i(vt);Fr=n(Qs,"This model inherits from "),to=r(Qs,"A",{href:!0});var Wl=i(to);Vr=n(Wl,"PreTrainedModel"),Wl.forEach(o),Or=n(Qs,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Qs.forEach(o),Nr=m(U),bt=r(U,"P",{});var Xs=i(bt);Dr=n(Xs,"This model is also a PyTorch "),wt=r(Xs,"A",{href:!0,rel:!0});var Rl=i(wt);Sr=n(Rl,"torch.nn.Module"),Rl.forEach(o),Wr=n(Xs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xs.forEach(o),Rr=m(U),N=r(U,"DIV",{class:!0});var De=i(N);y(yt.$$.fragment,De),Br=m(De),de=r(De,"P",{});var fo=i(de);Hr=n(fo,"The "),oo=r(fo,"A",{href:!0});var Bl=i(oo);Ur=n(Bl,"GitModel"),Bl.forEach(o),Zr=n(fo," forward method, overrides the "),Qo=r(fo,"CODE",{});var Hl=i(Qo);Jr=n(Hl,"__call__"),Hl.forEach(o),Qr=n(fo," special method."),fo.forEach(o),Xr=m(De),y(Me.$$.fragment,De),Kr=m(De),y(Ie.$$.fragment,De),De.forEach(o),U.forEach(o),Is=m(t),ce=r(t,"H2",{class:!0});var Ks=i(ce);qe=r(Ks,"A",{id:!0,class:!0,href:!0});var Ul=i(qe);Xo=r(Ul,"SPAN",{});var Zl=i(Xo);y($t.$$.fragment,Zl),Zl.forEach(o),Ul.forEach(o),Yr=m(Ks),Ko=r(Ks,"SPAN",{});var Jl=i(Ko);ei=n(Jl,"GitForCausalLM"),Jl.forEach(o),Ks.forEach(o),qs=m(t),q=r(t,"DIV",{class:!0});var Z=i(q);y(Tt.$$.fragment,Z),ti=m(Z),kt=r(Z,"P",{});var Ys=i(kt);oi=n(Ys,"GIT Model with a "),Yo=r(Ys,"CODE",{});var Ql=i(Yo);si=n(Ql,"language modeling"),Ql.forEach(o),ni=n(Ys," head on top for autoregressive language modeling."),Ys.forEach(o),ai=m(Z),xt=r(Z,"P",{});var en=i(xt);ri=n(en,"This model inherits from "),so=r(en,"A",{href:!0});var Xl=i(so);ii=n(Xl,"PreTrainedModel"),Xl.forEach(o),li=n(en,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),en.forEach(o),di=m(Z),jt=r(Z,"P",{});var tn=i(jt);ci=n(tn,"This model is also a PyTorch "),Gt=r(tn,"A",{href:!0,rel:!0});var Kl=i(Gt);pi=n(Kl,"torch.nn.Module"),Kl.forEach(o),mi=n(tn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),tn.forEach(o),hi=m(Z),C=r(Z,"DIV",{class:!0});var L=i(C);y(Pt.$$.fragment,L),fi=m(L),pe=r(L,"P",{});var uo=i(pe);ui=n(uo,"The "),no=r(uo,"A",{href:!0});var Yl=i(no);gi=n(Yl,"GitForCausalLM"),Yl.forEach(o),_i=n(uo," forward method, overrides the "),es=r(uo,"CODE",{});var ed=i(es);vi=n(ed,"__call__"),ed.forEach(o),bi=n(uo," special method."),uo.forEach(o),wi=m(L),y(ze.$$.fragment,L),yi=m(L),ts=r(L,"P",{});var td=i(ts);$i=n(td,"Examples:"),td.forEach(o),Ti=m(L),y(Ae.$$.fragment,L),ki=m(L),y(Le.$$.fragment,L),xi=m(L),y(Fe.$$.fragment,L),L.forEach(o),Z.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(bd)),d(h,"id","git"),d(h,"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"),d(h,"href","#git"),d(_,"class","relative group"),d(fe,"id","overview"),d(fe,"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"),d(fe,"href","#overview"),d(J,"class","relative group"),d(We,"href","https://arxiv.org/abs/2205.14100"),d(We,"rel","nofollow"),d(zt,"href","clip"),d(Vt,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitProcessor"),rd(ge.src,Mi="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/git_architecture.jpg")||d(ge,"src",Mi),d(ge,"alt","drawing"),d(ge,"width","600"),d(Be,"href","https://arxiv.org/abs/2205.14100"),d(Be,"target","_blank"),d(He,"href","https://huggingface.co/nielsr"),d(He,"rel","nofollow"),d(Ue,"href","https://github.com/microsoft/GenerativeImage2Text"),d(Ue,"rel","nofollow"),d(ve,"id","resources"),d(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ve,"href","#resources"),d(X,"class","relative group"),d(Qe,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/GIT"),d(Qe,"rel","nofollow"),d(Dt,"href","./tasks/language_modeling"),d(we,"id","transformers.GitVisionConfig"),d(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"),d(we,"href","#transformers.GitVisionConfig"),d(K,"class","relative group"),d(Wt,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitVisionModel"),d(Ye,"href","https://huggingface.co/microsoft/git-base"),d(Ye,"rel","nofollow"),d(Rt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(Bt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($e,"id","transformers.GitVisionModel"),d($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"),d($e,"href","#transformers.GitVisionModel"),d(te,"class","relative group"),d(Ht,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(nt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(nt,"rel","nofollow"),d(Ut,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitVisionModel"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(xe,"id","transformers.GitConfig"),d(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"),d(xe,"href","#transformers.GitConfig"),d(se,"class","relative group"),d(Zt,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitModel"),d(lt,"href","https://huggingface.co/microsoft/git-base"),d(lt,"rel","nofollow"),d(Jt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(Qt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),d(Xt,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),d(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Pe,"id","transformers.GitProcessor"),d(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Pe,"href","#transformers.GitProcessor"),d(ie,"class","relative group"),d(Kt,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitProcessor"),d(Yt,"href","/docs/transformers/v4.27.1/en/model_doc/clip#transformers.CLIPImageProcessor"),d(eo,"href","/docs/transformers/v4.27.1/en/model_doc/bert#transformers.BertTokenizerFast"),d(mt,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitProcessor.__call__"),d(ft,"href","/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),d(ut,"href","/docs/transformers/v4.27.1/en/model_doc/videomae#transformers.VideoMAEFeatureExtractor.__call__"),d(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ee,"id","transformers.GitModel"),d(Ee,"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"),d(Ee,"href","#transformers.GitModel"),d(le,"class","relative group"),d(to,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(wt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(wt,"rel","nofollow"),d(oo,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitModel"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(qe,"id","transformers.GitForCausalLM"),d(qe,"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"),d(qe,"href","#transformers.GitForCausalLM"),d(ce,"class","relative group"),d(so,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),d(Gt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Gt,"rel","nofollow"),d(no,"href","/docs/transformers/v4.27.1/en/model_doc/git#transformers.GitForCausalLM"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,f){e(document.head,c),g(t,b,f),g(t,_,f),e(_,h),e(h,v),$(l,v,null),e(_,u),e(_,z),e(z,on),g(t,ds,f),g(t,J,f),e(J,fe),e(fe,go),$(Se,go,null),e(J,sn),e(J,_o),e(_o,nn),g(t,cs,f),g(t,W,f),e(W,an),e(W,We),e(We,rn),e(W,ln),e(W,zt),e(zt,dn),e(W,cn),g(t,ps,f),g(t,At,f),e(At,pn),g(t,ms,f),g(t,Lt,f),e(Lt,vo),e(vo,mn),g(t,hs,f),g(t,Ft,f),e(Ft,hn),g(t,fs,f),g(t,ue,f),e(ue,Re),e(Re,fn),e(Re,bo),e(bo,un),e(Re,gn),e(ue,_n),e(ue,Q),e(Q,vn),e(Q,Vt),e(Vt,bn),e(Q,wn),e(Q,wo),e(wo,yn),e(Q,$n),g(t,us,f),g(t,ge,f),g(t,gs,f),g(t,_e,f),e(_e,Tn),e(_e,Be),e(Be,kn),e(_e,xn),g(t,_s,f),g(t,R,f),e(R,jn),e(R,He),e(He,Gn),e(R,Pn),e(R,Ue),e(Ue,Cn),e(R,En),g(t,vs,f),g(t,X,f),e(X,ve),e(ve,yo),$(Ze,yo,null),e(X,Mn),e(X,$o),e($o,In),g(t,bs,f),g(t,Ot,f),e(Ot,qn),g(t,ws,f),g(t,be,f),e(be,Je),e(Je,zn),e(Je,Qe),e(Qe,An),e(Je,Ln),e(be,Fn),e(be,Nt),e(Nt,Vn),e(Nt,Dt),e(Dt,On),g(t,ys,f),g(t,St,f),e(St,Nn),g(t,$s,f),g(t,K,f),e(K,we),e(we,To),$(Xe,To,null),e(K,Dn),e(K,ko),e(ko,Sn),g(t,Ts,f),g(t,F,f),$(Ke,F,null),e(F,Wn),e(F,Y),e(Y,Rn),e(Y,Wt),e(Wt,Bn),e(Y,Hn),e(Y,Ye),e(Ye,Un),e(Y,Zn),e(F,Jn),e(F,ee),e(ee,Qn),e(ee,Rt),e(Rt,Xn),e(ee,Kn),e(ee,Bt),e(Bt,Yn),e(ee,ea),e(F,ta),$(ye,F,null),g(t,ks,f),g(t,te,f),e(te,$e),e($e,xo),$(et,xo,null),e(te,oa),e(te,jo),e(jo,sa),g(t,xs,f),g(t,E,f),$(tt,E,null),e(E,na),e(E,Go),e(Go,aa),e(E,ra),e(E,ot),e(ot,ia),e(ot,Ht),e(Ht,la),e(ot,da),e(E,ca),e(E,st),e(st,pa),e(st,nt),e(nt,ma),e(st,ha),e(E,fa),e(E,O),$(at,O,null),e(O,ua),e(O,oe),e(oe,ga),e(oe,Ut),e(Ut,_a),e(oe,va),e(oe,Po),e(Po,ba),e(oe,wa),e(O,ya),$(Te,O,null),e(O,$a),$(ke,O,null),g(t,js,f),g(t,se,f),e(se,xe),e(xe,Co),$(rt,Co,null),e(se,Ta),e(se,Eo),e(Eo,ka),g(t,Gs,f),g(t,M,f),$(it,M,null),e(M,xa),e(M,ne),e(ne,ja),e(ne,Zt),e(Zt,Ga),e(ne,Pa),e(ne,lt),e(lt,Ca),e(ne,Ea),e(M,Ma),e(M,ae),e(ae,Ia),e(ae,Jt),e(Jt,qa),e(ae,za),e(ae,Qt),e(Qt,Aa),e(ae,La),e(M,Fa),$(je,M,null),e(M,Va),e(M,Ge),$(dt,Ge,null),e(Ge,Oa),e(Ge,re),e(re,Na),e(re,Xt),e(Xt,Da),e(re,Sa),e(re,Mo),e(Mo,Wa),e(re,Ra),g(t,Ps,f),g(t,ie,f),e(ie,Pe),e(Pe,Io),$(ct,Io,null),e(ie,Ba),e(ie,qo),e(qo,Ha),g(t,Cs,f),g(t,V,f),$(pt,V,null),e(V,Ua),e(V,zo),e(zo,Za),e(V,Ja),e(V,A),e(A,Kt),e(Kt,Qa),e(A,Xa),e(A,Yt),e(Yt,Ka),e(A,Ya),e(A,eo),e(eo,er),e(A,tr),e(A,mt),e(mt,Ao),e(Ao,or),e(mt,sr),e(A,nr),e(A,Lo),e(Lo,ar),e(A,rr),e(V,ir),e(V,Ce),$(ht,Ce,null),e(Ce,lr),e(Ce,j),e(j,dr),e(j,Fo),e(Fo,cr),e(j,pr),e(j,Vo),e(Vo,mr),e(j,hr),e(j,ft),e(ft,Oo),e(Oo,fr),e(ft,ur),e(j,gr),e(j,No),e(No,_r),e(j,vr),e(j,Do),e(Do,br),e(j,wr),e(j,So),e(So,yr),e(j,$r),e(j,Wo),e(Wo,Tr),e(j,kr),e(j,ut),e(ut,Ro),e(Ro,xr),e(ut,jr),e(j,Gr),e(j,Bo),e(Bo,Pr),e(j,Cr),e(j,Ho),e(Ho,Er),e(j,Mr),g(t,Es,f),g(t,le,f),e(le,Ee),e(Ee,Uo),$(gt,Uo,null),e(le,Ir),e(le,Zo),e(Zo,qr),g(t,Ms,f),g(t,I,f),$(_t,I,null),e(I,zr),e(I,Jo),e(Jo,Ar),e(I,Lr),e(I,vt),e(vt,Fr),e(vt,to),e(to,Vr),e(vt,Or),e(I,Nr),e(I,bt),e(bt,Dr),e(bt,wt),e(wt,Sr),e(bt,Wr),e(I,Rr),e(I,N),$(yt,N,null),e(N,Br),e(N,de),e(de,Hr),e(de,oo),e(oo,Ur),e(de,Zr),e(de,Qo),e(Qo,Jr),e(de,Qr),e(N,Xr),$(Me,N,null),e(N,Kr),$(Ie,N,null),g(t,Is,f),g(t,ce,f),e(ce,qe),e(qe,Xo),$($t,Xo,null),e(ce,Yr),e(ce,Ko),e(Ko,ei),g(t,qs,f),g(t,q,f),$(Tt,q,null),e(q,ti),e(q,kt),e(kt,oi),e(kt,Yo),e(Yo,si),e(kt,ni),e(q,ai),e(q,xt),e(xt,ri),e(xt,so),e(so,ii),e(xt,li),e(q,di),e(q,jt),e(jt,ci),e(jt,Gt),e(Gt,pi),e(jt,mi),e(q,hi),e(q,C),$(Pt,C,null),e(C,fi),e(C,pe),e(pe,ui),e(pe,no),e(no,gi),e(pe,_i),e(pe,es),e(es,vi),e(pe,bi),e(C,wi),$(ze,C,null),e(C,yi),e(C,ts),e(ts,$i),e(C,Ti),$(Ae,C,null),e(C,ki),$(Le,C,null),e(C,xi),$(Fe,C,null),zs=!0},p(t,[f]){const Ct={};f&2&&(Ct.$$scope={dirty:f,ctx:t}),ye.$set(Ct);const os={};f&2&&(os.$$scope={dirty:f,ctx:t}),Te.$set(os);const ss={};f&2&&(ss.$$scope={dirty:f,ctx:t}),ke.$set(ss);const ns={};f&2&&(ns.$$scope={dirty:f,ctx:t}),je.$set(ns);const Et={};f&2&&(Et.$$scope={dirty:f,ctx:t}),Me.$set(Et);const as={};f&2&&(as.$$scope={dirty:f,ctx:t}),Ie.$set(as);const rs={};f&2&&(rs.$$scope={dirty:f,ctx:t}),ze.$set(rs);const is={};f&2&&(is.$$scope={dirty:f,ctx:t}),Ae.$set(is);const me={};f&2&&(me.$$scope={dirty:f,ctx:t}),Le.$set(me);const ls={};f&2&&(ls.$$scope={dirty:f,ctx:t}),Fe.$set(ls)},i(t){zs||(T(l.$$.fragment,t),T(Se.$$.fragment,t),T(Ze.$$.fragment,t),T(Xe.$$.fragment,t),T(Ke.$$.fragment,t),T(ye.$$.fragment,t),T(et.$$.fragment,t),T(tt.$$.fragment,t),T(at.$$.fragment,t),T(Te.$$.fragment,t),T(ke.$$.fragment,t),T(rt.$$.fragment,t),T(it.$$.fragment,t),T(je.$$.fragment,t),T(dt.$$.fragment,t),T(ct.$$.fragment,t),T(pt.$$.fragment,t),T(ht.$$.fragment,t),T(gt.$$.fragment,t),T(_t.$$.fragment,t),T(yt.$$.fragment,t),T(Me.$$.fragment,t),T(Ie.$$.fragment,t),T($t.$$.fragment,t),T(Tt.$$.fragment,t),T(Pt.$$.fragment,t),T(ze.$$.fragment,t),T(Ae.$$.fragment,t),T(Le.$$.fragment,t),T(Fe.$$.fragment,t),zs=!0)},o(t){k(l.$$.fragment,t),k(Se.$$.fragment,t),k(Ze.$$.fragment,t),k(Xe.$$.fragment,t),k(Ke.$$.fragment,t),k(ye.$$.fragment,t),k(et.$$.fragment,t),k(tt.$$.fragment,t),k(at.$$.fragment,t),k(Te.$$.fragment,t),k(ke.$$.fragment,t),k(rt.$$.fragment,t),k(it.$$.fragment,t),k(je.$$.fragment,t),k(dt.$$.fragment,t),k(ct.$$.fragment,t),k(pt.$$.fragment,t),k(ht.$$.fragment,t),k(gt.$$.fragment,t),k(_t.$$.fragment,t),k(yt.$$.fragment,t),k(Me.$$.fragment,t),k(Ie.$$.fragment,t),k($t.$$.fragment,t),k(Tt.$$.fragment,t),k(Pt.$$.fragment,t),k(ze.$$.fragment,t),k(Ae.$$.fragment,t),k(Le.$$.fragment,t),k(Fe.$$.fragment,t),zs=!1},d(t){o(c),t&&o(b),t&&o(_),x(l),t&&o(ds),t&&o(J),x(Se),t&&o(cs),t&&o(W),t&&o(ps),t&&o(At),t&&o(ms),t&&o(Lt),t&&o(hs),t&&o(Ft),t&&o(fs),t&&o(ue),t&&o(us),t&&o(ge),t&&o(gs),t&&o(_e),t&&o(_s),t&&o(R),t&&o(vs),t&&o(X),x(Ze),t&&o(bs),t&&o(Ot),t&&o(ws),t&&o(be),t&&o(ys),t&&o(St),t&&o($s),t&&o(K),x(Xe),t&&o(Ts),t&&o(F),x(Ke),x(ye),t&&o(ks),t&&o(te),x(et),t&&o(xs),t&&o(E),x(tt),x(at),x(Te),x(ke),t&&o(js),t&&o(se),x(rt),t&&o(Gs),t&&o(M),x(it),x(je),x(dt),t&&o(Ps),t&&o(ie),x(ct),t&&o(Cs),t&&o(V),x(pt),x(ht),t&&o(Es),t&&o(le),x(gt),t&&o(Ms),t&&o(I),x(_t),x(yt),x(Me),x(Ie),t&&o(Is),t&&o(ce),x($t),t&&o(qs),t&&o(q),x(Tt),x(Pt),x(ze),x(Ae),x(Le),x(Fe)}}}const bd={local:"git",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.GitVisionConfig",title:"GitVisionConfig"},{local:"transformers.GitVisionModel",title:"GitVisionModel"},{local:"transformers.GitConfig",title:"GitConfig"},{local:"transformers.GitProcessor",title:"GitProcessor"},{local:"transformers.GitModel",title:"GitModel"},{local:"transformers.GitForCausalLM",title:"GitForCausalLM"}],title:"GIT"};function wd(G){return id(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gd extends od{constructor(c){super();sd(this,c,wd,vd,nd,{})}}export{Gd as default,bd as metadata};
