import{s as rn,f as sn,o as an,n as lt}from"../chunks/scheduler.9bc65507.js";import{S as ln,i as cn,g as l,s as o,r as g,A as dn,h as c,f as n,c as r,j as P,u as f,x as p,k as $,y as a,a as s,v as h,d as u,t as _,w as M}from"../chunks/index.707bf1b6.js";import{T as nn}from"../chunks/Tip.c2ecdbf4.js";import{D as W}from"../chunks/Docstring.17db21ae.js";import{C as Ut}from"../chunks/CodeBlock.54a9f38d.js";import{E as on}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as X}from"../chunks/Heading.342b1fa6.js";function mn(R){let i,v="Example:",m,b,T;return b=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1ncHN0ckNvbmZpZyUyQyUyME1ncHN0ckZvclNjZW5lVGV4dFJlY29nbml0aW9uJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME1ncHN0ciUyMG1ncC1zdHItYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBNZ3BzdHJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbWdwLXN0ci1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNZ3BzdHJGb3JTY2VuZVRleHRSZWNvZ25pdGlvbihjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MgpstrConfig, MgpstrForSceneTextRecognition

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Mgpstr mgp-str-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MgpstrConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the mgp-str-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MgpstrForSceneTextRecognition(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){i=l("p"),i.textContent=v,m=o(),g(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-11lpom8"&&(i.textContent=v),m=r(d),f(b.$$.fragment,d)},m(d,y){s(d,i,y),s(d,m,y),h(b,d,y),T=!0},p:lt,i(d){T||(u(b.$$.fragment,d),T=!0)},o(d){_(b.$$.fragment,d),T=!1},d(d){d&&(n(i),n(m)),M(b,d)}}}function pn(R){let i,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=v},l(m){i=c(m,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(m,b){s(m,i,b)},p:lt,d(m){m&&n(i)}}}function gn(R){let i,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=v},l(m){i=c(m,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(m,b){s(m,i,b)},p:lt,d(m){m&&n(i)}}}function fn(R){let i,v="Example:",m,b,T;return b=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBNZ3BzdHJQcm9jZXNzb3IlMkMlMEElMjAlMjAlMjAlMjBNZ3BzdHJGb3JTY2VuZVRleHRSZWNvZ25pdGlvbiUyQyUwQSklMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQSUyMyUyMGxvYWQlMjBpbWFnZSUyMGZyb20lMjB0aGUlMjBJSUlULTVrJTIwZGF0YXNldCUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaS5wb3N0aW1nLmNjJTJGWkt3TGcyR3clMkYzNjctMTQucG5nJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyME1ncHN0clByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyYWxpYmFiYS1kYW1vJTJGbWdwLXN0ci1iYXNlJTIyKSUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQSUwQW1vZGVsJTIwJTNEJTIwTWdwc3RyRm9yU2NlbmVUZXh0UmVjb2duaXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmFsaWJhYmEtZGFtbyUyRm1ncC1zdHItYmFzZSUyMiklMEElMEElMjMlMjBpbmZlcmVuY2UlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwocGl4ZWxfdmFsdWVzKSUwQW91dF9zdHJzJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShvdXRwdXRzLmxvZ2l0cyklMEFvdXRfc3RycyU1QiUyMmdlbmVyYXRlZF90ZXh0JTIyJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    MgpstrProcessor,
<span class="hljs-meta">... </span>    MgpstrForSceneTextRecognition,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load image from the IIIT-5k dataset</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://i.postimg.cc/ZKwLg2Gw/367-14.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MgpstrProcessor.from_pretrained(<span class="hljs-string">&quot;alibaba-damo/mgp-str-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MgpstrForSceneTextRecognition.from_pretrained(<span class="hljs-string">&quot;alibaba-damo/mgp-str-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values)
<span class="hljs-meta">&gt;&gt;&gt; </span>out_strs = processor.batch_decode(outputs.logits)
<span class="hljs-meta">&gt;&gt;&gt; </span>out_strs[<span class="hljs-string">&quot;generated_text&quot;</span>]
<span class="hljs-string">&#x27;[&quot;ticket&quot;]&#x27;</span>`,wrap:!1}}),{c(){i=l("p"),i.textContent=v,m=o(),g(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-11lpom8"&&(i.textContent=v),m=r(d),f(b.$$.fragment,d)},m(d,y){s(d,i,y),s(d,m,y),h(b,d,y),T=!0},p:lt,i(d){T||(u(b.$$.fragment,d),T=!0)},o(d){_(b.$$.fragment,d),T=!1},d(d){d&&(n(i),n(m)),M(b,d)}}}function hn(R){let i,v,m,b,T,d,y,Ge,E,Jt='The MGP-STR model was proposed in <a href="https://arxiv.org/abs/2209.03592" rel="nofollow">Multi-Granularity Prediction for Scene Text Recognition</a> by Peng Wang, Cheng Da, and Cong Yao. MGP-STR is a conceptually <strong>simple</strong> yet <strong>powerful</strong> vision Scene Text Recognition (STR) model, which is built upon the <a href="vit">Vision Transformer (ViT)</a>. To integrate linguistic knowledge, Multi-Granularity Prediction (MGP) strategy is proposed to inject information from the language modality into the model in an implicit way.',Ve,q,Rt="The abstract from the paper is the following:",He,Y,It="<em>Scene text recognition (STR) has been an active research topic in computer vision for years. To tackle this challenging problem, numerous innovative methods have been successively proposed and incorporating linguistic knowledge into STR models has recently become a prominent trend. In this work, we first draw inspiration from the recent progress in Vision Transformer (ViT) to construct a conceptually simple yet powerful vision STR model, which is built upon ViT and outperforms previous state-of-the-art models for scene text recognition, including both pure vision models and language-augmented methods. To integrate linguistic knowledge, we further propose a Multi-Granularity Prediction strategy to inject information from the language modality into the model in an implicit way, i.e. , subword representations (BPE and WordPiece) widely-used in NLP are introduced into the output space, in addition to the conventional character level representation, while no independent language model (LM) is adopted. The resultant algorithm (termed MGP-STR) is able to push the performance envelop of STR to an even higher level. Specifically, it achieves an average recognition accuracy of 93.35% on standard benchmarks.</em>",Le,G,Zt,Fe,A,Wt='MGP-STR architecture. Taken from the <a href="https://arxiv.org/abs/2209.03592">original paper</a>.',Ne,D,Gt=`MGP-STR is trained on two synthetic datasets <a href="(http://www.robots.ox.ac.uk/~vgg/data/text/)">MJSynth</a> (MJ) and <a href="http://www.robots.ox.ac.uk/~vgg/data/scenetext/" rel="nofollow">SynthText</a> (ST) without fine-tuning on other datasets. It achieves state-of-the-art results on six standard Latin scene text benchmarks, including 3 regular text datasets (IC13, SVT, IIIT) and 3 irregular ones (IC15, SVTP, CUTE).
This model was contributed by <a href="https://huggingface.co/yuekun" rel="nofollow">yuekun</a>. The original code can be found <a href="https://github.com/AlibabaResearch/AdvancedLiterateMachinery/tree/main/OCR/MGP-STR" rel="nofollow">here</a>.`,Be,O,Qe,K,Vt=`<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a> accepts images as input and generates three types of predictions, which represent textual information at different granularities.
The three types of predictions are fused to give the final prediction result.`,Xe,ee,Ht=`The <a href="/docs/transformers/main/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> class is responsible for preprocessing the input image and
<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a> decodes the generated character tokens to the target string. The
<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> wraps <a href="/docs/transformers/main/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>
into a single instance to both extract the input features and decode the predicted token ids.`,Ee,te,Lt="<li>Step-by-step Optical Character Recognition (OCR)</li>",qe,ne,Ye,oe,Ae,x,re,ct,Me,Ft=`This is the configuration class to store the configuration of an <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a>. It is used to instantiate an
MGP-STR model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the MGP-STR
<a href="https://huggingface.co/alibaba-damo/mgp-str-base" rel="nofollow">alibaba-damo/mgp-str-base</a> architecture.`,dt,be,Nt=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,mt,V,De,se,Oe,k,ae,pt,Te,Bt="Construct a MGP-STR char tokenizer.",gt,ve,Qt=`This tokenizer inherits from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,ft,ye,ie,Ke,le,et,w,ce,ht,we,Xt="Constructs a MGP-STR processor which wraps an image processor and MGP-STR tokenizers into a single",ut,$e,Et=`<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> offers all the functionalities of <code>ViTImageProcessor</code>] and <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>. See the
<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor.batch_decode">batch_decode()</a> for more information.`,_t,H,de,Mt,xe,qt=`When used in normal mode, this method forwards all its arguments to ViTImageProcessor’s
<a href="/docs/transformers/main/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__"><strong>call</strong>()</a> and returns its output. This method also forwards the <code>text</code> and <code>kwargs</code>
arguments to MgpstrTokenizer’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"><strong>call</strong>()</a> if <code>text</code> is not <code>None</code> to encode the text. Please
refer to the doctsring of the above methods for more information.`,bt,I,me,Tt,ke,Yt="Convert a list of lists of token ids into a list of strings by calling decode.",vt,je,At=`This method forwards all its arguments to PreTrainedTokenizer’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.`,tt,pe,nt,S,ge,yt,Ce,Dt=`The bare MGP-STR Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,wt,Z,fe,$t,ze,Ot='The <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a> forward method, overrides the <code>__call__</code> special method.',xt,L,ot,he,rt,j,ue,kt,Pe,Kt=`MGP-STR Model transformer with three classification heads on top (three A^3 modules and three linear layer on top
of the transformer encoder output) for scene text recognition (STR) .`,jt,Se,en=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Ct,z,_e,zt,Ue,tn='The <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrForSceneTextRecognition">MgpstrForSceneTextRecognition</a> forward method, overrides the <code>__call__</code> special method.',Pt,F,St,N,st,Ze,at;return T=new X({props:{title:"MGP-STR",local:"mgp-str",headingTag:"h1"}}),y=new X({props:{title:"Overview",local:"overview",headingTag:"h2"}}),O=new X({props:{title:"Inference example",local:"inference-example",headingTag:"h2"}}),ne=new Ut({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1ncHN0clByb2Nlc3NvciUyQyUyME1ncHN0ckZvclNjZW5lVGV4dFJlY29nbml0aW9uJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBNZ3BzdHJQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCdhbGliYWJhLWRhbW8lMkZtZ3Atc3RyLWJhc2UnKSUwQW1vZGVsJTIwJTNEJTIwTWdwc3RyRm9yU2NlbmVUZXh0UmVjb2duaXRpb24uZnJvbV9wcmV0cmFpbmVkKCdhbGliYWJhLWRhbW8lMkZtZ3Atc3RyLWJhc2UnKSUwQSUwQSUyMyUyMGxvYWQlMjBpbWFnZSUyMGZyb20lMjB0aGUlMjBJSUlULTVrJTIwZGF0YXNldCUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaS5wb3N0aW1nLmNjJTJGWkt3TGcyR3clMkYzNjctMTQucG5nJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChwaXhlbF92YWx1ZXMpJTBBJTBBZ2VuZXJhdGVkX3RleHQlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKG91dHB1dHMubG9naXRzKSU1QidnZW5lcmF0ZWRfdGV4dCclNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MgpstrProcessor, MgpstrForSceneTextRecognition
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MgpstrProcessor.from_pretrained(<span class="hljs-string">&#x27;alibaba-damo/mgp-str-base&#x27;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MgpstrForSceneTextRecognition.from_pretrained(<span class="hljs-string">&#x27;alibaba-damo/mgp-str-base&#x27;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load image from the IIIT-5k dataset</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://i.postimg.cc/ZKwLg2Gw/367-14.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = processor.batch_decode(outputs.logits)[<span class="hljs-string">&#x27;generated_text&#x27;</span>]`,wrap:!1}}),oe=new X({props:{title:"MgpstrConfig",local:"transformers.MgpstrConfig",headingTag:"h2"}}),re=new W({props:{name:"class transformers.MgpstrConfig",anchor:"transformers.MgpstrConfig",parameters:[{name:"image_size",val:" = [32, 128]"},{name:"patch_size",val:" = 4"},{name:"num_channels",val:" = 3"},{name:"max_token_length",val:" = 27"},{name:"num_character_labels",val:" = 38"},{name:"num_bpe_labels",val:" = 50257"},{name:"num_wordpiece_labels",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"mlp_ratio",val:" = 4.0"},{name:"qkv_bias",val:" = True"},{name:"distilled",val:" = False"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"drop_rate",val:" = 0.0"},{name:"attn_drop_rate",val:" = 0.0"},{name:"drop_path_rate",val:" = 0.0"},{name:"output_a3_attentions",val:" = False"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MgpstrConfig.image_size",description:`<strong>image_size</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[32, 128]</code>) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.MgpstrConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.MgpstrConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.MgpstrConfig.max_token_length",description:`<strong>max_token_length</strong> (<code>int</code>, <em>optional</em>, defaults to 27) &#x2014;
The max number of output tokens.`,name:"max_token_length"},{anchor:"transformers.MgpstrConfig.num_character_labels",description:`<strong>num_character_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 38) &#x2014;
The number of classes for character head .`,name:"num_character_labels"},{anchor:"transformers.MgpstrConfig.num_bpe_labels",description:`<strong>num_bpe_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 50257) &#x2014;
The number of classes for bpe head .`,name:"num_bpe_labels"},{anchor:"transformers.MgpstrConfig.num_wordpiece_labels",description:`<strong>num_wordpiece_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
The number of classes for wordpiece head .`,name:"num_wordpiece_labels"},{anchor:"transformers.MgpstrConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The embedding dimension.`,name:"hidden_size"},{anchor:"transformers.MgpstrConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.MgpstrConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MgpstrConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
The ratio of mlp hidden dim to embedding dim.`,name:"mlp_ratio"},{anchor:"transformers.MgpstrConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.MgpstrConfig.distilled",description:`<strong>distilled</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Model includes a distillation token and head as in DeiT models.`,name:"distilled"},{anchor:"transformers.MgpstrConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.MgpstrConfig.drop_rate",description:`<strong>drop_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder.`,name:"drop_rate"},{anchor:"transformers.MgpstrConfig.attn_drop_rate",description:`<strong>attn_drop_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attn_drop_rate"},{anchor:"transformers.MgpstrConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The stochastic depth rate.`,name:"drop_path_rate"},{anchor:"transformers.MgpstrConfig.output_a3_attentions",description:`<strong>output_a3_attentions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should returns A^3 module attentions.`,name:"output_a3_attentions"},{anchor:"transformers.MgpstrConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/configuration_mgp_str.py#L27"}}),V=new on({props:{anchor:"transformers.MgpstrConfig.example",$$slots:{default:[mn]},$$scope:{ctx:R}}}),se=new X({props:{title:"MgpstrTokenizer",local:"transformers.MgpstrTokenizer",headingTag:"h2"}}),ae=new W({props:{name:"class transformers.MgpstrTokenizer",anchor:"transformers.MgpstrTokenizer",parameters:[{name:"vocab_file",val:""},{name:"unk_token",val:" = '[GO]'"},{name:"bos_token",val:" = '[GO]'"},{name:"eos_token",val:" = '[s]'"},{name:"pad_token",val:" = '[GO]'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MgpstrTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.MgpstrTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[GO]&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.MgpstrTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[GO]&quot;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.MgpstrTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[s]&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.MgpstrTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;[GO]&quot;</code>) &#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.`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/tokenization_mgp_str.py#L30"}}),ie=new W({props:{name:"save_vocabulary",anchor:"transformers.MgpstrTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/tokenization_mgp_str.py#L90"}}),le=new X({props:{title:"MgpstrProcessor",local:"transformers.MgpstrProcessor",headingTag:"h2"}}),ce=new W({props:{name:"class transformers.MgpstrProcessor",anchor:"transformers.MgpstrProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MgpstrProcessor.image_processor",description:`<strong>image_processor</strong> (<code>ViTImageProcessor</code>, <em>optional</em>) &#x2014;
An instance of <code>ViTImageProcessor</code>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.MgpstrProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/processing_mgp_str.py#L39"}}),de=new W({props:{name:"__call__",anchor:"transformers.MgpstrProcessor.__call__",parameters:[{name:"text",val:" = None"},{name:"images",val:" = None"},{name:"return_tensors",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/processing_mgp_str.py#L79"}}),me=new W({props:{name:"batch_decode",anchor:"transformers.MgpstrProcessor.batch_decode",parameters:[{name:"sequences",val:""}],parametersDescription:[{anchor:"transformers.MgpstrProcessor.batch_decode.sequences",description:`<strong>sequences</strong> (<code>torch.Tensor</code>) &#x2014;
List of tokenized input ids.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/processing_mgp_str.py#L102",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Dictionary of all the outputs of the decoded results.
generated_text (<code>List[str]</code>): The final results after fusion of char, bpe, and wp. scores
(<code>List[float]</code>): The final scores after fusion of char, bpe, and wp. char_preds (<code>List[str]</code>): The list
of character decoded sentences. bpe_preds (<code>List[str]</code>): The list of bpe decoded sentences. wp_preds
(<code>List[str]</code>): The list of wp decoded sentences.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Dict[str, any]</code></p>
`}}),pe=new X({props:{title:"MgpstrModel",local:"transformers.MgpstrModel",headingTag:"h2"}}),ge=new W({props:{name:"class transformers.MgpstrModel",anchor:"transformers.MgpstrModel",parameters:[{name:"config",val:": MgpstrConfig"}],parametersDescription:[{anchor:"transformers.MgpstrModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrConfig">MgpstrConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L363"}}),fe=new W({props:{name:"forward",anchor:"transformers.MgpstrModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.MgpstrModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.MgpstrModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MgpstrModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MgpstrModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L377"}}),L=new nn({props:{$$slots:{default:[pn]},$$scope:{ctx:R}}}),he=new X({props:{title:"MgpstrForSceneTextRecognition",local:"transformers.MgpstrForSceneTextRecognition",headingTag:"h2"}}),ue=new W({props:{name:"class transformers.MgpstrForSceneTextRecognition",anchor:"transformers.MgpstrForSceneTextRecognition",parameters:[{name:"config",val:": MgpstrConfig"}],parametersDescription:[{anchor:"transformers.MgpstrForSceneTextRecognition.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrConfig">MgpstrConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L412"}}),_e=new W({props:{name:"forward",anchor:"transformers.MgpstrForSceneTextRecognition.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": Optional = None"},{name:"output_a3_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.MgpstrForSceneTextRecognition.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/fuyu#transformers.FuyuImageProcessor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.MgpstrForSceneTextRecognition.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MgpstrForSceneTextRecognition.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.MgpstrForSceneTextRecognition.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MgpstrForSceneTextRecognition.forward.output_a3_attentions",description:`<strong>output_a3_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of a3 modules. See <code>a3_attentions</code> under returned tensors
for more detail.`,name:"output_a3_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L437",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.mgp_str.modeling_mgp_str.MgpstrModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mgp_str.configuration_mgp_str.MgpstrConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>tuple(torch.FloatTensor)</code> of shape <code>(batch_size, config.num_character_labels)</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of character of shape <code>(batch_size, config.max_token_length, config.num_character_labels)</code>, + one for the output of bpe of shape <code>(batch_size, config.max_token_length, config.num_bpe_labels)</code>, + one for the output of wordpiece of shape <code>(batch_size, config.max_token_length, config.num_wordpiece_labels)</code>) .</p>
<p>Classification scores (before SoftMax) of character, bpe and wordpiece.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, config.max_token_length, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>a3_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_a3_attentions=True</code> is passed or when <code>config.output_a3_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the attention of character, + one for the attention of bpe<code>, + one for the attention of wordpiece) of shape </code>(batch_size, config.max_token_length, sequence_length)\`.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.mgp_str.modeling_mgp_str.MgpstrModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),F=new nn({props:{$$slots:{default:[gn]},$$scope:{ctx:R}}}),N=new on({props:{anchor:"transformers.MgpstrForSceneTextRecognition.forward.example",$$slots:{default:[fn]},$$scope:{ctx:R}}}),{c(){i=l("meta"),v=o(),m=l("p"),b=o(),g(T.$$.fragment),d=o(),g(y.$$.fragment),Ge=o(),E=l("p"),E.innerHTML=Jt,Ve=o(),q=l("p"),q.textContent=Rt,He=o(),Y=l("p"),Y.innerHTML=It,Le=o(),G=l("img"),Fe=o(),A=l("small"),A.innerHTML=Wt,Ne=o(),D=l("p"),D.innerHTML=Gt,Be=o(),g(O.$$.fragment),Qe=o(),K=l("p"),K.innerHTML=Vt,Xe=o(),ee=l("p"),ee.innerHTML=Ht,Ee=o(),te=l("ul"),te.innerHTML=Lt,qe=o(),g(ne.$$.fragment),Ye=o(),g(oe.$$.fragment),Ae=o(),x=l("div"),g(re.$$.fragment),ct=o(),Me=l("p"),Me.innerHTML=Ft,dt=o(),be=l("p"),be.innerHTML=Nt,mt=o(),g(V.$$.fragment),De=o(),g(se.$$.fragment),Oe=o(),k=l("div"),g(ae.$$.fragment),pt=o(),Te=l("p"),Te.textContent=Bt,gt=o(),ve=l("p"),ve.innerHTML=Qt,ft=o(),ye=l("div"),g(ie.$$.fragment),Ke=o(),g(le.$$.fragment),et=o(),w=l("div"),g(ce.$$.fragment),ht=o(),we=l("p"),we.textContent=Xt,ut=o(),$e=l("p"),$e.innerHTML=Et,_t=o(),H=l("div"),g(de.$$.fragment),Mt=o(),xe=l("p"),xe.innerHTML=qt,bt=o(),I=l("div"),g(me.$$.fragment),Tt=o(),ke=l("p"),ke.textContent=Yt,vt=o(),je=l("p"),je.innerHTML=At,tt=o(),g(pe.$$.fragment),nt=o(),S=l("div"),g(ge.$$.fragment),yt=o(),Ce=l("p"),Ce.innerHTML=Dt,wt=o(),Z=l("div"),g(fe.$$.fragment),$t=o(),ze=l("p"),ze.innerHTML=Ot,xt=o(),g(L.$$.fragment),ot=o(),g(he.$$.fragment),rt=o(),j=l("div"),g(ue.$$.fragment),kt=o(),Pe=l("p"),Pe.textContent=Kt,jt=o(),Se=l("p"),Se.innerHTML=en,Ct=o(),z=l("div"),g(_e.$$.fragment),zt=o(),Ue=l("p"),Ue.innerHTML=tn,Pt=o(),g(F.$$.fragment),St=o(),g(N.$$.fragment),st=o(),Ze=l("p"),this.h()},l(e){const t=dn("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(n),v=r(e),m=c(e,"P",{}),P(m).forEach(n),b=r(e),f(T.$$.fragment,e),d=r(e),f(y.$$.fragment,e),Ge=r(e),E=c(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-1ojswm7"&&(E.innerHTML=Jt),Ve=r(e),q=c(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-vfdo9a"&&(q.textContent=Rt),He=r(e),Y=c(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-1h9gawp"&&(Y.innerHTML=It),Le=r(e),G=c(e,"IMG",{src:!0,alt:!0,width:!0}),Fe=r(e),A=c(e,"SMALL",{"data-svelte-h":!0}),p(A)!=="svelte-13av33i"&&(A.innerHTML=Wt),Ne=r(e),D=c(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-codc7u"&&(D.innerHTML=Gt),Be=r(e),f(O.$$.fragment,e),Qe=r(e),K=c(e,"P",{"data-svelte-h":!0}),p(K)!=="svelte-v5kn8o"&&(K.innerHTML=Vt),Xe=r(e),ee=c(e,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-xkotox"&&(ee.innerHTML=Ht),Ee=r(e),te=c(e,"UL",{"data-svelte-h":!0}),p(te)!=="svelte-1noonjl"&&(te.innerHTML=Lt),qe=r(e),f(ne.$$.fragment,e),Ye=r(e),f(oe.$$.fragment,e),Ae=r(e),x=c(e,"DIV",{class:!0});var U=P(x);f(re.$$.fragment,U),ct=r(U),Me=c(U,"P",{"data-svelte-h":!0}),p(Me)!=="svelte-1tz4a1x"&&(Me.innerHTML=Ft),dt=r(U),be=c(U,"P",{"data-svelte-h":!0}),p(be)!=="svelte-o55m63"&&(be.innerHTML=Nt),mt=r(U),f(V.$$.fragment,U),U.forEach(n),De=r(e),f(se.$$.fragment,e),Oe=r(e),k=c(e,"DIV",{class:!0});var J=P(k);f(ae.$$.fragment,J),pt=r(J),Te=c(J,"P",{"data-svelte-h":!0}),p(Te)!=="svelte-17nyefl"&&(Te.textContent=Bt),gt=r(J),ve=c(J,"P",{"data-svelte-h":!0}),p(ve)!=="svelte-1c3t5ty"&&(ve.innerHTML=Qt),ft=r(J),ye=c(J,"DIV",{class:!0});var We=P(ye);f(ie.$$.fragment,We),We.forEach(n),J.forEach(n),Ke=r(e),f(le.$$.fragment,e),et=r(e),w=c(e,"DIV",{class:!0});var C=P(w);f(ce.$$.fragment,C),ht=r(C),we=c(C,"P",{"data-svelte-h":!0}),p(we)!=="svelte-yv8e6v"&&(we.textContent=Xt),ut=r(C),$e=c(C,"P",{"data-svelte-h":!0}),p($e)!=="svelte-21m5ls"&&($e.innerHTML=Et),_t=r(C),H=c(C,"DIV",{class:!0});var it=P(H);f(de.$$.fragment,it),Mt=r(it),xe=c(it,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-851pkc"&&(xe.innerHTML=qt),it.forEach(n),bt=r(C),I=c(C,"DIV",{class:!0});var Je=P(I);f(me.$$.fragment,Je),Tt=r(Je),ke=c(Je,"P",{"data-svelte-h":!0}),p(ke)!=="svelte-1deng2j"&&(ke.textContent=Yt),vt=r(Je),je=c(Je,"P",{"data-svelte-h":!0}),p(je)!=="svelte-oplyi9"&&(je.innerHTML=At),Je.forEach(n),C.forEach(n),tt=r(e),f(pe.$$.fragment,e),nt=r(e),S=c(e,"DIV",{class:!0});var Re=P(S);f(ge.$$.fragment,Re),yt=r(Re),Ce=c(Re,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-1j8rfbn"&&(Ce.innerHTML=Dt),wt=r(Re),Z=c(Re,"DIV",{class:!0});var Ie=P(Z);f(fe.$$.fragment,Ie),$t=r(Ie),ze=c(Ie,"P",{"data-svelte-h":!0}),p(ze)!=="svelte-hakjn5"&&(ze.innerHTML=Ot),xt=r(Ie),f(L.$$.fragment,Ie),Ie.forEach(n),Re.forEach(n),ot=r(e),f(he.$$.fragment,e),rt=r(e),j=c(e,"DIV",{class:!0});var B=P(j);f(ue.$$.fragment,B),kt=r(B),Pe=c(B,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-10o23m7"&&(Pe.textContent=Kt),jt=r(B),Se=c(B,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-1gjh92c"&&(Se.innerHTML=en),Ct=r(B),z=c(B,"DIV",{class:!0});var Q=P(z);f(_e.$$.fragment,Q),zt=r(Q),Ue=c(Q,"P",{"data-svelte-h":!0}),p(Ue)!=="svelte-6aw6t5"&&(Ue.innerHTML=tn),Pt=r(Q),f(F.$$.fragment,Q),St=r(Q),f(N.$$.fragment,Q),Q.forEach(n),B.forEach(n),st=r(e),Ze=c(e,"P",{}),P(Ze).forEach(n),this.h()},h(){$(i,"name","hf:doc:metadata"),$(i,"content",un),sn(G.src,Zt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/mgp_str_architecture.png")||$(G,"src",Zt),$(G,"alt","drawing"),$(G,"width","600"),$(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(j,"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,t){a(document.head,i),s(e,v,t),s(e,m,t),s(e,b,t),h(T,e,t),s(e,d,t),h(y,e,t),s(e,Ge,t),s(e,E,t),s(e,Ve,t),s(e,q,t),s(e,He,t),s(e,Y,t),s(e,Le,t),s(e,G,t),s(e,Fe,t),s(e,A,t),s(e,Ne,t),s(e,D,t),s(e,Be,t),h(O,e,t),s(e,Qe,t),s(e,K,t),s(e,Xe,t),s(e,ee,t),s(e,Ee,t),s(e,te,t),s(e,qe,t),h(ne,e,t),s(e,Ye,t),h(oe,e,t),s(e,Ae,t),s(e,x,t),h(re,x,null),a(x,ct),a(x,Me),a(x,dt),a(x,be),a(x,mt),h(V,x,null),s(e,De,t),h(se,e,t),s(e,Oe,t),s(e,k,t),h(ae,k,null),a(k,pt),a(k,Te),a(k,gt),a(k,ve),a(k,ft),a(k,ye),h(ie,ye,null),s(e,Ke,t),h(le,e,t),s(e,et,t),s(e,w,t),h(ce,w,null),a(w,ht),a(w,we),a(w,ut),a(w,$e),a(w,_t),a(w,H),h(de,H,null),a(H,Mt),a(H,xe),a(w,bt),a(w,I),h(me,I,null),a(I,Tt),a(I,ke),a(I,vt),a(I,je),s(e,tt,t),h(pe,e,t),s(e,nt,t),s(e,S,t),h(ge,S,null),a(S,yt),a(S,Ce),a(S,wt),a(S,Z),h(fe,Z,null),a(Z,$t),a(Z,ze),a(Z,xt),h(L,Z,null),s(e,ot,t),h(he,e,t),s(e,rt,t),s(e,j,t),h(ue,j,null),a(j,kt),a(j,Pe),a(j,jt),a(j,Se),a(j,Ct),a(j,z),h(_e,z,null),a(z,zt),a(z,Ue),a(z,Pt),h(F,z,null),a(z,St),h(N,z,null),s(e,st,t),s(e,Ze,t),at=!0},p(e,[t]){const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),V.$set(U);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),L.$set(J);const We={};t&2&&(We.$$scope={dirty:t,ctx:e}),F.$set(We);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),N.$set(C)},i(e){at||(u(T.$$.fragment,e),u(y.$$.fragment,e),u(O.$$.fragment,e),u(ne.$$.fragment,e),u(oe.$$.fragment,e),u(re.$$.fragment,e),u(V.$$.fragment,e),u(se.$$.fragment,e),u(ae.$$.fragment,e),u(ie.$$.fragment,e),u(le.$$.fragment,e),u(ce.$$.fragment,e),u(de.$$.fragment,e),u(me.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(fe.$$.fragment,e),u(L.$$.fragment,e),u(he.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(F.$$.fragment,e),u(N.$$.fragment,e),at=!0)},o(e){_(T.$$.fragment,e),_(y.$$.fragment,e),_(O.$$.fragment,e),_(ne.$$.fragment,e),_(oe.$$.fragment,e),_(re.$$.fragment,e),_(V.$$.fragment,e),_(se.$$.fragment,e),_(ae.$$.fragment,e),_(ie.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(de.$$.fragment,e),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(ge.$$.fragment,e),_(fe.$$.fragment,e),_(L.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(F.$$.fragment,e),_(N.$$.fragment,e),at=!1},d(e){e&&(n(v),n(m),n(b),n(d),n(Ge),n(E),n(Ve),n(q),n(He),n(Y),n(Le),n(G),n(Fe),n(A),n(Ne),n(D),n(Be),n(Qe),n(K),n(Xe),n(ee),n(Ee),n(te),n(qe),n(Ye),n(Ae),n(x),n(De),n(Oe),n(k),n(Ke),n(et),n(w),n(tt),n(nt),n(S),n(ot),n(rt),n(j),n(st),n(Ze)),n(i),M(T,e),M(y,e),M(O,e),M(ne,e),M(oe,e),M(re),M(V),M(se,e),M(ae),M(ie),M(le,e),M(ce),M(de),M(me),M(pe,e),M(ge),M(fe),M(L),M(he,e),M(ue),M(_e),M(F),M(N)}}}const un='{"title":"MGP-STR","local":"mgp-str","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Inference example","local":"inference-example","sections":[],"depth":2},{"title":"MgpstrConfig","local":"transformers.MgpstrConfig","sections":[],"depth":2},{"title":"MgpstrTokenizer","local":"transformers.MgpstrTokenizer","sections":[],"depth":2},{"title":"MgpstrProcessor","local":"transformers.MgpstrProcessor","sections":[],"depth":2},{"title":"MgpstrModel","local":"transformers.MgpstrModel","sections":[],"depth":2},{"title":"MgpstrForSceneTextRecognition","local":"transformers.MgpstrForSceneTextRecognition","sections":[],"depth":2}],"depth":1}';function _n(R){return an(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xn extends ln{constructor(i){super(),cn(this,i,_n,hn,rn,{})}}export{xn as component};
