import{s as Ho,z as Bo,o as Yo,n as Pt}from"../chunks/scheduler.18a86fab.js";import{S as Oo,i as Xo,g as s,s as a,r as p,A as Qo,h as i,f as t,c as r,j as z,u as g,x as d,k as T,y as n,a as l,v as f,d as u,t as h,w as _}from"../chunks/index.98837b22.js";import{T as po}from"../chunks/Tip.77304350.js";import{D as $}from"../chunks/Docstring.6758ea23.js";import{C as So}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as Ko}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as Ce}from"../chunks/Heading.7e7e0c5b.js";import{E as en}from"../chunks/index.92f616ba.js";function tn(I){let c,w='The model is identical to <a href="donut">Donut</a> in terms of architecture.';return{c(){c=s("p"),c.innerHTML=w},l(m){c=i(m,"P",{"data-svelte-h":!0}),d(c)!=="svelte-1qwiol9"&&(c.innerHTML=w)},m(m,x){l(m,c,x)},p:Pt,d(m){m&&t(c)}}}function on(I){let c,w="Example:",m,x,M;return x=new So({props:{code:"Y29ycmVjdF90YWJsZXMoJTIyJTVDYmVnaW4lN0J0YWJsZSU3RCUyMCU1Q2JlZ2luJTdCdGFidWxhciU3RCU3QmwlMjBsJTdEJTIwJTI2JTIwJTVDJTIwJTVDZW5kJTdCdGFidWxhciU3RCUyMCU1Q2VuZCU3QnRhYmxlJTdEJTIyKSUwQSUyMiU1Q2JlZ2luJTdCdGFibGUlN0QlMEFhYnVsYXIlN0QlN0JsJTIwbCU3RCUyMCUyNiUyMCU1QyUyMCU1Q2VuZCU3QnRhYnVsYXIlN0QlMEFsZSU3RCUyMg==",highlighted:`correct_tables(<span class="hljs-string">&quot;\\begin{table} \\begin{tabular}{l l} &amp; \\ \\end{tabular} \\end{table}&quot;</span>)
<span class="hljs-string">&quot;\\begin{table}
abular}{l l} &amp; \\ \\end{tabular}
le}&quot;</span>`,wrap:!1}}),{c(){c=s("p"),c.textContent=w,m=a(),p(x.$$.fragment)},l(y){c=i(y,"P",{"data-svelte-h":!0}),d(c)!=="svelte-11lpom8"&&(c.textContent=w),m=r(y),g(x.$$.fragment,y)},m(y,C){l(y,c,C),l(y,m,C),f(x,y,C),M=!0},p:Pt,i(y){M||(u(x.$$.fragment,y),M=!0)},o(y){h(x.$$.fragment,y),M=!1},d(y){y&&(t(c),t(m)),_(x,y)}}}function nn(I){let c,w=`This class method is simply calling the feature extractor
<a href="/docs/transformers/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained">from_pretrained()</a>, image processor
<a href="/docs/transformers/main/en/internal/image_processing_utils#transformers.ImageProcessingMixin">ImageProcessingMixin</a> and the tokenizer
<code>~tokenization_utils_base.PreTrainedTokenizer.from_pretrained</code> methods. Please refer to the docstrings of the
methods above for more information.`;return{c(){c=s("p"),c.innerHTML=w},l(m){c=i(m,"P",{"data-svelte-h":!0}),d(c)!=="svelte-i4rz41"&&(c.innerHTML=w)},m(m,x){l(m,c,x)},p:Pt,d(m){m&&t(c)}}}function an(I){let c,w=`This class method is simply calling <a href="/docs/transformers/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained">save_pretrained()</a>. Please refer to the docstrings of the
methods above for more information.`;return{c(){c=s("p"),c.innerHTML=w},l(m){c=i(m,"P",{"data-svelte-h":!0}),d(c)!=="svelte-1qvfzw2"&&(c.innerHTML=w)},m(m,x){l(m,c,x)},p:Pt,d(m){m&&t(c)}}}function rn(I){let c,w,m,x,M,y,C,go=`<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="TensorFlow" src="https://img.shields.io/badge/TensorFlow-FF6F00?style=flat&amp;logo=tensorflow&amp;logoColor=white"/> <img alt="Flax" src="https://img.shields.io/badge/Flax-29a79b.svg?style=flat&amp;logo=data:image/png;base64,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
"/>`,tt,O,ot,X,fo=`The Nougat model was proposed in <a href="https://arxiv.org/abs/2308.13418" rel="nofollow">Nougat: Neural Optical Understanding for Academic Documents</a> by
Lukas Blecher, Guillem Cucurull, Thomas Scialom, Robert Stojnic. Nougat uses the same architecture as <a href="donut">Donut</a>, meaning an image Transformer
encoder and an autoregressive text Transformer decoder to translate scientific PDFs to markdown, enabling easier access to them.`,nt,Q,uo="The abstract from the paper is the following:",at,K,ho="<em>Scientific knowledge is predominantly stored in books and scientific journals, often in the form of PDFs. However, the PDF format leads to a loss of semantic information, particularly for mathematical expressions. We propose Nougat (Neural Optical Understanding for Academic Documents), a Visual Transformer model that performs an Optical Character Recognition (OCR) task for processing scientific documents into a markup language, and demonstrate the effectiveness of our model on a new dataset of scientific documents. The proposed approach offers a promising solution to enhance the accessibility of scientific knowledge in the digital age, by bridging the gap between human-readable documents and machine-readable text. We release the models and code to accelerate future work on scientific text recognition.</em>",rt,E,_o,st,ee,bo='Nougat high-level overview. Taken from the <a href="https://arxiv.org/abs/2308.13418">original paper</a>.',it,te,ko=`This model was contributed by <a href="https://huggingface.co/nielsr" rel="nofollow">nielsr</a>. The original code can be found
<a href="https://github.com/facebookresearch/nougat" rel="nofollow">here</a>.`,lt,oe,ct,ne,vo=`<li>The quickest way to get started with Nougat is by checking the <a href="https://github.com/NielsRogge/Transformers-Tutorials/tree/master/Nougat" rel="nofollow">tutorial
notebooks</a>, which show how to use the model
at inference time as well as fine-tuning on custom data.</li> <li>Nougat is always used within the <a href="vision-encoder-decoder">VisionEncoderDecoder</a> framework. The model is identical to <a href="donut">Donut</a> in terms of architecture.</li>`,dt,ae,mt,re,To=`Nougat’s <code>VisionEncoderDecoder</code> model accepts images as input and makes use of
<a href="/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationMixin.generate">generate()</a> to autoregressively generate text given the input image.`,pt,se,yo=`The <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatImageProcessor">NougatImageProcessor</a> class is responsible for preprocessing the input image and
<a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatTokenizerFast">NougatTokenizerFast</a> decodes the generated target tokens to the target string. The
<a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatProcessor">NougatProcessor</a> wraps <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatImageProcessor">NougatImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatTokenizerFast">NougatTokenizerFast</a> classes
into a single instance to both extract the input features and decode the predicted token ids.`,gt,ie,xo="<li>Step-by-step PDF transcription</li>",ft,le,ut,ce,No='See the <a href="https://huggingface.co/models?filter=nougat" rel="nofollow">model hub</a> to look for Nougat checkpoints.',ht,W,_t,de,bt,U,me,Ut,Pe,wo="Constructs a Nougat image processor.",It,G,pe,Ft,Ue,zo="Preprocess an image or batch of images.",kt,ge,vt,b,fe,Jt,Ie,$o="Fast tokenizer for Nougat (backed by HuggingFace tokenizers library).",jt,Fe,Mo=`This tokenizer inherits from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods. This class mainly adds Nougat-specific
methods for postprocessing the generated text.`,Lt,Je,Co="Class attributes (overridden by derived classes)",At,je,Po=`<li><strong>vocab_files_names</strong> (<code>Dict[str, str]</code>) — A dictionary with, as keys, the <code>__init__</code> keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).</li> <li><strong>pretrained_vocab_files_map</strong> (<code>Dict[str, Dict[str, str]]</code>) — A dictionary of dictionaries, with the
high-level keys being the <code>__init__</code> keyword name of each vocabulary file required by the model, the
low-level being the <code>short-cut-names</code> of the pretrained models with, as associated values, the <code>url</code> to the
associated pretrained vocabulary file.</li> <li><strong>model_input_names</strong> (<code>List[str]</code>) — A list of inputs expected in the forward pass of the model.</li> <li><strong>padding_side</strong> (<code>str</code>) — The default value for the side on which the model should have padding applied.
Should be <code>&#39;right&#39;</code> or <code>&#39;left&#39;</code>.</li> <li><strong>truncation_side</strong> (<code>str</code>) — The default value for the side on which the model should have truncation
applied. Should be <code>&#39;right&#39;</code> or <code>&#39;left&#39;</code>.</li>`,Zt,F,ue,Et,Le,Uo="Takes a generated string and fixes tables/tabulars to make them match the markdown format needed.",Wt,V,Gt,P,he,Vt,Ae,Io="Postprocess a generated text or a list of generated texts.",Dt,Ze,Fo="This function can be used to perform postprocessing on generated text, such as fixing Markdown formatting.",Rt,Ee,Jo="Postprocessing is quite slow so it is recommended to use multiprocessing to speed up the process.",qt,D,_e,St,We,jo=`Postprocess a single generated text. Regular expressions used here are taken directly from the Nougat article
authors. These expressions are commented for clarity and tested end-to-end in most cases.`,Ht,J,be,Bt,Ge,Lo="Remove hallucinated or missing references from the text.",Yt,Ve,Ao="This function identifies and removes references that are marked as missing or hallucinated from the input text.",Tt,ke,yt,k,ve,Ot,De,Zo="Constructs a Nougat processor which wraps a Nougat image processor and a Nougat tokenizer into a single processor.",Xt,Re,Eo=`<a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatProcessor">NougatProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatImageProcessor">NougatImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatTokenizerFast">NougatTokenizerFast</a>. See the
<a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatProcessor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatProcessor.decode">decode()</a> for more information.`,Qt,qe,Te,Kt,j,ye,eo,Se,Wo="Instantiate a processor associated with a pretrained model.",to,R,oo,L,xe,no,He,Go=`Saves the attributes of this processor (feature extractor, tokenizer…) in the specified directory so that it
can be reloaded using the <a href="/docs/transformers/main/en/main_classes/processors#transformers.ProcessorMixin.from_pretrained">from_pretrained()</a> method.`,ao,q,ro,S,Ne,so,Be,Vo=`This method forwards all its arguments to NougatTokenizer’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please refer
to the docstring of this method for more information.`,io,H,we,lo,Ye,Do=`This method forwards all its arguments to NougatTokenizer’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,co,B,ze,mo,Oe,Ro=`This method forwards all its arguments to NougatTokenizer’s <code>~PreTrainedTokenizer.post_process_generation</code>.
Please refer to the docstring of this method for more information.`,xt,$e,Nt,et,wt;return M=new Ce({props:{title:"Nougat",local:"nougat",headingTag:"h1"}}),O=new Ce({props:{title:"Overview",local:"overview",headingTag:"h2"}}),oe=new Ce({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),ae=new Ce({props:{title:"Inference",local:"inference",headingTag:"h2"}}),le=new So({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUwQWltcG9ydCUyMHJlJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME5vdWdhdFByb2Nlc3NvciUyQyUyMFZpc2lvbkVuY29kZXJEZWNvZGVyTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyME5vdWdhdFByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZub3VnYXQtYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMFZpc2lvbkVuY29kZXJEZWNvZGVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGbm91Z2F0LWJhc2UlMjIpJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEFtb2RlbC50byhkZXZpY2UpJTBBJTIzJTIwcHJlcGFyZSUyMFBERiUyMGltYWdlJTIwZm9yJTIwdGhlJTIwbW9kZWwlMEFmaWxlcGF0aCUyMCUzRCUyMGhmX2h1Yl9kb3dubG9hZChyZXBvX2lkJTNEJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmZpeHR1cmVzX2RvY3ZxYSUyMiUyQyUyMGZpbGVuYW1lJTNEJTIybm91Z2F0X3BhcGVyLnBuZyUyMiUyQyUyMHJlcG9fdHlwZSUzRCUyMmRhdGFzZXQlMjIpJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKGZpbGVwYXRoKSUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQSUwQSUyMyUyMGdlbmVyYXRlJTIwdHJhbnNjcmlwdGlvbiUyMChoZXJlJTIwd2UlMjBvbmx5JTIwZ2VuZXJhdGUlMjAzMCUyMHRva2VucyklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoJTBBJTIwJTIwJTIwJTIwcGl4ZWxfdmFsdWVzLnRvKGRldmljZSklMkMlMEElMjAlMjAlMjAlMjBtaW5fbGVuZ3RoJTNEMSUyQyUwQSUyMCUyMCUyMCUyMG1heF9uZXdfdG9rZW5zJTNEMzAlMkMlMEElMjAlMjAlMjAlMjBiYWRfd29yZHNfaWRzJTNEJTVCJTVCcHJvY2Vzc29yLnRva2VuaXplci51bmtfdG9rZW5faWQlNUQlNUQlMkMlMEEpJTBBJTBBc2VxdWVuY2UlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKG91dHB1dHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVEJTBBc2VxdWVuY2UlMjAlM0QlMjBwcm9jZXNzb3IucG9zdF9wcm9jZXNzX2dlbmVyYXRpb24oc2VxdWVuY2UlMkMlMjBmaXhfbWFya2Rvd24lM0RGYWxzZSklMEElMjMlMjBub3RlJTNBJTIwd2UncmUlMjB1c2luZyUyMHJlcHIlMjBoZXJlJTIwc3VjaCUyMGZvciUyMHRoZSUyMHNha2UlMjBvZiUyMHByaW50aW5nJTIwdGhlJTIwJTVDbiUyMGNoYXJhY3RlcnMlMkMlMjBmZWVsJTIwZnJlZSUyMHRvJTIwanVzdCUyMHByaW50JTIwdGhlJTIwc2VxdWVuY2UlMEFwcmludChyZXByKHNlcXVlbmNlKSk=",highlighted:`<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">import</span> re
<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> transformers <span class="hljs-keyword">import</span> NougatProcessor, VisionEncoderDecoderModel
<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><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = NougatProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/nougat-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = VisionEncoderDecoderModel.from_pretrained(<span class="hljs-string">&quot;facebook/nougat-base&quot;</span>)

<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)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># prepare PDF image for the model</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>filepath = hf_hub_download(repo_id=<span class="hljs-string">&quot;hf-internal-testing/fixtures_docvqa&quot;</span>, filename=<span class="hljs-string">&quot;nougat_paper.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>(filepath)
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate transcription (here we only generate 30 tokens)</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model.generate(
<span class="hljs-meta">... </span>    pixel_values.to(device),
<span class="hljs-meta">... </span>    min_length=<span class="hljs-number">1</span>,
<span class="hljs-meta">... </span>    max_new_tokens=<span class="hljs-number">30</span>,
<span class="hljs-meta">... </span>    bad_words_ids=[[processor.tokenizer.unk_token_id]],
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>sequence = processor.batch_decode(outputs, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>sequence = processor.post_process_generation(sequence, fix_markdown=<span class="hljs-literal">False</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># note: we&#x27;re using repr here such for the sake of printing the \\n characters, feel free to just print the sequence</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-built_in">repr</span>(sequence))
<span class="hljs-string">&#x27;\\n\\n# Nougat: Neural Optical Understanding for Academic Documents\\n\\n Lukas Blecher\\n\\nCorrespondence to: lblecher@&#x27;</span>`,wrap:!1}}),W=new po({props:{$$slots:{default:[tn]},$$scope:{ctx:I}}}),de=new Ce({props:{title:"NougatImageProcessor",local:"transformers.NougatImageProcessor",headingTag:"h2"}}),me=new $({props:{name:"class transformers.NougatImageProcessor",anchor:"transformers.NougatImageProcessor",parameters:[{name:"do_crop_margin",val:": bool = True"},{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = <Resampling.BILINEAR: 2>"},{name:"do_thumbnail",val:": bool = True"},{name:"do_align_long_axis",val:": bool = False"},{name:"do_pad",val:": bool = True"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NougatImageProcessor.do_crop_margin",description:`<strong>do_crop_margin</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to crop the image margins.`,name:"do_crop_margin"},{anchor:"transformers.NougatImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.NougatImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 896, &quot;width&quot;: 672}</code>):
Size of the image after resizing. Can be overridden by <code>size</code> in the <code>preprocess</code> method.`,name:"size"},{anchor:"transformers.NougatImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BILINEAR</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.NougatImageProcessor.do_thumbnail",description:`<strong>do_thumbnail</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image using thumbnail method.`,name:"do_thumbnail"},{anchor:"transformers.NougatImageProcessor.do_align_long_axis",description:`<strong>do_align_long_axis</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to align the long axis of the image with the long axis of <code>size</code> by rotating by 90 degrees.`,name:"do_align_long_axis"},{anchor:"transformers.NougatImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to pad the images to the largest image size in the batch.`,name:"do_pad"},{anchor:"transformers.NougatImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.NougatImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.NougatImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.NougatImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_DEFAULT_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.NougatImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_DEFAULT_STD</code>) &#x2014;
Image standard deviation.`,name:"image_std"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/image_processing_nougat.py#L58"}}),pe=new $({props:{name:"preprocess",anchor:"transformers.NougatImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"do_crop_margin",val:": typing.Optional[bool] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = None"},{name:"do_thumbnail",val:": typing.Optional[bool] = None"},{name:"do_align_long_axis",val:": typing.Optional[bool] = None"},{name:"do_pad",val:": typing.Optional[bool] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Union[int, float, NoneType] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"}],parametersDescription:[{anchor:"transformers.NougatImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255.`,name:"images"},{anchor:"transformers.NougatImageProcessor.preprocess.do_crop_margin",description:`<strong>do_crop_margin</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_crop_margin</code>) &#x2014;
Whether to crop the image margins.`,name:"do_crop_margin"},{anchor:"transformers.NougatImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.NougatImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to min(size[&#x201C;height&#x201D;],
size[&#x201C;width&#x201D;]) with the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.NougatImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.NougatImageProcessor.preprocess.do_thumbnail",description:`<strong>do_thumbnail</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_thumbnail</code>) &#x2014;
Whether to resize the image using thumbnail method.`,name:"do_thumbnail"},{anchor:"transformers.NougatImageProcessor.preprocess.do_align_long_axis",description:`<strong>do_align_long_axis</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_align_long_axis</code>) &#x2014;
Whether to align the long axis of the image with the long axis of <code>size</code> by rotating by 90 degrees.`,name:"do_align_long_axis"},{anchor:"transformers.NougatImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_pad</code>) &#x2014;
Whether to pad the images to the largest image size in the batch.`,name:"do_pad"},{anchor:"transformers.NougatImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>.`,name:"do_rescale"},{anchor:"transformers.NougatImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Scale factor to use if rescaling the image.`,name:"rescale_factor"},{anchor:"transformers.NougatImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.NougatImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization.`,name:"image_mean"},{anchor:"transformers.NougatImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization.`,name:"image_std"},{anchor:"transformers.NougatImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.NougatImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: defaults to the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.NougatImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/image_processing_nougat.py#L370"}}),ge=new Ce({props:{title:"NougatTokenizerFast",local:"transformers.NougatTokenizerFast",headingTag:"h2"}}),fe=new $({props:{name:"class transformers.NougatTokenizerFast",anchor:"transformers.NougatTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"pad_token",val:" = '<pad>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NougatTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .model extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.NougatTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://github.com/huggingface/tokenizers" rel="nofollow">tokenizers</a> file (generally has a .json extension) that
contains everything needed to load the tokenizer.`,name:"tokenizer_file"},{anchor:"transformers.NougatTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to cleanup spaces after decoding, cleanup consists in removing potential artifacts like extra
spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.NougatTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.NougatTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.`,name:"bos_token"},{anchor:"transformers.NougatTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.NougatTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.NougatTokenizerFast.model_max_length",description:`<strong>model_max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length (in number of tokens) for the inputs to the transformer model. When the tokenizer is
loaded with <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained">from_pretrained()</a>, this will be set to the
value stored for the associated model in <code>max_model_input_sizes</code> (see above). If no value is provided, will
default to VERY_LARGE_INTEGER (<code>int(1e30)</code>).`,name:"model_max_length"},{anchor:"transformers.NougatTokenizerFast.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have padding applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.NougatTokenizerFast.truncation_side",description:`<strong>truncation_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have truncation applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"truncation_side"},{anchor:"transformers.NougatTokenizerFast.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A Jinja template string that will be used to format lists of chat messages. See
<a href="https://huggingface.co/docs/transformers/chat_templating" rel="nofollow">https://huggingface.co/docs/transformers/chat_templating</a> for a full description.`,name:"chat_template"},{anchor:"transformers.NougatTokenizerFast.model_input_names",description:`<strong>model_input_names</strong> (<code>List[string]</code>, <em>optional</em>) &#x2014;
The list of inputs accepted by the forward pass of the model (like <code>&quot;token_type_ids&quot;</code> or
<code>&quot;attention_mask&quot;</code>). Default value is picked from the class attribute of the same name.`,name:"model_input_names"},{anchor:"transformers.NougatTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the beginning of a sentence. Will be associated to <code>self.bos_token</code> and
<code>self.bos_token_id</code>.`,name:"bos_token"},{anchor:"transformers.NougatTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the end of a sentence. Will be associated to <code>self.eos_token</code> and
<code>self.eos_token_id</code>.`,name:"eos_token"},{anchor:"transformers.NougatTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing an out-of-vocabulary token. Will be associated to <code>self.unk_token</code> and
<code>self.unk_token_id</code>.`,name:"unk_token"},{anchor:"transformers.NougatTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token separating two different sentences in the same input (used by BERT for instance). Will be
associated to <code>self.sep_token</code> and <code>self.sep_token_id</code>.`,name:"sep_token"},{anchor:"transformers.NougatTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation. Will be associated to <code>self.pad_token</code> and <code>self.pad_token_id</code>.`,name:"pad_token"},{anchor:"transformers.NougatTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the class of the input (used by BERT for instance). Will be associated to
<code>self.cls_token</code> and <code>self.cls_token_id</code>.`,name:"cls_token"},{anchor:"transformers.NougatTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing a masked token (used by masked-language modeling pretraining objectives, like
BERT). Will be associated to <code>self.mask_token</code> and <code>self.mask_token_id</code>.`,name:"mask_token"},{anchor:"transformers.NougatTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (tuple or list of <code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A tuple or a list of additional special tokens. Add them here to ensure they are skipped when decoding with
<code>skip_special_tokens</code> is set to True. If they are not part of the vocabulary, they will be added at the end
of the vocabulary.`,name:"additional_special_tokens"},{anchor:"transformers.NougatTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should cleanup the spaces that were added when splitting the input text during the
tokenization process.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.NougatTokenizerFast.split_special_tokens",description:`<strong>split_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the special tokens should be split during the tokenization process. Passing will affect the
internal state of the tokenizer. The default behavior is to not split special tokens. This means that if
<code>&lt;s&gt;</code> is the <code>bos_token</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;) = [&apos;&lt;s&gt;</code>]. Otherwise, if
<code>split_special_tokens=True</code>, then <code>tokenizer.tokenize(&quot;&lt;s&gt;&quot;)</code> will be give <code>[&apos;&lt;&apos;,&apos;s&apos;, &apos;&gt;&apos;]</code>.`,name:"split_special_tokens"},{anchor:"transformers.NougatTokenizerFast.tokenizer_object",description:`<strong>tokenizer_object</strong> (<a href="https://huggingface.co/docs/tokenizers/main/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a>) &#x2014;
A <a href="https://huggingface.co/docs/tokenizers/main/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a> object from &#x1F917; tokenizers to instantiate from. See <a href="../fast_tokenizers">Using tokenizers from &#x1F917;
tokenizers</a> for more information.`,name:"tokenizer_object"},{anchor:"transformers.NougatTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>) &#x2014;
A path to a local JSON file representing a previously serialized <a href="https://huggingface.co/docs/tokenizers/main/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a> object from &#x1F917;
tokenizers.`,name:"tokenizer_file"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/tokenization_nougat_fast.py#L361"}}),ue=new $({props:{name:"correct_tables",anchor:"transformers.NougatTokenizerFast.correct_tables",parameters:[{name:"generation",val:": str"}],parametersDescription:[{anchor:"transformers.NougatTokenizerFast.correct_tables.generation",description:"<strong>generation</strong> (str) &#x2014; The generated text to be postprocessed.",name:"generation"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/tokenization_nougat_fast.py#L453",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The postprocessed text.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>str</p>
`}}),V=new Ko({props:{anchor:"transformers.NougatTokenizerFast.correct_tables.example",$$slots:{default:[on]},$$scope:{ctx:I}}}),he=new $({props:{name:"post_process_generation",anchor:"transformers.NougatTokenizerFast.post_process_generation",parameters:[{name:"generation",val:": typing.Union[str, typing.List[str]]"},{name:"fix_markdown",val:": bool = True"},{name:"num_workers",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.NougatTokenizerFast.post_process_generation.generation",description:`<strong>generation</strong> (Union[str, List[str]]) &#x2014;
The generated text or a list of generated texts.`,name:"generation"},{anchor:"transformers.NougatTokenizerFast.post_process_generation.fix_markdown",description:`<strong>fix_markdown</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to perform Markdown formatting fixes.`,name:"fix_markdown"},{anchor:"transformers.NougatTokenizerFast.post_process_generation.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Optional number of workers to pass to leverage multiprocessing (postprocessing several texts in
parallel).`,name:"num_workers"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/tokenization_nougat_fast.py#L583",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The postprocessed text or list of postprocessed texts.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Union[str, List[str]]</p>
`}}),_e=new $({props:{name:"post_process_single",anchor:"transformers.NougatTokenizerFast.post_process_single",parameters:[{name:"generation",val:": str"},{name:"fix_markdown",val:": bool = True"}],parametersDescription:[{anchor:"transformers.NougatTokenizerFast.post_process_single.generation",description:"<strong>generation</strong> (str) &#x2014; The generated text to be postprocessed.",name:"generation"},{anchor:"transformers.NougatTokenizerFast.post_process_single.fix_markdown",description:"<strong>fix_markdown</strong> (bool, optional) &#x2014; Whether to perform Markdown formatting fixes. Default is True.",name:"fix_markdown"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/tokenization_nougat_fast.py#L488",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The postprocessed text.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>str</p>
`}}),be=new $({props:{name:"remove_hallucinated_references",anchor:"transformers.NougatTokenizerFast.remove_hallucinated_references",parameters:[{name:"text",val:": str"}],parametersDescription:[{anchor:"transformers.NougatTokenizerFast.remove_hallucinated_references.text",description:`<strong>text</strong> (<code>str</code>) &#x2014;
The input text containing references.`,name:"text"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/tokenization_nougat_fast.py#L423",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The text with hallucinated references removed.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code></p>
`}}),ke=new Ce({props:{title:"NougatProcessor",local:"transformers.NougatProcessor",headingTag:"h2"}}),ve=new $({props:{name:"class transformers.NougatProcessor",anchor:"transformers.NougatProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.NougatProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatImageProcessor">NougatImageProcessor</a>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatImageProcessor">NougatImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.NougatProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatTokenizerFast">NougatTokenizerFast</a>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/nougat#transformers.NougatTokenizerFast">NougatTokenizerFast</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/processing_nougat.py#L27"}}),Te=new $({props:{name:"__call__",anchor:"transformers.NougatProcessor.__call__",parameters:[{name:"images",val:" = None"},{name:"text",val:" = None"},{name:"do_crop_margin",val:": typing.Optional[bool] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": PILImageResampling = None"},{name:"do_thumbnail",val:": typing.Optional[bool] = None"},{name:"do_align_long_axis",val:": typing.Optional[bool] = None"},{name:"do_pad",val:": typing.Optional[bool] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Union[int, float, NoneType] = None"},{name:"do_normalize",val:": typing.Optional[bool] = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"data_format",val:": typing.Optional[ForwardRef('ChannelDimension')] = 'channels_first'"},{name:"input_data_format",val:": typing.Union[str, ForwardRef('ChannelDimension'), NoneType] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/processing_nougat.py#L49"}}),ye=new $({props:{name:"from_pretrained",anchor:"transformers.NougatProcessor.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"cache_dir",val:": typing.Union[str, os.PathLike, NoneType] = None"},{name:"force_download",val:": bool = False"},{name:"local_files_only",val:": bool = False"},{name:"token",val:": typing.Union[str, bool, NoneType] = None"},{name:"revision",val:": str = 'main'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NougatProcessor.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained feature_extractor hosted inside a model repo on
huggingface.co.</li>
<li>a path to a <em>directory</em> containing a feature extractor file saved using the
<a href="/docs/transformers/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.save_pretrained">save_pretrained()</a> method, e.g., <code>./my_model_directory/</code>.</li>
<li>a path or url to a saved feature extractor JSON <em>file</em>, e.g.,
<code>./my_model_directory/preprocessor_config.json</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"transformers.NougatProcessor.from_pretrained.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments passed along to both
<a href="/docs/transformers/main/en/main_classes/feature_extractor#transformers.FeatureExtractionMixin.from_pretrained">from_pretrained()</a> and
<code>~tokenization_utils_base.PreTrainedTokenizer.from_pretrained</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L1126"}}),R=new po({props:{$$slots:{default:[nn]},$$scope:{ctx:I}}}),xe=new $({props:{name:"save_pretrained",anchor:"transformers.NougatProcessor.save_pretrained",parameters:[{name:"save_directory",val:""},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.NougatProcessor.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the feature extractor JSON file and the tokenizer files will be saved (directory will
be created if it does not exist).`,name:"save_directory"},{anchor:"transformers.NougatProcessor.save_pretrained.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push your model to the Hugging Face model hub after saving it. You can specify the
repository you want to push to with <code>repo_id</code> (will default to the name of <code>save_directory</code> in your
namespace).`,name:"push_to_hub"},{anchor:"transformers.NougatProcessor.save_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional key word arguments passed along to the <a href="/docs/transformers/main/en/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub">push_to_hub()</a> method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/processing_utils.py#L582"}}),q=new po({props:{$$slots:{default:[an]},$$scope:{ctx:I}}}),Ne=new $({props:{name:"batch_decode",anchor:"transformers.NougatProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/processing_nougat.py#L141"}}),we=new $({props:{name:"decode",anchor:"transformers.NougatProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/processing_nougat.py#L148"}}),ze=new $({props:{name:"post_process_generation",anchor:"transformers.NougatProcessor.post_process_generation",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/nougat/processing_nougat.py#L155"}}),$e=new en({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/nougat.md"}}),{c(){c=s("meta"),w=a(),m=s("p"),x=a(),p(M.$$.fragment),y=a(),C=s("div"),C.innerHTML=go,tt=a(),p(O.$$.fragment),ot=a(),X=s("p"),X.innerHTML=fo,nt=a(),Q=s("p"),Q.textContent=uo,at=a(),K=s("p"),K.innerHTML=ho,rt=a(),E=s("img"),st=a(),ee=s("small"),ee.innerHTML=bo,it=a(),te=s("p"),te.innerHTML=ko,lt=a(),p(oe.$$.fragment),ct=a(),ne=s("ul"),ne.innerHTML=vo,dt=a(),p(ae.$$.fragment),mt=a(),re=s("p"),re.innerHTML=To,pt=a(),se=s("p"),se.innerHTML=yo,gt=a(),ie=s("ul"),ie.innerHTML=xo,ft=a(),p(le.$$.fragment),ut=a(),ce=s("p"),ce.innerHTML=No,ht=a(),p(W.$$.fragment),_t=a(),p(de.$$.fragment),bt=a(),U=s("div"),p(me.$$.fragment),Ut=a(),Pe=s("p"),Pe.textContent=wo,It=a(),G=s("div"),p(pe.$$.fragment),Ft=a(),Ue=s("p"),Ue.textContent=zo,kt=a(),p(ge.$$.fragment),vt=a(),b=s("div"),p(fe.$$.fragment),Jt=a(),Ie=s("p"),Ie.textContent=$o,jt=a(),Fe=s("p"),Fe.innerHTML=Mo,Lt=a(),Je=s("p"),Je.textContent=Co,At=a(),je=s("ul"),je.innerHTML=Po,Zt=a(),F=s("div"),p(ue.$$.fragment),Et=a(),Le=s("p"),Le.textContent=Uo,Wt=a(),p(V.$$.fragment),Gt=a(),P=s("div"),p(he.$$.fragment),Vt=a(),Ae=s("p"),Ae.textContent=Io,Dt=a(),Ze=s("p"),Ze.textContent=Fo,Rt=a(),Ee=s("p"),Ee.textContent=Jo,qt=a(),D=s("div"),p(_e.$$.fragment),St=a(),We=s("p"),We.textContent=jo,Ht=a(),J=s("div"),p(be.$$.fragment),Bt=a(),Ge=s("p"),Ge.textContent=Lo,Yt=a(),Ve=s("p"),Ve.textContent=Ao,Tt=a(),p(ke.$$.fragment),yt=a(),k=s("div"),p(ve.$$.fragment),Ot=a(),De=s("p"),De.textContent=Zo,Xt=a(),Re=s("p"),Re.innerHTML=Eo,Qt=a(),qe=s("div"),p(Te.$$.fragment),Kt=a(),j=s("div"),p(ye.$$.fragment),eo=a(),Se=s("p"),Se.textContent=Wo,to=a(),p(R.$$.fragment),oo=a(),L=s("div"),p(xe.$$.fragment),no=a(),He=s("p"),He.innerHTML=Go,ao=a(),p(q.$$.fragment),ro=a(),S=s("div"),p(Ne.$$.fragment),so=a(),Be=s("p"),Be.innerHTML=Vo,io=a(),H=s("div"),p(we.$$.fragment),lo=a(),Ye=s("p"),Ye.innerHTML=Do,co=a(),B=s("div"),p(ze.$$.fragment),mo=a(),Oe=s("p"),Oe.innerHTML=Ro,xt=a(),p($e.$$.fragment),Nt=a(),et=s("p"),this.h()},l(e){const o=Qo("svelte-u9bgzb",document.head);c=i(o,"META",{name:!0,content:!0}),o.forEach(t),w=r(e),m=i(e,"P",{}),z(m).forEach(t),x=r(e),g(M.$$.fragment,e),y=r(e),C=i(e,"DIV",{class:!0,"data-svelte-h":!0}),d(C)!=="svelte-1px1zvi"&&(C.innerHTML=go),tt=r(e),g(O.$$.fragment,e),ot=r(e),X=i(e,"P",{"data-svelte-h":!0}),d(X)!=="svelte-1uufact"&&(X.innerHTML=fo),nt=r(e),Q=i(e,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-vfdo9a"&&(Q.textContent=uo),at=r(e),K=i(e,"P",{"data-svelte-h":!0}),d(K)!=="svelte-1io5hvx"&&(K.innerHTML=ho),rt=r(e),E=i(e,"IMG",{src:!0,alt:!0,width:!0}),st=r(e),ee=i(e,"SMALL",{"data-svelte-h":!0}),d(ee)!=="svelte-hlvtr5"&&(ee.innerHTML=bo),it=r(e),te=i(e,"P",{"data-svelte-h":!0}),d(te)!=="svelte-jkp8zk"&&(te.innerHTML=ko),lt=r(e),g(oe.$$.fragment,e),ct=r(e),ne=i(e,"UL",{"data-svelte-h":!0}),d(ne)!=="svelte-zxlclw"&&(ne.innerHTML=vo),dt=r(e),g(ae.$$.fragment,e),mt=r(e),re=i(e,"P",{"data-svelte-h":!0}),d(re)!=="svelte-15g37qv"&&(re.innerHTML=To),pt=r(e),se=i(e,"P",{"data-svelte-h":!0}),d(se)!=="svelte-vq46hj"&&(se.innerHTML=yo),gt=r(e),ie=i(e,"UL",{"data-svelte-h":!0}),d(ie)!=="svelte-1x92kdi"&&(ie.innerHTML=xo),ft=r(e),g(le.$$.fragment,e),ut=r(e),ce=i(e,"P",{"data-svelte-h":!0}),d(ce)!=="svelte-5b9r1n"&&(ce.innerHTML=No),ht=r(e),g(W.$$.fragment,e),_t=r(e),g(de.$$.fragment,e),bt=r(e),U=i(e,"DIV",{class:!0});var A=z(U);g(me.$$.fragment,A),Ut=r(A),Pe=i(A,"P",{"data-svelte-h":!0}),d(Pe)!=="svelte-1e7ox92"&&(Pe.textContent=wo),It=r(A),G=i(A,"DIV",{class:!0});var Me=z(G);g(pe.$$.fragment,Me),Ft=r(Me),Ue=i(Me,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-1x3yxsa"&&(Ue.textContent=zo),Me.forEach(t),A.forEach(t),kt=r(e),g(ge.$$.fragment,e),vt=r(e),b=i(e,"DIV",{class:!0});var v=z(b);g(fe.$$.fragment,v),Jt=r(v),Ie=i(v,"P",{"data-svelte-h":!0}),d(Ie)!=="svelte-srzklv"&&(Ie.textContent=$o),jt=r(v),Fe=i(v,"P",{"data-svelte-h":!0}),d(Fe)!=="svelte-874unm"&&(Fe.innerHTML=Mo),Lt=r(v),Je=i(v,"P",{"data-svelte-h":!0}),d(Je)!=="svelte-1ixo79u"&&(Je.textContent=Co),At=r(v),je=i(v,"UL",{"data-svelte-h":!0}),d(je)!=="svelte-1y0k6z5"&&(je.innerHTML=Po),Zt=r(v),F=i(v,"DIV",{class:!0});var Z=z(F);g(ue.$$.fragment,Z),Et=r(Z),Le=i(Z,"P",{"data-svelte-h":!0}),d(Le)!=="svelte-3j23fp"&&(Le.textContent=Uo),Wt=r(Z),g(V.$$.fragment,Z),Z.forEach(t),Gt=r(v),P=i(v,"DIV",{class:!0});var Y=z(P);g(he.$$.fragment,Y),Vt=r(Y),Ae=i(Y,"P",{"data-svelte-h":!0}),d(Ae)!=="svelte-15rcjls"&&(Ae.textContent=Io),Dt=r(Y),Ze=i(Y,"P",{"data-svelte-h":!0}),d(Ze)!=="svelte-vhmx5q"&&(Ze.textContent=Fo),Rt=r(Y),Ee=i(Y,"P",{"data-svelte-h":!0}),d(Ee)!=="svelte-vjc015"&&(Ee.textContent=Jo),Y.forEach(t),qt=r(v),D=i(v,"DIV",{class:!0});var zt=z(D);g(_e.$$.fragment,zt),St=r(zt),We=i(zt,"P",{"data-svelte-h":!0}),d(We)!=="svelte-44h31"&&(We.textContent=jo),zt.forEach(t),Ht=r(v),J=i(v,"DIV",{class:!0});var Xe=z(J);g(be.$$.fragment,Xe),Bt=r(Xe),Ge=i(Xe,"P",{"data-svelte-h":!0}),d(Ge)!=="svelte-jqzf81"&&(Ge.textContent=Lo),Yt=r(Xe),Ve=i(Xe,"P",{"data-svelte-h":!0}),d(Ve)!=="svelte-1dlctcq"&&(Ve.textContent=Ao),Xe.forEach(t),v.forEach(t),Tt=r(e),g(ke.$$.fragment,e),yt=r(e),k=i(e,"DIV",{class:!0});var N=z(k);g(ve.$$.fragment,N),Ot=r(N),De=i(N,"P",{"data-svelte-h":!0}),d(De)!=="svelte-1rx2qxv"&&(De.textContent=Zo),Xt=r(N),Re=i(N,"P",{"data-svelte-h":!0}),d(Re)!=="svelte-15g1wot"&&(Re.innerHTML=Eo),Qt=r(N),qe=i(N,"DIV",{class:!0});var qo=z(qe);g(Te.$$.fragment,qo),qo.forEach(t),Kt=r(N),j=i(N,"DIV",{class:!0});var Qe=z(j);g(ye.$$.fragment,Qe),eo=r(Qe),Se=i(Qe,"P",{"data-svelte-h":!0}),d(Se)!=="svelte-1cj8dcb"&&(Se.textContent=Wo),to=r(Qe),g(R.$$.fragment,Qe),Qe.forEach(t),oo=r(N),L=i(N,"DIV",{class:!0});var Ke=z(L);g(xe.$$.fragment,Ke),no=r(Ke),He=i(Ke,"P",{"data-svelte-h":!0}),d(He)!=="svelte-ovc737"&&(He.innerHTML=Go),ao=r(Ke),g(q.$$.fragment,Ke),Ke.forEach(t),ro=r(N),S=i(N,"DIV",{class:!0});var $t=z(S);g(Ne.$$.fragment,$t),so=r($t),Be=i($t,"P",{"data-svelte-h":!0}),d(Be)!=="svelte-15waiuf"&&(Be.innerHTML=Vo),$t.forEach(t),io=r(N),H=i(N,"DIV",{class:!0});var Mt=z(H);g(we.$$.fragment,Mt),lo=r(Mt),Ye=i(Mt,"P",{"data-svelte-h":!0}),d(Ye)!=="svelte-16agjap"&&(Ye.innerHTML=Do),Mt.forEach(t),co=r(N),B=i(N,"DIV",{class:!0});var Ct=z(B);g(ze.$$.fragment,Ct),mo=r(Ct),Oe=i(Ct,"P",{"data-svelte-h":!0}),d(Oe)!=="svelte-1mcciwe"&&(Oe.innerHTML=Ro),Ct.forEach(t),N.forEach(t),xt=r(e),g($e.$$.fragment,e),Nt=r(e),et=i(e,"P",{}),z(et).forEach(t),this.h()},h(){T(c,"name","hf:doc:metadata"),T(c,"content",sn),T(C,"class","flex flex-wrap space-x-1"),Bo(E.src,_o="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/nougat_architecture.jpg")||T(E,"src",_o),T(E,"alt","drawing"),T(E,"width","600"),T(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),T(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){n(document.head,c),l(e,w,o),l(e,m,o),l(e,x,o),f(M,e,o),l(e,y,o),l(e,C,o),l(e,tt,o),f(O,e,o),l(e,ot,o),l(e,X,o),l(e,nt,o),l(e,Q,o),l(e,at,o),l(e,K,o),l(e,rt,o),l(e,E,o),l(e,st,o),l(e,ee,o),l(e,it,o),l(e,te,o),l(e,lt,o),f(oe,e,o),l(e,ct,o),l(e,ne,o),l(e,dt,o),f(ae,e,o),l(e,mt,o),l(e,re,o),l(e,pt,o),l(e,se,o),l(e,gt,o),l(e,ie,o),l(e,ft,o),f(le,e,o),l(e,ut,o),l(e,ce,o),l(e,ht,o),f(W,e,o),l(e,_t,o),f(de,e,o),l(e,bt,o),l(e,U,o),f(me,U,null),n(U,Ut),n(U,Pe),n(U,It),n(U,G),f(pe,G,null),n(G,Ft),n(G,Ue),l(e,kt,o),f(ge,e,o),l(e,vt,o),l(e,b,o),f(fe,b,null),n(b,Jt),n(b,Ie),n(b,jt),n(b,Fe),n(b,Lt),n(b,Je),n(b,At),n(b,je),n(b,Zt),n(b,F),f(ue,F,null),n(F,Et),n(F,Le),n(F,Wt),f(V,F,null),n(b,Gt),n(b,P),f(he,P,null),n(P,Vt),n(P,Ae),n(P,Dt),n(P,Ze),n(P,Rt),n(P,Ee),n(b,qt),n(b,D),f(_e,D,null),n(D,St),n(D,We),n(b,Ht),n(b,J),f(be,J,null),n(J,Bt),n(J,Ge),n(J,Yt),n(J,Ve),l(e,Tt,o),f(ke,e,o),l(e,yt,o),l(e,k,o),f(ve,k,null),n(k,Ot),n(k,De),n(k,Xt),n(k,Re),n(k,Qt),n(k,qe),f(Te,qe,null),n(k,Kt),n(k,j),f(ye,j,null),n(j,eo),n(j,Se),n(j,to),f(R,j,null),n(k,oo),n(k,L),f(xe,L,null),n(L,no),n(L,He),n(L,ao),f(q,L,null),n(k,ro),n(k,S),f(Ne,S,null),n(S,so),n(S,Be),n(k,io),n(k,H),f(we,H,null),n(H,lo),n(H,Ye),n(k,co),n(k,B),f(ze,B,null),n(B,mo),n(B,Oe),l(e,xt,o),f($e,e,o),l(e,Nt,o),l(e,et,o),wt=!0},p(e,[o]){const A={};o&2&&(A.$$scope={dirty:o,ctx:e}),W.$set(A);const Me={};o&2&&(Me.$$scope={dirty:o,ctx:e}),V.$set(Me);const v={};o&2&&(v.$$scope={dirty:o,ctx:e}),R.$set(v);const Z={};o&2&&(Z.$$scope={dirty:o,ctx:e}),q.$set(Z)},i(e){wt||(u(M.$$.fragment,e),u(O.$$.fragment,e),u(oe.$$.fragment,e),u(ae.$$.fragment,e),u(le.$$.fragment,e),u(W.$$.fragment,e),u(de.$$.fragment,e),u(me.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(fe.$$.fragment,e),u(ue.$$.fragment,e),u(V.$$.fragment,e),u(he.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(ke.$$.fragment,e),u(ve.$$.fragment,e),u(Te.$$.fragment,e),u(ye.$$.fragment,e),u(R.$$.fragment,e),u(xe.$$.fragment,e),u(q.$$.fragment,e),u(Ne.$$.fragment,e),u(we.$$.fragment,e),u(ze.$$.fragment,e),u($e.$$.fragment,e),wt=!0)},o(e){h(M.$$.fragment,e),h(O.$$.fragment,e),h(oe.$$.fragment,e),h(ae.$$.fragment,e),h(le.$$.fragment,e),h(W.$$.fragment,e),h(de.$$.fragment,e),h(me.$$.fragment,e),h(pe.$$.fragment,e),h(ge.$$.fragment,e),h(fe.$$.fragment,e),h(ue.$$.fragment,e),h(V.$$.fragment,e),h(he.$$.fragment,e),h(_e.$$.fragment,e),h(be.$$.fragment,e),h(ke.$$.fragment,e),h(ve.$$.fragment,e),h(Te.$$.fragment,e),h(ye.$$.fragment,e),h(R.$$.fragment,e),h(xe.$$.fragment,e),h(q.$$.fragment,e),h(Ne.$$.fragment,e),h(we.$$.fragment,e),h(ze.$$.fragment,e),h($e.$$.fragment,e),wt=!1},d(e){e&&(t(w),t(m),t(x),t(y),t(C),t(tt),t(ot),t(X),t(nt),t(Q),t(at),t(K),t(rt),t(E),t(st),t(ee),t(it),t(te),t(lt),t(ct),t(ne),t(dt),t(mt),t(re),t(pt),t(se),t(gt),t(ie),t(ft),t(ut),t(ce),t(ht),t(_t),t(bt),t(U),t(kt),t(vt),t(b),t(Tt),t(yt),t(k),t(xt),t(Nt),t(et)),t(c),_(M,e),_(O,e),_(oe,e),_(ae,e),_(le,e),_(W,e),_(de,e),_(me),_(pe),_(ge,e),_(fe),_(ue),_(V),_(he),_(_e),_(be),_(ke,e),_(ve),_(Te),_(ye),_(R),_(xe),_(q),_(Ne),_(we),_(ze),_($e,e)}}}const sn='{"title":"Nougat","local":"nougat","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2},{"title":"NougatImageProcessor","local":"transformers.NougatImageProcessor","sections":[],"depth":2},{"title":"NougatTokenizerFast","local":"transformers.NougatTokenizerFast","sections":[],"depth":2},{"title":"NougatProcessor","local":"transformers.NougatProcessor","sections":[],"depth":2}],"depth":1}';function ln(I){return Yo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _n extends Oo{constructor(c){super(),Xo(this,c,ln,rn,Ho,{})}}export{_n as component};
