import{s as ya,n as Ma,o as ja}from"../chunks/scheduler.9bc65507.js";import{S as ba,i as wa,g as i,s as l,r as o,A as Ja,h as p,f as t,c as n,j as fa,u as m,x as r,k as Es,y as Ta,a,v as c,d as h,t as d,w as g}from"../chunks/index.707bf1b6.js";import{C as u}from"../chunks/CodeBlock.54a9f38d.js";import{D as xa}from"../chunks/DocNotebookDropdown.41f65cb5.js";import{H as zs}from"../chunks/Heading.342b1fa6.js";function Ua(Jt){let f,qs,Ys,Ls,b,Ss,w,Ps,J,Tt=`Visual Question Answering (VQA) is the task of answering open-ended questions based on an image.
The input to models supporting this task is typically a combination of an image and a question, and the output is an
answer expressed in natural language.`,Ds,T,xt="Some noteworthy use case examples for VQA include:",Ks,x,Ut="<li>Accessibility applications for visually impaired individuals.</li> <li>Education: posing questions about visual materials presented in lectures or textbooks. VQA can also be utilized in interactive museum exhibits or historical sites.</li> <li>Customer service and e-commerce: VQA can enhance user experience by letting users ask questions about products.</li> <li>Image retrieval: VQA models can be used to retrieve images with specific characteristics. For example, the user can ask “Is there a dog?” to find all images with dogs from a set of images.</li>",Os,U,vt="In this guide you’ll learn how to:",se,v,Ct='<li>Fine-tune a classification VQA model, specifically <a href="../model_doc/vilt">ViLT</a>, on the <a href="https://huggingface.co/datasets/Graphcore/vqa" rel="nofollow"><code>Graphcore/vqa</code> dataset</a>.</li> <li>Use your fine-tuned ViLT for inference.</li> <li>Run zero-shot VQA inference with a generative model, like BLIP-2.</li>',ee,C,te,$,$t=`ViLT model incorporates text embeddings into a Vision Transformer (ViT), allowing it to have a minimal design for
Vision-and-Language Pre-training (VLP). This model can be used for several downstream tasks. For the VQA task, a classifier
head is placed on top (a linear layer on top of the final hidden state of the <code>[CLS]</code> token) and randomly initialized.
Visual Question Answering is thus treated as a <strong>classification problem</strong>.`,ae,Z,Zt=`More recent models, such as BLIP, BLIP-2, and InstructBLIP, treat VQA as a generative task. Later in this guide we
illustrate how to use them for zero-shot VQA inference.`,le,_,_t="Before you begin, make sure you have all the necessary libraries installed.",ne,k,ie,V,kt=`We encourage you to share your model with the community. Log in to your Hugging Face account to upload it to the 🤗 Hub.
When prompted, enter your token to log in:`,pe,G,re,W,Vt="Let’s define the model checkpoint as a global variable.",oe,I,me,B,ce,X,Gt=`For illustration purposes, in this guide we use a very small sample of the annotated visual question answering <code>Graphcore/vqa</code> dataset.
You can find the full dataset on <a href="https://huggingface.co/datasets/Graphcore/vqa" rel="nofollow">🤗 Hub</a>.`,he,Q,Wt=`As an alternative to the <a href="https://huggingface.co/datasets/Graphcore/vqa" rel="nofollow"><code>Graphcore/vqa</code> dataset</a>, you can download the
same data manually from the official <a href="https://visualqa.org/download.html" rel="nofollow">VQA dataset page</a>. If you prefer to follow the
tutorial with your custom data, check out how to <a href="https://huggingface.co/docs/datasets/image_dataset#loading-script" rel="nofollow">Create an image dataset</a>
guide in the 🤗 Datasets documentation.`,de,R,It="Let’s load the first 200 examples from the validation split and explore the dataset’s features:",ge,H,ue,F,Bt="Let’s take a look at an example to understand the dataset’s features:",fe,N,ye,z,Xt="The features relevant to the task include:",Me,Y,Qt="<li><code>question</code>: the question to be answered from the image</li> <li><code>image_id</code>: the path to the image the question refers to</li> <li><code>label</code>: the annotations</li>",je,A,Rt="We can remove the rest of the features as they won’t be necessary:",be,E,we,q,Ht=`As you can see, the <code>label</code> feature contains several answers to the same question (called <code>ids</code> here) collected by different human annotators.
This is because the answer to a question can be subjective. In this case, the question is “where is he looking?“. Some people
annotated this with “down”, others with “at table”, another one with “skateboard”, etc.`,Je,L,Ft="Take a look at the image and consider which answer would you give:",Te,S,xe,y,Nt='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/vqa-example.png" alt="VQA Image Example"/>',Ue,P,zt=`Due to the questions’ and answers’ ambiguity, datasets like this are treated as a multi-label classification problem (as
multiple answers are possibly valid). Moreover, rather than just creating a one-hot encoded vector, one creates a
soft encoding, based on the number of times a certain answer appeared in the annotations.`,ve,D,Yt=`For instance, in the example above, because the answer “down” is selected way more often than other answers, it has a
score (called <code>weight</code> in the dataset) of 1.0, and the rest of the answers have scores &lt; 1.0.`,Ce,K,At=`To later instantiate the model with an appropriate classification head, let’s create two dictionaries: one that maps
the label name to an integer and vice versa:`,$e,O,Ze,ss,Et="Now that we have the mappings, we can replace the string answers with their ids, and flatten the dataset for a more convenient further preprocessing.",_e,es,ke,ts,Ve,as,qt=`The next step is to load a ViLT processor to prepare the image and text data for the model.
<a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltProcessor">ViltProcessor</a> wraps a BERT tokenizer and ViLT image processor into a convenient single processor:`,Ge,ls,We,ns,Lt=`To preprocess the data we need to encode the images and questions using the <a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltProcessor">ViltProcessor</a>. The processor will use
the <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a> to tokenize the text and create <code>input_ids</code>, <code>attention_mask</code> and <code>token_type_ids</code> for the text data.
As for images, the processor will leverage <a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltImageProcessor">ViltImageProcessor</a> to resize and normalize the image, and create <code>pixel_values</code> and <code>pixel_mask</code>.`,Ie,is,St=`All these preprocessing steps are done under the hood, we only need to call the <code>processor</code>. However, we still need to
prepare the target labels. In this representation, each element corresponds to a possible answer (label). For correct answers, the element holds
their respective score (weight), while the remaining elements are set to zero.`,Be,ps,Pt="The following function applies the <code>processor</code> to the images and questions and formats the labels as described above:",Xe,rs,Qe,os,Dt=`To apply the preprocessing function over the entire dataset, use 🤗 Datasets <code>map</code> function. You can speed up <code>map</code> by
setting <code>batched=True</code> to process multiple elements of the dataset at once. At this point, feel free to remove the columns you don’t need.`,Re,ms,He,cs,Kt='As a final step, create a batch of examples using <a href="/docs/transformers/main/en/main_classes/data_collator#transformers.DefaultDataCollator">DefaultDataCollator</a>:',Fe,hs,Ne,ds,ze,gs,Ot=`You’re ready to start training your model now! Load ViLT with <a href="/docs/transformers/main/en/model_doc/vilt#transformers.ViltForQuestionAnswering">ViltForQuestionAnswering</a>. Specify the number of labels
along with the label mappings:`,Ye,us,Ae,fs,sa="At this point, only three steps remain:",Ee,ys,ea='<li>Define your training hyperparameters in <a href="/docs/transformers/main/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>:</li>',qe,Ms,Le,M,ta='<li>Pass the training arguments to <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer">Trainer</a> along with the model, dataset, processor, and data collator.</li>',Se,js,Pe,j,aa='<li>Call <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer.train">train()</a> to finetune your model.</li>',De,bs,Ke,ws,la='Once training is completed, share your model to the Hub with the <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> method to share your final model on the 🤗 Hub:',Oe,Js,st,Ts,et,xs,na=`Now that you have fine-tuned a ViLT model, and uploaded it to the 🤗 Hub, you can use it for inference. The simplest
way to try out your fine-tuned model for inference is to use it in a <a href="/docs/transformers/main/en/main_classes/pipelines#transformers.Pipeline">Pipeline</a>.`,tt,Us,at,vs,ia=`The model in this guide has only been trained on 200 examples, so don’t expect a lot from it. Let’s see if it at least
learned something from the data and take the first example from the dataset to illustrate inference:`,lt,Cs,nt,$s,pa="Even though not very confident, the model indeed has learned something. With more examples and longer training, you’ll get far better results!",it,Zs,ra="You can also manually replicate the results of the pipeline if you’d like:",pt,_s,oa="<li>Take an image and a question, prepare them for the model using the processor from your model.</li> <li>Forward the result or preprocessing through the model.</li> <li>From the logits, get the most likely answer’s id, and find the actual answer in the <code>id2label</code>.</li>",rt,ks,ot,Vs,mt,Gs,ma=`The previous model treated VQA as a classification task. Some recent models, such as BLIP, BLIP-2, and InstructBLIP approach
VQA as a generative task. Let’s take <a href="../model_doc/blip-2">BLIP-2</a> as an example. It introduced a new visual-language pre-training
paradigm in which any combination of pre-trained vision encoder and LLM can be used (learn more in the <a href="https://huggingface.co/blog/blip-2" rel="nofollow">BLIP-2 blog post</a>).
This enables achieving state-of-the-art results on multiple visual-language tasks including visual question answering.`,ct,Ws,ca=`Let’s illustrate how you can use this model for VQA. First, let’s load the model. Here we’ll explicitly send the model to a
GPU, if available, which we didn’t need to do earlier when training, as <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer">Trainer</a> handles this automatically:`,ht,Is,dt,Bs,ha="The model takes image and text as input, so let’s use the exact same image/question pair from the first example in the VQA dataset:",gt,Xs,ut,Qs,da="To use BLIP-2 for visual question answering task, the textual prompt has to follow a specific format: <code>Question: {} Answer:</code>.",ft,Rs,yt,Hs,ga="Now we need to preprocess the image/prompt with the model’s processor, pass the processed input through the model, and decode the output:",Mt,Fs,jt,Ns,ua=`As you can see, the model recognized the crowd, and the direction of the face (looking down), however, it seems to miss
the fact the crowd is behind the skater. Still, in cases where acquiring human-annotated datasets is not feasible, this
approach can quickly produce useful results.`,bt,As,wt;return b=new zs({props:{title:"Visual Question Answering",local:"visual-question-answering",headingTag:"h1"}}),w=new xa({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/visual_question_answering.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/visual_question_answering.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/visual_question_answering.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/visual_question_answering.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/visual_question_answering.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/visual_question_answering.ipynb"}]}}),C=new zs({props:{title:"Fine-tuning ViLT",local:"fine-tuning-vilt",headingTag:"h2"}}),k=new u({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1xJTIwdHJhbnNmb3JtZXJzJTIwZGF0YXNldHM=",highlighted:"pip install -q transformers datasets",wrap:!1}}),G=new u({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_login()`,wrap:!1}}),I=new u({props:{code:"bW9kZWxfY2hlY2twb2ludCUyMCUzRCUyMCUyMmRhbmRlbGluJTJGdmlsdC1iMzItbWxtJTIy",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model_checkpoint = <span class="hljs-string">&quot;dandelin/vilt-b32-mlm&quot;</span>',wrap:!1}}),B=new zs({props:{title:"Load the data",local:"load-the-data",headingTag:"h2"}}),H=new u({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJHcmFwaGNvcmUlMkZ2cWElMjIlMkMlMjBzcGxpdCUzRCUyMnZhbGlkYXRpb24lNUIlM0EyMDAlNUQlMjIpJTBBZGF0YXNldA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;Graphcore/vqa&quot;</span>, split=<span class="hljs-string">&quot;validation[:200]&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset
Dataset({
    features: [<span class="hljs-string">&#x27;question&#x27;</span>, <span class="hljs-string">&#x27;question_type&#x27;</span>, <span class="hljs-string">&#x27;question_id&#x27;</span>, <span class="hljs-string">&#x27;image_id&#x27;</span>, <span class="hljs-string">&#x27;answer_type&#x27;</span>, <span class="hljs-string">&#x27;label&#x27;</span>],
    num_rows: <span class="hljs-number">200</span>
})`,wrap:!1}}),N=new u({props:{code:"ZGF0YXNldCU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>dataset[<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;question&#x27;</span>: <span class="hljs-string">&#x27;Where is he looking?&#x27;</span>,
 <span class="hljs-string">&#x27;question_type&#x27;</span>: <span class="hljs-string">&#x27;none of the above&#x27;</span>,
 <span class="hljs-string">&#x27;question_id&#x27;</span>: <span class="hljs-number">262148000</span>,
 <span class="hljs-string">&#x27;image_id&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/ca733e0e000fb2d7a09fbcc94dbfe7b5a30750681d0e965f8e0a23b1c2f98c75/val2014/COCO_val2014_000000262148.jpg&#x27;</span>,
 <span class="hljs-string">&#x27;answer_type&#x27;</span>: <span class="hljs-string">&#x27;other&#x27;</span>,
 <span class="hljs-string">&#x27;label&#x27;</span>: {<span class="hljs-string">&#x27;ids&#x27;</span>: [<span class="hljs-string">&#x27;at table&#x27;</span>, <span class="hljs-string">&#x27;down&#x27;</span>, <span class="hljs-string">&#x27;skateboard&#x27;</span>, <span class="hljs-string">&#x27;table&#x27;</span>],
  <span class="hljs-string">&#x27;weights&#x27;</span>: [<span class="hljs-number">0.30000001192092896</span>,
   <span class="hljs-number">1.0</span>,
   <span class="hljs-number">0.30000001192092896</span>,
   <span class="hljs-number">0.30000001192092896</span>]}}`,wrap:!1}}),E=new u({props:{code:"ZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQucmVtb3ZlX2NvbHVtbnMoJTVCJ3F1ZXN0aW9uX3R5cGUnJTJDJTIwJ3F1ZXN0aW9uX2lkJyUyQyUyMCdhbnN3ZXJfdHlwZSclNUQp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.remove_columns([<span class="hljs-string">&#x27;question_type&#x27;</span>, <span class="hljs-string">&#x27;question_id&#x27;</span>, <span class="hljs-string">&#x27;answer_type&#x27;</span>])',wrap:!1}}),S=new u({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKGRhdGFzZXQlNUIwJTVEJTVCJ2ltYWdlX2lkJyU1RCklMEFpbWFnZQ==",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>image = Image.<span class="hljs-built_in">open</span>(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&#x27;image_id&#x27;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>image`,wrap:!1}}),O=new u({props:{code:"aW1wb3J0JTIwaXRlcnRvb2xzJTBBJTBBbGFiZWxzJTIwJTNEJTIwJTVCaXRlbSU1QidpZHMnJTVEJTIwZm9yJTIwaXRlbSUyMGluJTIwZGF0YXNldCU1QidsYWJlbCclNUQlNUQlMEFmbGF0dGVuZWRfbGFiZWxzJTIwJTNEJTIwbGlzdChpdGVydG9vbHMuY2hhaW4oKmxhYmVscykpJTBBdW5pcXVlX2xhYmVscyUyMCUzRCUyMGxpc3Qoc2V0KGZsYXR0ZW5lZF9sYWJlbHMpKSUwQSUwQWxhYmVsMmlkJTIwJTNEJTIwJTdCbGFiZWwlM0ElMjBpZHglMjBmb3IlMjBpZHglMkMlMjBsYWJlbCUyMGluJTIwZW51bWVyYXRlKHVuaXF1ZV9sYWJlbHMpJTdEJTBBaWQybGFiZWwlMjAlM0QlMjAlN0JpZHglM0ElMjBsYWJlbCUyMGZvciUyMGxhYmVsJTJDJTIwaWR4JTIwaW4lMjBsYWJlbDJpZC5pdGVtcygpJTdEJTIw",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> itertools

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = [item[<span class="hljs-string">&#x27;ids&#x27;</span>] <span class="hljs-keyword">for</span> item <span class="hljs-keyword">in</span> dataset[<span class="hljs-string">&#x27;label&#x27;</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>flattened_labels = <span class="hljs-built_in">list</span>(itertools.chain(*labels))
<span class="hljs-meta">&gt;&gt;&gt; </span>unique_labels = <span class="hljs-built_in">list</span>(<span class="hljs-built_in">set</span>(flattened_labels))

<span class="hljs-meta">&gt;&gt;&gt; </span>label2id = {label: idx <span class="hljs-keyword">for</span> idx, label <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(unique_labels)}
<span class="hljs-meta">&gt;&gt;&gt; </span>id2label = {idx: label <span class="hljs-keyword">for</span> label, idx <span class="hljs-keyword">in</span> label2id.items()} `,wrap:!1}}),es=new u({props:{code:"ZGVmJTIwcmVwbGFjZV9pZHMoaW5wdXRzKSUzQSUwQSUyMCUyMGlucHV0cyU1QiUyMmxhYmVsJTIyJTVEJTVCJTIyaWRzJTIyJTVEJTIwJTNEJTIwJTVCbGFiZWwyaWQlNUJ4JTVEJTIwZm9yJTIweCUyMGluJTIwaW5wdXRzJTVCJTIybGFiZWwlMjIlNUQlNUIlMjJpZHMlMjIlNUQlNUQlMEElMjAlMjByZXR1cm4lMjBpbnB1dHMlMEElMEElMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5tYXAocmVwbGFjZV9pZHMpJTBBZmxhdF9kYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5mbGF0dGVuKCklMEFmbGF0X2RhdGFzZXQuZmVhdHVyZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">replace_ids</span>(<span class="hljs-params">inputs</span>):
<span class="hljs-meta">... </span>  inputs[<span class="hljs-string">&quot;label&quot;</span>][<span class="hljs-string">&quot;ids&quot;</span>] = [label2id[x] <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> inputs[<span class="hljs-string">&quot;label&quot;</span>][<span class="hljs-string">&quot;ids&quot;</span>]]
<span class="hljs-meta">... </span>  <span class="hljs-keyword">return</span> inputs


<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.<span class="hljs-built_in">map</span>(replace_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>flat_dataset = dataset.flatten()
<span class="hljs-meta">&gt;&gt;&gt; </span>flat_dataset.features
{<span class="hljs-string">&#x27;question&#x27;</span>: Value(dtype=<span class="hljs-string">&#x27;string&#x27;</span>, <span class="hljs-built_in">id</span>=<span class="hljs-literal">None</span>),
 <span class="hljs-string">&#x27;image_id&#x27;</span>: Value(dtype=<span class="hljs-string">&#x27;string&#x27;</span>, <span class="hljs-built_in">id</span>=<span class="hljs-literal">None</span>),
 <span class="hljs-string">&#x27;label.ids&#x27;</span>: <span class="hljs-type">Sequence</span>(feature=Value(dtype=<span class="hljs-string">&#x27;int64&#x27;</span>, <span class="hljs-built_in">id</span>=<span class="hljs-literal">None</span>), length=-<span class="hljs-number">1</span>, <span class="hljs-built_in">id</span>=<span class="hljs-literal">None</span>),
 <span class="hljs-string">&#x27;label.weights&#x27;</span>: <span class="hljs-type">Sequence</span>(feature=Value(dtype=<span class="hljs-string">&#x27;float64&#x27;</span>, <span class="hljs-built_in">id</span>=<span class="hljs-literal">None</span>), length=-<span class="hljs-number">1</span>, <span class="hljs-built_in">id</span>=<span class="hljs-literal">None</span>)}`,wrap:!1}}),ts=new zs({props:{title:"Preprocessing data",local:"preprocessing-data",headingTag:"h2"}}),ls=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpbHRQcm9jZXNzb3IlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBWaWx0UHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChtb2RlbF9jaGVja3BvaW50KQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViltProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ViltProcessor.from_pretrained(model_checkpoint)`,wrap:!1}}),rs=new u({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFkZWYlMjBwcmVwcm9jZXNzX2RhdGEoZXhhbXBsZXMpJTNBJTBBJTIwJTIwJTIwJTIwaW1hZ2VfcGF0aHMlMjAlM0QlMjBleGFtcGxlcyU1QidpbWFnZV9pZCclNUQlMEElMjAlMjAlMjAlMjBpbWFnZXMlMjAlM0QlMjAlNUJJbWFnZS5vcGVuKGltYWdlX3BhdGgpJTIwZm9yJTIwaW1hZ2VfcGF0aCUyMGluJTIwaW1hZ2VfcGF0aHMlNUQlMEElMjAlMjAlMjAlMjB0ZXh0cyUyMCUzRCUyMGV4YW1wbGVzJTVCJ3F1ZXN0aW9uJyU1RCUyMCUyMCUyMCUyMCUwQSUwQSUyMCUyMCUyMCUyMGVuY29kaW5nJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUyQyUyMHRleHRzJTJDJTIwcGFkZGluZyUzRCUyMm1heF9sZW5ndGglMjIlMkMlMjB0cnVuY2F0aW9uJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIwJTIwJTIwJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGVuY29kaW5nLml0ZW1zKCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbmNvZGluZyU1QmslNUQlMjAlM0QlMjB2LnNxdWVlemUoKSUwQSUyMCUyMCUyMCUyMHRhcmdldHMlMjAlM0QlMjAlNUIlNUQlMEElMEElMjAlMjAlMjAlMjBmb3IlMjBsYWJlbHMlMkMlMjBzY29yZXMlMjBpbiUyMHppcChleGFtcGxlcyU1QidsYWJlbC5pZHMnJTVEJTJDJTIwZXhhbXBsZXMlNUInbGFiZWwud2VpZ2h0cyclNUQpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdGFyZ2V0JTIwJTNEJTIwdG9yY2guemVyb3MobGVuKGlkMmxhYmVsKSklMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmb3IlMjBsYWJlbCUyQyUyMHNjb3JlJTIwaW4lMjB6aXAobGFiZWxzJTJDJTIwc2NvcmVzKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRhcmdldCU1QmxhYmVsJTVEJTIwJTNEJTIwc2NvcmUlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0YXJnZXRzLmFwcGVuZCh0YXJnZXQpJTBBJTBBJTIwJTIwJTIwJTIwZW5jb2RpbmclNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjB0YXJnZXRzJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwZW5jb2Rpbmc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_data</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    image_paths = examples[<span class="hljs-string">&#x27;image_id&#x27;</span>]
<span class="hljs-meta">... </span>    images = [Image.<span class="hljs-built_in">open</span>(image_path) <span class="hljs-keyword">for</span> image_path <span class="hljs-keyword">in</span> image_paths]
<span class="hljs-meta">... </span>    texts = examples[<span class="hljs-string">&#x27;question&#x27;</span>]    

<span class="hljs-meta">... </span>    encoding = processor(images, texts, padding=<span class="hljs-string">&quot;max_length&quot;</span>, truncation=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items():
<span class="hljs-meta">... </span>          encoding[k] = v.squeeze()
    
<span class="hljs-meta">... </span>    targets = []

<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> labels, scores <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(examples[<span class="hljs-string">&#x27;label.ids&#x27;</span>], examples[<span class="hljs-string">&#x27;label.weights&#x27;</span>]):
<span class="hljs-meta">... </span>        target = torch.zeros(<span class="hljs-built_in">len</span>(id2label))

<span class="hljs-meta">... </span>        <span class="hljs-keyword">for</span> label, score <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(labels, scores):
<span class="hljs-meta">... </span>            target[label] = score
      
<span class="hljs-meta">... </span>        targets.append(target)

<span class="hljs-meta">... </span>    encoding[<span class="hljs-string">&quot;labels&quot;</span>] = targets
    
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> encoding`,wrap:!1}}),ms=new u({props:{code:"cHJvY2Vzc2VkX2RhdGFzZXQlMjAlM0QlMjBmbGF0X2RhdGFzZXQubWFwKHByZXByb2Nlc3NfZGF0YSUyQyUyMGJhdGNoZWQlM0RUcnVlJTJDJTIwcmVtb3ZlX2NvbHVtbnMlM0QlNUIncXVlc3Rpb24nJTJDJ3F1ZXN0aW9uX3R5cGUnJTJDJTIwJTIwJ3F1ZXN0aW9uX2lkJyUyQyUyMCdpbWFnZV9pZCclMkMlMjAnYW5zd2VyX3R5cGUnJTJDJTIwJ2xhYmVsLmlkcyclMkMlMjAnbGFiZWwud2VpZ2h0cyclNUQpJTBBcHJvY2Vzc2VkX2RhdGFzZXQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>processed_dataset = flat_dataset.<span class="hljs-built_in">map</span>(preprocess_data, batched=<span class="hljs-literal">True</span>, remove_columns=[<span class="hljs-string">&#x27;question&#x27;</span>,<span class="hljs-string">&#x27;question_type&#x27;</span>,  <span class="hljs-string">&#x27;question_id&#x27;</span>, <span class="hljs-string">&#x27;image_id&#x27;</span>, <span class="hljs-string">&#x27;answer_type&#x27;</span>, <span class="hljs-string">&#x27;label.ids&#x27;</span>, <span class="hljs-string">&#x27;label.weights&#x27;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>processed_dataset
Dataset({
    features: [<span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;token_type_ids&#x27;</span>, <span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;pixel_values&#x27;</span>, <span class="hljs-string">&#x27;pixel_mask&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>],
    num_rows: <span class="hljs-number">200</span>
})`,wrap:!1}}),hs=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERlZmF1bHREYXRhQ29sbGF0b3IlMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGVmYXVsdERhdGFDb2xsYXRvcigp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DefaultDataCollator

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DefaultDataCollator()`,wrap:!1}}),ds=new zs({props:{title:"Train the model",local:"train-the-model",headingTag:"h2"}}),us=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpbHRGb3JRdWVzdGlvbkFuc3dlcmluZyUwQSUwQW1vZGVsJTIwJTNEJTIwVmlsdEZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZChtb2RlbF9jaGVja3BvaW50JTJDJTIwbnVtX2xhYmVscyUzRGxlbihpZDJsYWJlbCklMkMlMjBpZDJsYWJlbCUzRGlkMmxhYmVsJTJDJTIwbGFiZWwyaWQlM0RsYWJlbDJpZCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ViltForQuestionAnswering

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViltForQuestionAnswering.from_pretrained(model_checkpoint, num_labels=<span class="hljs-built_in">len</span>(id2label), id2label=id2label, label2id=label2id)`,wrap:!1}}),Ms=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBcmVwb19pZCUyMCUzRCUyMCUyMk1hcmlhSyUyRnZpbHRfZmluZXR1bmVkXzIwMCUyMiUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBUcmFpbmluZ0FyZ3VtZW50cyglMEElMjAlMjAlMjAlMjBvdXRwdXRfZGlyJTNEcmVwb19pZCUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0ZXBzJTNEMjAwJTJDJTBBJTIwJTIwJTIwJTIwbG9nZ2luZ19zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDVlLTUlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3RvdGFsX2xpbWl0JTNEMiUyQyUwQSUyMCUyMCUyMCUyMHJlbW92ZV91bnVzZWRfY29sdW1ucyUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>repo_id = <span class="hljs-string">&quot;MariaK/vilt_finetuned_200&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=repo_id,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">4</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    save_steps=<span class="hljs-number">200</span>,
<span class="hljs-meta">... </span>    logging_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">5e-5</span>,
<span class="hljs-meta">... </span>    save_total_limit=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    remove_unused_columns=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    push_to_hub=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)`,wrap:!1}}),js=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluZXIlMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0Rwcm9jZXNzZWRfZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHByb2Nlc3NvciUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>    train_dataset=processed_dataset,
<span class="hljs-meta">... </span>    tokenizer=processor,
<span class="hljs-meta">... </span>)`,wrap:!1}}),bs=new u({props:{code:"dHJhaW5lci50cmFpbigpJTIw",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train() ',wrap:!1}}),Js=new u({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),Ts=new zs({props:{title:"Inference",local:"inference",headingTag:"h2"}}),Us=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBcGlwZSUyMCUzRCUyMHBpcGVsaW5lKCUyMnZpc3VhbC1xdWVzdGlvbi1hbnN3ZXJpbmclMjIlMkMlMjBtb2RlbCUzRCUyMk1hcmlhSyUyRnZpbHRfZmluZXR1bmVkXzIwMCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipeline(<span class="hljs-string">&quot;visual-question-answering&quot;</span>, model=<span class="hljs-string">&quot;MariaK/vilt_finetuned_200&quot;</span>)`,wrap:!1}}),Cs=new u({props:{code:"ZXhhbXBsZSUyMCUzRCUyMGRhdGFzZXQlNUIwJTVEJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKGV4YW1wbGUlNUInaW1hZ2VfaWQnJTVEKSUwQXF1ZXN0aW9uJTIwJTNEJTIwZXhhbXBsZSU1QidxdWVzdGlvbiclNUQlMEFwcmludChxdWVzdGlvbiklMEFwaXBlKGltYWdlJTJDJTIwcXVlc3Rpb24lMkMlMjB0b3BfayUzRDEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>example = dataset[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(example[<span class="hljs-string">&#x27;image_id&#x27;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>question = example[<span class="hljs-string">&#x27;question&#x27;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(question)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe(image, question, top_k=<span class="hljs-number">1</span>)
<span class="hljs-string">&quot;Where is he looking?&quot;</span>
[{<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.5498199462890625</span>, <span class="hljs-string">&#x27;answer&#x27;</span>: <span class="hljs-string">&#x27;down&#x27;</span>}]`,wrap:!1}}),ks=new u({props:{code:"cHJvY2Vzc29yJTIwJTNEJTIwVmlsdFByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyTWFyaWFLJTJGdmlsdF9maW5ldHVuZWRfMjAwJTIyKSUwQSUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihleGFtcGxlJTVCJ2ltYWdlX2lkJyU1RCklMEFxdWVzdGlvbiUyMCUzRCUyMGV4YW1wbGUlNUIncXVlc3Rpb24nJTVEJTBBJTBBJTIzJTIwcHJlcGFyZSUyMGlucHV0cyUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZSUyQyUyMHF1ZXN0aW9uJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFtb2RlbCUyMCUzRCUyMFZpbHRGb3JRdWVzdGlvbkFuc3dlcmluZy5mcm9tX3ByZXRyYWluZWQoJTIyTWFyaWFLJTJGdmlsdF9maW5ldHVuZWRfMjAwJTIyKSUwQSUwQSUyMyUyMGZvcndhcmQlMjBwYXNzJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQWlkeCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KCUyMlByZWRpY3RlZCUyMGFuc3dlciUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QmlkeCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ViltProcessor.from_pretrained(<span class="hljs-string">&quot;MariaK/vilt_finetuned_200&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(example[<span class="hljs-string">&#x27;image_id&#x27;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>question = example[<span class="hljs-string">&#x27;question&#x27;</span>]

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

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ViltForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;MariaK/vilt_finetuned_200&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted answer:&quot;</span>, model.config.id2label[idx])
Predicted answer: down`,wrap:!1}}),Vs=new zs({props:{title:"Zero-shot VQA",local:"zero-shot-vqa",headingTag:"h2"}}),Is=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBCbGlwMkZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyU2FsZXNmb3JjZSUyRmJsaXAyLW9wdC0yLjdiJTIyKSUwQW1vZGVsJTIwJTNEJTIwQmxpcDJGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMlNhbGVzZm9yY2UlMkZibGlwMi1vcHQtMi43YiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFkZXZpY2UlMjAlM0QlMjAlMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiUwQW1vZGVsLnRvKGRldmljZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, Blip2ForConditionalGeneration
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Blip2ForConditionalGeneration.from_pretrained(<span class="hljs-string">&quot;Salesforce/blip2-opt-2.7b&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)`,wrap:!1}}),Xs=new u({props:{code:"ZXhhbXBsZSUyMCUzRCUyMGRhdGFzZXQlNUIwJTVEJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKGV4YW1wbGUlNUInaW1hZ2VfaWQnJTVEKSUwQXF1ZXN0aW9uJTIwJTNEJTIwZXhhbXBsZSU1QidxdWVzdGlvbiclNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>example = dataset[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(example[<span class="hljs-string">&#x27;image_id&#x27;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>question = example[<span class="hljs-string">&#x27;question&#x27;</span>]`,wrap:!1}}),Rs=new u({props:{code:"cHJvbXB0JTIwJTNEJTIwZiUyMlF1ZXN0aW9uJTNBJTIwJTdCcXVlc3Rpb24lN0QlMjBBbnN3ZXIlM0ElMjIlMjA=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">f&quot;Question: <span class="hljs-subst">{question}</span> Answer:&quot;</span> ',wrap:!1}}),Fs=new u({props:{code:"aW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlJTJDJTIwdGV4dCUzRHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnRvKGRldmljZSUyQyUyMHRvcmNoLmZsb2F0MTYpJTBBJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0QxMCklMEFnZW5lcmF0ZWRfdGV4dCUyMCUzRCUyMHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQuc3RyaXAoKSUwQXByaW50KGdlbmVyYXRlZF90ZXh0KQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(image, text=prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device, torch.float16)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">10</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>].strip()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_text)
<span class="hljs-string">&quot;He is looking at the crowd&quot;</span> `,wrap:!1}}),{c(){f=i("meta"),qs=l(),Ys=i("p"),Ls=l(),o(b.$$.fragment),Ss=l(),o(w.$$.fragment),Ps=l(),J=i("p"),J.textContent=Tt,Ds=l(),T=i("p"),T.textContent=xt,Ks=l(),x=i("ul"),x.innerHTML=Ut,Os=l(),U=i("p"),U.textContent=vt,se=l(),v=i("ul"),v.innerHTML=Ct,ee=l(),o(C.$$.fragment),te=l(),$=i("p"),$.innerHTML=$t,ae=l(),Z=i("p"),Z.textContent=Zt,le=l(),_=i("p"),_.textContent=_t,ne=l(),o(k.$$.fragment),ie=l(),V=i("p"),V.textContent=kt,pe=l(),o(G.$$.fragment),re=l(),W=i("p"),W.textContent=Vt,oe=l(),o(I.$$.fragment),me=l(),o(B.$$.fragment),ce=l(),X=i("p"),X.innerHTML=Gt,he=l(),Q=i("p"),Q.innerHTML=Wt,de=l(),R=i("p"),R.textContent=It,ge=l(),o(H.$$.fragment),ue=l(),F=i("p"),F.textContent=Bt,fe=l(),o(N.$$.fragment),ye=l(),z=i("p"),z.textContent=Xt,Me=l(),Y=i("ul"),Y.innerHTML=Qt,je=l(),A=i("p"),A.textContent=Rt,be=l(),o(E.$$.fragment),we=l(),q=i("p"),q.innerHTML=Ht,Je=l(),L=i("p"),L.textContent=Ft,Te=l(),o(S.$$.fragment),xe=l(),y=i("div"),y.innerHTML=Nt,Ue=l(),P=i("p"),P.textContent=zt,ve=l(),D=i("p"),D.innerHTML=Yt,Ce=l(),K=i("p"),K.textContent=At,$e=l(),o(O.$$.fragment),Ze=l(),ss=i("p"),ss.textContent=Et,_e=l(),o(es.$$.fragment),ke=l(),o(ts.$$.fragment),Ve=l(),as=i("p"),as.innerHTML=qt,Ge=l(),o(ls.$$.fragment),We=l(),ns=i("p"),ns.innerHTML=Lt,Ie=l(),is=i("p"),is.innerHTML=St,Be=l(),ps=i("p"),ps.innerHTML=Pt,Xe=l(),o(rs.$$.fragment),Qe=l(),os=i("p"),os.innerHTML=Dt,Re=l(),o(ms.$$.fragment),He=l(),cs=i("p"),cs.innerHTML=Kt,Fe=l(),o(hs.$$.fragment),Ne=l(),o(ds.$$.fragment),ze=l(),gs=i("p"),gs.innerHTML=Ot,Ye=l(),o(us.$$.fragment),Ae=l(),fs=i("p"),fs.textContent=sa,Ee=l(),ys=i("ol"),ys.innerHTML=ea,qe=l(),o(Ms.$$.fragment),Le=l(),M=i("ol"),M.innerHTML=ta,Se=l(),o(js.$$.fragment),Pe=l(),j=i("ol"),j.innerHTML=aa,De=l(),o(bs.$$.fragment),Ke=l(),ws=i("p"),ws.innerHTML=la,Oe=l(),o(Js.$$.fragment),st=l(),o(Ts.$$.fragment),et=l(),xs=i("p"),xs.innerHTML=na,tt=l(),o(Us.$$.fragment),at=l(),vs=i("p"),vs.textContent=ia,lt=l(),o(Cs.$$.fragment),nt=l(),$s=i("p"),$s.textContent=pa,it=l(),Zs=i("p"),Zs.textContent=ra,pt=l(),_s=i("ol"),_s.innerHTML=oa,rt=l(),o(ks.$$.fragment),ot=l(),o(Vs.$$.fragment),mt=l(),Gs=i("p"),Gs.innerHTML=ma,ct=l(),Ws=i("p"),Ws.innerHTML=ca,ht=l(),o(Is.$$.fragment),dt=l(),Bs=i("p"),Bs.textContent=ha,gt=l(),o(Xs.$$.fragment),ut=l(),Qs=i("p"),Qs.innerHTML=da,ft=l(),o(Rs.$$.fragment),yt=l(),Hs=i("p"),Hs.textContent=ga,Mt=l(),o(Fs.$$.fragment),jt=l(),Ns=i("p"),Ns.textContent=ua,bt=l(),As=i("p"),this.h()},l(s){const e=Ja("svelte-u9bgzb",document.head);f=p(e,"META",{name:!0,content:!0}),e.forEach(t),qs=n(s),Ys=p(s,"P",{}),fa(Ys).forEach(t),Ls=n(s),m(b.$$.fragment,s),Ss=n(s),m(w.$$.fragment,s),Ps=n(s),J=p(s,"P",{"data-svelte-h":!0}),r(J)!=="svelte-vljp1h"&&(J.textContent=Tt),Ds=n(s),T=p(s,"P",{"data-svelte-h":!0}),r(T)!=="svelte-1r09kty"&&(T.textContent=xt),Ks=n(s),x=p(s,"UL",{"data-svelte-h":!0}),r(x)!=="svelte-geftd8"&&(x.innerHTML=Ut),Os=n(s),U=p(s,"P",{"data-svelte-h":!0}),r(U)!=="svelte-jr2b5g"&&(U.textContent=vt),se=n(s),v=p(s,"UL",{"data-svelte-h":!0}),r(v)!=="svelte-168wjvr"&&(v.innerHTML=Ct),ee=n(s),m(C.$$.fragment,s),te=n(s),$=p(s,"P",{"data-svelte-h":!0}),r($)!=="svelte-132kvya"&&($.innerHTML=$t),ae=n(s),Z=p(s,"P",{"data-svelte-h":!0}),r(Z)!=="svelte-x085ix"&&(Z.textContent=Zt),le=n(s),_=p(s,"P",{"data-svelte-h":!0}),r(_)!=="svelte-qn4ey1"&&(_.textContent=_t),ne=n(s),m(k.$$.fragment,s),ie=n(s),V=p(s,"P",{"data-svelte-h":!0}),r(V)!=="svelte-1yqpblu"&&(V.textContent=kt),pe=n(s),m(G.$$.fragment,s),re=n(s),W=p(s,"P",{"data-svelte-h":!0}),r(W)!=="svelte-hhk89w"&&(W.textContent=Vt),oe=n(s),m(I.$$.fragment,s),me=n(s),m(B.$$.fragment,s),ce=n(s),X=p(s,"P",{"data-svelte-h":!0}),r(X)!=="svelte-n8sxxt"&&(X.innerHTML=Gt),he=n(s),Q=p(s,"P",{"data-svelte-h":!0}),r(Q)!=="svelte-b7b4c0"&&(Q.innerHTML=Wt),de=n(s),R=p(s,"P",{"data-svelte-h":!0}),r(R)!=="svelte-16i329z"&&(R.textContent=It),ge=n(s),m(H.$$.fragment,s),ue=n(s),F=p(s,"P",{"data-svelte-h":!0}),r(F)!=="svelte-10yp249"&&(F.textContent=Bt),fe=n(s),m(N.$$.fragment,s),ye=n(s),z=p(s,"P",{"data-svelte-h":!0}),r(z)!=="svelte-1g3cog6"&&(z.textContent=Xt),Me=n(s),Y=p(s,"UL",{"data-svelte-h":!0}),r(Y)!=="svelte-o5tqko"&&(Y.innerHTML=Qt),je=n(s),A=p(s,"P",{"data-svelte-h":!0}),r(A)!=="svelte-73ooet"&&(A.textContent=Rt),be=n(s),m(E.$$.fragment,s),we=n(s),q=p(s,"P",{"data-svelte-h":!0}),r(q)!=="svelte-ozbkx3"&&(q.innerHTML=Ht),Je=n(s),L=p(s,"P",{"data-svelte-h":!0}),r(L)!=="svelte-1iqjyc4"&&(L.textContent=Ft),Te=n(s),m(S.$$.fragment,s),xe=n(s),y=p(s,"DIV",{class:!0,"data-svelte-h":!0}),r(y)!=="svelte-1tjg4st"&&(y.innerHTML=Nt),Ue=n(s),P=p(s,"P",{"data-svelte-h":!0}),r(P)!=="svelte-7dyn3e"&&(P.textContent=zt),ve=n(s),D=p(s,"P",{"data-svelte-h":!0}),r(D)!=="svelte-1g9udhi"&&(D.innerHTML=Yt),Ce=n(s),K=p(s,"P",{"data-svelte-h":!0}),r(K)!=="svelte-11t4fgj"&&(K.textContent=At),$e=n(s),m(O.$$.fragment,s),Ze=n(s),ss=p(s,"P",{"data-svelte-h":!0}),r(ss)!=="svelte-1p4inua"&&(ss.textContent=Et),_e=n(s),m(es.$$.fragment,s),ke=n(s),m(ts.$$.fragment,s),Ve=n(s),as=p(s,"P",{"data-svelte-h":!0}),r(as)!=="svelte-md8uyj"&&(as.innerHTML=qt),Ge=n(s),m(ls.$$.fragment,s),We=n(s),ns=p(s,"P",{"data-svelte-h":!0}),r(ns)!=="svelte-vdqbed"&&(ns.innerHTML=Lt),Ie=n(s),is=p(s,"P",{"data-svelte-h":!0}),r(is)!=="svelte-kuuiuf"&&(is.innerHTML=St),Be=n(s),ps=p(s,"P",{"data-svelte-h":!0}),r(ps)!=="svelte-cgn1al"&&(ps.innerHTML=Pt),Xe=n(s),m(rs.$$.fragment,s),Qe=n(s),os=p(s,"P",{"data-svelte-h":!0}),r(os)!=="svelte-1og8o1g"&&(os.innerHTML=Dt),Re=n(s),m(ms.$$.fragment,s),He=n(s),cs=p(s,"P",{"data-svelte-h":!0}),r(cs)!=="svelte-1jw8zeo"&&(cs.innerHTML=Kt),Fe=n(s),m(hs.$$.fragment,s),Ne=n(s),m(ds.$$.fragment,s),ze=n(s),gs=p(s,"P",{"data-svelte-h":!0}),r(gs)!=="svelte-1iw20rl"&&(gs.innerHTML=Ot),Ye=n(s),m(us.$$.fragment,s),Ae=n(s),fs=p(s,"P",{"data-svelte-h":!0}),r(fs)!=="svelte-l42k0i"&&(fs.textContent=sa),Ee=n(s),ys=p(s,"OL",{"data-svelte-h":!0}),r(ys)!=="svelte-8gsikg"&&(ys.innerHTML=ea),qe=n(s),m(Ms.$$.fragment,s),Le=n(s),M=p(s,"OL",{start:!0,"data-svelte-h":!0}),r(M)!=="svelte-6ix8zl"&&(M.innerHTML=ta),Se=n(s),m(js.$$.fragment,s),Pe=n(s),j=p(s,"OL",{start:!0,"data-svelte-h":!0}),r(j)!=="svelte-18cisw2"&&(j.innerHTML=aa),De=n(s),m(bs.$$.fragment,s),Ke=n(s),ws=p(s,"P",{"data-svelte-h":!0}),r(ws)!=="svelte-13v7w4m"&&(ws.innerHTML=la),Oe=n(s),m(Js.$$.fragment,s),st=n(s),m(Ts.$$.fragment,s),et=n(s),xs=p(s,"P",{"data-svelte-h":!0}),r(xs)!=="svelte-y390us"&&(xs.innerHTML=na),tt=n(s),m(Us.$$.fragment,s),at=n(s),vs=p(s,"P",{"data-svelte-h":!0}),r(vs)!=="svelte-1lvulzt"&&(vs.textContent=ia),lt=n(s),m(Cs.$$.fragment,s),nt=n(s),$s=p(s,"P",{"data-svelte-h":!0}),r($s)!=="svelte-mc0cvg"&&($s.textContent=pa),it=n(s),Zs=p(s,"P",{"data-svelte-h":!0}),r(Zs)!=="svelte-o6117l"&&(Zs.textContent=ra),pt=n(s),_s=p(s,"OL",{"data-svelte-h":!0}),r(_s)!=="svelte-346f3f"&&(_s.innerHTML=oa),rt=n(s),m(ks.$$.fragment,s),ot=n(s),m(Vs.$$.fragment,s),mt=n(s),Gs=p(s,"P",{"data-svelte-h":!0}),r(Gs)!=="svelte-4nhby3"&&(Gs.innerHTML=ma),ct=n(s),Ws=p(s,"P",{"data-svelte-h":!0}),r(Ws)!=="svelte-eq4cdk"&&(Ws.innerHTML=ca),ht=n(s),m(Is.$$.fragment,s),dt=n(s),Bs=p(s,"P",{"data-svelte-h":!0}),r(Bs)!=="svelte-w113ee"&&(Bs.textContent=ha),gt=n(s),m(Xs.$$.fragment,s),ut=n(s),Qs=p(s,"P",{"data-svelte-h":!0}),r(Qs)!=="svelte-n2zykh"&&(Qs.innerHTML=da),ft=n(s),m(Rs.$$.fragment,s),yt=n(s),Hs=p(s,"P",{"data-svelte-h":!0}),r(Hs)!=="svelte-10l7d2y"&&(Hs.textContent=ga),Mt=n(s),m(Fs.$$.fragment,s),jt=n(s),Ns=p(s,"P",{"data-svelte-h":!0}),r(Ns)!=="svelte-1wjg6co"&&(Ns.textContent=ua),bt=n(s),As=p(s,"P",{}),fa(As).forEach(t),this.h()},h(){Es(f,"name","hf:doc:metadata"),Es(f,"content",va),Es(y,"class","flex justify-center"),Es(M,"start","2"),Es(j,"start","3")},m(s,e){Ta(document.head,f),a(s,qs,e),a(s,Ys,e),a(s,Ls,e),c(b,s,e),a(s,Ss,e),c(w,s,e),a(s,Ps,e),a(s,J,e),a(s,Ds,e),a(s,T,e),a(s,Ks,e),a(s,x,e),a(s,Os,e),a(s,U,e),a(s,se,e),a(s,v,e),a(s,ee,e),c(C,s,e),a(s,te,e),a(s,$,e),a(s,ae,e),a(s,Z,e),a(s,le,e),a(s,_,e),a(s,ne,e),c(k,s,e),a(s,ie,e),a(s,V,e),a(s,pe,e),c(G,s,e),a(s,re,e),a(s,W,e),a(s,oe,e),c(I,s,e),a(s,me,e),c(B,s,e),a(s,ce,e),a(s,X,e),a(s,he,e),a(s,Q,e),a(s,de,e),a(s,R,e),a(s,ge,e),c(H,s,e),a(s,ue,e),a(s,F,e),a(s,fe,e),c(N,s,e),a(s,ye,e),a(s,z,e),a(s,Me,e),a(s,Y,e),a(s,je,e),a(s,A,e),a(s,be,e),c(E,s,e),a(s,we,e),a(s,q,e),a(s,Je,e),a(s,L,e),a(s,Te,e),c(S,s,e),a(s,xe,e),a(s,y,e),a(s,Ue,e),a(s,P,e),a(s,ve,e),a(s,D,e),a(s,Ce,e),a(s,K,e),a(s,$e,e),c(O,s,e),a(s,Ze,e),a(s,ss,e),a(s,_e,e),c(es,s,e),a(s,ke,e),c(ts,s,e),a(s,Ve,e),a(s,as,e),a(s,Ge,e),c(ls,s,e),a(s,We,e),a(s,ns,e),a(s,Ie,e),a(s,is,e),a(s,Be,e),a(s,ps,e),a(s,Xe,e),c(rs,s,e),a(s,Qe,e),a(s,os,e),a(s,Re,e),c(ms,s,e),a(s,He,e),a(s,cs,e),a(s,Fe,e),c(hs,s,e),a(s,Ne,e),c(ds,s,e),a(s,ze,e),a(s,gs,e),a(s,Ye,e),c(us,s,e),a(s,Ae,e),a(s,fs,e),a(s,Ee,e),a(s,ys,e),a(s,qe,e),c(Ms,s,e),a(s,Le,e),a(s,M,e),a(s,Se,e),c(js,s,e),a(s,Pe,e),a(s,j,e),a(s,De,e),c(bs,s,e),a(s,Ke,e),a(s,ws,e),a(s,Oe,e),c(Js,s,e),a(s,st,e),c(Ts,s,e),a(s,et,e),a(s,xs,e),a(s,tt,e),c(Us,s,e),a(s,at,e),a(s,vs,e),a(s,lt,e),c(Cs,s,e),a(s,nt,e),a(s,$s,e),a(s,it,e),a(s,Zs,e),a(s,pt,e),a(s,_s,e),a(s,rt,e),c(ks,s,e),a(s,ot,e),c(Vs,s,e),a(s,mt,e),a(s,Gs,e),a(s,ct,e),a(s,Ws,e),a(s,ht,e),c(Is,s,e),a(s,dt,e),a(s,Bs,e),a(s,gt,e),c(Xs,s,e),a(s,ut,e),a(s,Qs,e),a(s,ft,e),c(Rs,s,e),a(s,yt,e),a(s,Hs,e),a(s,Mt,e),c(Fs,s,e),a(s,jt,e),a(s,Ns,e),a(s,bt,e),a(s,As,e),wt=!0},p:Ma,i(s){wt||(h(b.$$.fragment,s),h(w.$$.fragment,s),h(C.$$.fragment,s),h(k.$$.fragment,s),h(G.$$.fragment,s),h(I.$$.fragment,s),h(B.$$.fragment,s),h(H.$$.fragment,s),h(N.$$.fragment,s),h(E.$$.fragment,s),h(S.$$.fragment,s),h(O.$$.fragment,s),h(es.$$.fragment,s),h(ts.$$.fragment,s),h(ls.$$.fragment,s),h(rs.$$.fragment,s),h(ms.$$.fragment,s),h(hs.$$.fragment,s),h(ds.$$.fragment,s),h(us.$$.fragment,s),h(Ms.$$.fragment,s),h(js.$$.fragment,s),h(bs.$$.fragment,s),h(Js.$$.fragment,s),h(Ts.$$.fragment,s),h(Us.$$.fragment,s),h(Cs.$$.fragment,s),h(ks.$$.fragment,s),h(Vs.$$.fragment,s),h(Is.$$.fragment,s),h(Xs.$$.fragment,s),h(Rs.$$.fragment,s),h(Fs.$$.fragment,s),wt=!0)},o(s){d(b.$$.fragment,s),d(w.$$.fragment,s),d(C.$$.fragment,s),d(k.$$.fragment,s),d(G.$$.fragment,s),d(I.$$.fragment,s),d(B.$$.fragment,s),d(H.$$.fragment,s),d(N.$$.fragment,s),d(E.$$.fragment,s),d(S.$$.fragment,s),d(O.$$.fragment,s),d(es.$$.fragment,s),d(ts.$$.fragment,s),d(ls.$$.fragment,s),d(rs.$$.fragment,s),d(ms.$$.fragment,s),d(hs.$$.fragment,s),d(ds.$$.fragment,s),d(us.$$.fragment,s),d(Ms.$$.fragment,s),d(js.$$.fragment,s),d(bs.$$.fragment,s),d(Js.$$.fragment,s),d(Ts.$$.fragment,s),d(Us.$$.fragment,s),d(Cs.$$.fragment,s),d(ks.$$.fragment,s),d(Vs.$$.fragment,s),d(Is.$$.fragment,s),d(Xs.$$.fragment,s),d(Rs.$$.fragment,s),d(Fs.$$.fragment,s),wt=!1},d(s){s&&(t(qs),t(Ys),t(Ls),t(Ss),t(Ps),t(J),t(Ds),t(T),t(Ks),t(x),t(Os),t(U),t(se),t(v),t(ee),t(te),t($),t(ae),t(Z),t(le),t(_),t(ne),t(ie),t(V),t(pe),t(re),t(W),t(oe),t(me),t(ce),t(X),t(he),t(Q),t(de),t(R),t(ge),t(ue),t(F),t(fe),t(ye),t(z),t(Me),t(Y),t(je),t(A),t(be),t(we),t(q),t(Je),t(L),t(Te),t(xe),t(y),t(Ue),t(P),t(ve),t(D),t(Ce),t(K),t($e),t(Ze),t(ss),t(_e),t(ke),t(Ve),t(as),t(Ge),t(We),t(ns),t(Ie),t(is),t(Be),t(ps),t(Xe),t(Qe),t(os),t(Re),t(He),t(cs),t(Fe),t(Ne),t(ze),t(gs),t(Ye),t(Ae),t(fs),t(Ee),t(ys),t(qe),t(Le),t(M),t(Se),t(Pe),t(j),t(De),t(Ke),t(ws),t(Oe),t(st),t(et),t(xs),t(tt),t(at),t(vs),t(lt),t(nt),t($s),t(it),t(Zs),t(pt),t(_s),t(rt),t(ot),t(mt),t(Gs),t(ct),t(Ws),t(ht),t(dt),t(Bs),t(gt),t(ut),t(Qs),t(ft),t(yt),t(Hs),t(Mt),t(jt),t(Ns),t(bt),t(As)),t(f),g(b,s),g(w,s),g(C,s),g(k,s),g(G,s),g(I,s),g(B,s),g(H,s),g(N,s),g(E,s),g(S,s),g(O,s),g(es,s),g(ts,s),g(ls,s),g(rs,s),g(ms,s),g(hs,s),g(ds,s),g(us,s),g(Ms,s),g(js,s),g(bs,s),g(Js,s),g(Ts,s),g(Us,s),g(Cs,s),g(ks,s),g(Vs,s),g(Is,s),g(Xs,s),g(Rs,s),g(Fs,s)}}}const va='{"title":"Visual Question Answering","local":"visual-question-answering","sections":[{"title":"Fine-tuning ViLT","local":"fine-tuning-vilt","sections":[],"depth":2},{"title":"Load the data","local":"load-the-data","sections":[],"depth":2},{"title":"Preprocessing data","local":"preprocessing-data","sections":[],"depth":2},{"title":"Train the model","local":"train-the-model","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2},{"title":"Zero-shot VQA","local":"zero-shot-vqa","sections":[],"depth":2}],"depth":1}';function Ca(Jt){return ja(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ga extends ba{constructor(f){super(),wa(this,f,Ca,Ua,ya,{})}}export{Ga as component};
