import{s as an,f as ln,o as cn,n as mt}from"../chunks/scheduler.25b97de1.js";import{S as mn,i as dn,g as l,s as o,r as p,A as pn,h as c,f as n,c as r,j as P,u as g,x as M,k as $,y as a,a as s,v as f,d as h,t as u,w as _}from"../chunks/index.d9030fc9.js";import{T as rn}from"../chunks/Tip.baa67368.js";import{D as G}from"../chunks/Docstring.ffac8efa.js";import{C as Rt}from"../chunks/CodeBlock.e6cd0d95.js";import{E as sn}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as Q,E as gn}from"../chunks/EditOnGithub.91d95064.js";function fn(R){let i,v="Example:",d,b,T;return b=new Rt({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,d=o(),p(b.$$.fragment)},l(m){i=c(m,"P",{"data-svelte-h":!0}),M(i)!=="svelte-11lpom8"&&(i.textContent=v),d=r(m),g(b.$$.fragment,m)},m(m,y){s(m,i,y),s(m,d,y),f(b,m,y),T=!0},p:mt,i(m){T||(h(b.$$.fragment,m),T=!0)},o(m){u(b.$$.fragment,m),T=!1},d(m){m&&(n(i),n(d)),_(b,m)}}}function hn(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(d){i=c(d,"P",{"data-svelte-h":!0}),M(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(d,b){s(d,i,b)},p:mt,d(d){d&&n(i)}}}function un(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(d){i=c(d,"P",{"data-svelte-h":!0}),M(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(d,b){s(d,i,b)},p:mt,d(d){d&&n(i)}}}function _n(R){let i,v="Example:",d,b,T;return b=new Rt({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,d=o(),p(b.$$.fragment)},l(m){i=c(m,"P",{"data-svelte-h":!0}),M(i)!=="svelte-11lpom8"&&(i.textContent=v),d=r(m),g(b.$$.fragment,m)},m(m,y){s(m,i,y),s(m,d,y),f(b,m,y),T=!0},p:mt,i(m){T||(h(b.$$.fragment,m),T=!0)},o(m){u(b.$$.fragment,m),T=!1},d(m){m&&(n(i),n(d)),_(b,m)}}}function Mn(R){let i,v,d,b,T,m,y,Ve,X,It='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.',He,q,Zt="The abstract from the paper is the following:",Le,Y,Gt="<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>",Fe,W,Wt,Ne,A,Vt='MGP-STR architecture. Taken from the <a href="https://arxiv.org/abs/2209.03592">original paper</a>.',Be,D,Ht=`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>.`,Ee,O,Qe,K,Lt=`<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,Ft=`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.`,qe,te,Nt="<li>Step-by-step Optical Character Recognition (OCR)</li>",Ye,ne,Ae,oe,De,x,re,dt,be,Bt=`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.`,pt,Te,Et=`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.`,gt,V,Oe,se,Ke,k,ae,ft,ve,Qt="Construct a MGP-STR char tokenizer.",ht,ye,Xt=`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.`,ut,we,ie,et,le,tt,w,ce,_t,$e,qt="Constructs a MGP-STR processor which wraps an image processor and MGP-STR tokenizers into a single",Mt,xe,Yt=`<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.`,bt,H,me,Tt,ke,At=`When used in normal mode, this method forwards all its arguments to ViTImageProcessor’s
<a href="/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__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.`,vt,I,de,yt,je,Dt="Convert a list of lists of token ids into a list of strings by calling decode.",wt,Ce,Ot=`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.`,nt,pe,ot,S,ge,$t,ze,Kt=`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.`,xt,Z,fe,kt,Pe,en='The <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a> forward method, overrides the <code>__call__</code> special method.',jt,L,rt,he,st,j,ue,Ct,Se,tn=`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) .`,zt,Ue,nn=`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.`,Pt,z,_e,St,Je,on='The <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrForSceneTextRecognition">MgpstrForSceneTextRecognition</a> forward method, overrides the <code>__call__</code> special method.',Ut,F,Jt,N,at,Me,it,Ge,lt;return T=new Q({props:{title:"MGP-STR",local:"mgp-str",headingTag:"h1"}}),y=new Q({props:{title:"Overview",local:"overview",headingTag:"h2"}}),O=new Q({props:{title:"Inference example",local:"inference-example",headingTag:"h2"}}),ne=new Rt({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 Q({props:{title:"MgpstrConfig",local:"transformers.MgpstrConfig",headingTag:"h2"}}),re=new G({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#L24"}}),V=new sn({props:{anchor:"transformers.MgpstrConfig.example",$$slots:{default:[fn]},$$scope:{ctx:R}}}),se=new Q({props:{title:"MgpstrTokenizer",local:"transformers.MgpstrTokenizer",headingTag:"h2"}}),ae=new G({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 G({props:{name:"save_vocabulary",anchor:"transformers.MgpstrTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/tokenization_mgp_str.py#L90"}}),le=new Q({props:{title:"MgpstrProcessor",local:"transformers.MgpstrProcessor",headingTag:"h2"}}),ce=new G({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"}}),me=new G({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"}}),de=new G({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 Q({props:{title:"MgpstrModel",local:"transformers.MgpstrModel",headingTag:"h2"}}),ge=new G({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#L360"}}),fe=new G({props:{name:"forward",anchor:"transformers.MgpstrModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.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/imagegpt#transformers.ImageGPTFeatureExtractor.__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#L374"}}),L=new rn({props:{$$slots:{default:[hn]},$$scope:{ctx:R}}}),he=new Q({props:{title:"MgpstrForSceneTextRecognition",local:"transformers.MgpstrForSceneTextRecognition",headingTag:"h2"}}),ue=new G({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#L409"}}),_e=new G({props:{name:"forward",anchor:"transformers.MgpstrForSceneTextRecognition.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_a3_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.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/imagegpt#transformers.ImageGPTFeatureExtractor.__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#L434",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 rn({props:{$$slots:{default:[un]},$$scope:{ctx:R}}}),N=new sn({props:{anchor:"transformers.MgpstrForSceneTextRecognition.forward.example",$$slots:{default:[_n]},$$scope:{ctx:R}}}),Me=new gn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/mgp-str.md"}}),{c(){i=l("meta"),v=o(),d=l("p"),b=o(),p(T.$$.fragment),m=o(),p(y.$$.fragment),Ve=o(),X=l("p"),X.innerHTML=It,He=o(),q=l("p"),q.textContent=Zt,Le=o(),Y=l("p"),Y.innerHTML=Gt,Fe=o(),W=l("img"),Ne=o(),A=l("small"),A.innerHTML=Vt,Be=o(),D=l("p"),D.innerHTML=Ht,Ee=o(),p(O.$$.fragment),Qe=o(),K=l("p"),K.innerHTML=Lt,Xe=o(),ee=l("p"),ee.innerHTML=Ft,qe=o(),te=l("ul"),te.innerHTML=Nt,Ye=o(),p(ne.$$.fragment),Ae=o(),p(oe.$$.fragment),De=o(),x=l("div"),p(re.$$.fragment),dt=o(),be=l("p"),be.innerHTML=Bt,pt=o(),Te=l("p"),Te.innerHTML=Et,gt=o(),p(V.$$.fragment),Oe=o(),p(se.$$.fragment),Ke=o(),k=l("div"),p(ae.$$.fragment),ft=o(),ve=l("p"),ve.textContent=Qt,ht=o(),ye=l("p"),ye.innerHTML=Xt,ut=o(),we=l("div"),p(ie.$$.fragment),et=o(),p(le.$$.fragment),tt=o(),w=l("div"),p(ce.$$.fragment),_t=o(),$e=l("p"),$e.textContent=qt,Mt=o(),xe=l("p"),xe.innerHTML=Yt,bt=o(),H=l("div"),p(me.$$.fragment),Tt=o(),ke=l("p"),ke.innerHTML=At,vt=o(),I=l("div"),p(de.$$.fragment),yt=o(),je=l("p"),je.textContent=Dt,wt=o(),Ce=l("p"),Ce.innerHTML=Ot,nt=o(),p(pe.$$.fragment),ot=o(),S=l("div"),p(ge.$$.fragment),$t=o(),ze=l("p"),ze.innerHTML=Kt,xt=o(),Z=l("div"),p(fe.$$.fragment),kt=o(),Pe=l("p"),Pe.innerHTML=en,jt=o(),p(L.$$.fragment),rt=o(),p(he.$$.fragment),st=o(),j=l("div"),p(ue.$$.fragment),Ct=o(),Se=l("p"),Se.textContent=tn,zt=o(),Ue=l("p"),Ue.innerHTML=nn,Pt=o(),z=l("div"),p(_e.$$.fragment),St=o(),Je=l("p"),Je.innerHTML=on,Ut=o(),p(F.$$.fragment),Jt=o(),p(N.$$.fragment),at=o(),p(Me.$$.fragment),it=o(),Ge=l("p"),this.h()},l(e){const t=pn("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(n),v=r(e),d=c(e,"P",{}),P(d).forEach(n),b=r(e),g(T.$$.fragment,e),m=r(e),g(y.$$.fragment,e),Ve=r(e),X=c(e,"P",{"data-svelte-h":!0}),M(X)!=="svelte-1ojswm7"&&(X.innerHTML=It),He=r(e),q=c(e,"P",{"data-svelte-h":!0}),M(q)!=="svelte-vfdo9a"&&(q.textContent=Zt),Le=r(e),Y=c(e,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-1h9gawp"&&(Y.innerHTML=Gt),Fe=r(e),W=c(e,"IMG",{src:!0,alt:!0,width:!0}),Ne=r(e),A=c(e,"SMALL",{"data-svelte-h":!0}),M(A)!=="svelte-13av33i"&&(A.innerHTML=Vt),Be=r(e),D=c(e,"P",{"data-svelte-h":!0}),M(D)!=="svelte-codc7u"&&(D.innerHTML=Ht),Ee=r(e),g(O.$$.fragment,e),Qe=r(e),K=c(e,"P",{"data-svelte-h":!0}),M(K)!=="svelte-v5kn8o"&&(K.innerHTML=Lt),Xe=r(e),ee=c(e,"P",{"data-svelte-h":!0}),M(ee)!=="svelte-xkotox"&&(ee.innerHTML=Ft),qe=r(e),te=c(e,"UL",{"data-svelte-h":!0}),M(te)!=="svelte-1noonjl"&&(te.innerHTML=Nt),Ye=r(e),g(ne.$$.fragment,e),Ae=r(e),g(oe.$$.fragment,e),De=r(e),x=c(e,"DIV",{class:!0});var U=P(x);g(re.$$.fragment,U),dt=r(U),be=c(U,"P",{"data-svelte-h":!0}),M(be)!=="svelte-1tz4a1x"&&(be.innerHTML=Bt),pt=r(U),Te=c(U,"P",{"data-svelte-h":!0}),M(Te)!=="svelte-o55m63"&&(Te.innerHTML=Et),gt=r(U),g(V.$$.fragment,U),U.forEach(n),Oe=r(e),g(se.$$.fragment,e),Ke=r(e),k=c(e,"DIV",{class:!0});var J=P(k);g(ae.$$.fragment,J),ft=r(J),ve=c(J,"P",{"data-svelte-h":!0}),M(ve)!=="svelte-17nyefl"&&(ve.textContent=Qt),ht=r(J),ye=c(J,"P",{"data-svelte-h":!0}),M(ye)!=="svelte-1c3t5ty"&&(ye.innerHTML=Xt),ut=r(J),we=c(J,"DIV",{class:!0});var We=P(we);g(ie.$$.fragment,We),We.forEach(n),J.forEach(n),et=r(e),g(le.$$.fragment,e),tt=r(e),w=c(e,"DIV",{class:!0});var C=P(w);g(ce.$$.fragment,C),_t=r(C),$e=c(C,"P",{"data-svelte-h":!0}),M($e)!=="svelte-yv8e6v"&&($e.textContent=qt),Mt=r(C),xe=c(C,"P",{"data-svelte-h":!0}),M(xe)!=="svelte-21m5ls"&&(xe.innerHTML=Yt),bt=r(C),H=c(C,"DIV",{class:!0});var ct=P(H);g(me.$$.fragment,ct),Tt=r(ct),ke=c(ct,"P",{"data-svelte-h":!0}),M(ke)!=="svelte-qaoo9z"&&(ke.innerHTML=At),ct.forEach(n),vt=r(C),I=c(C,"DIV",{class:!0});var Re=P(I);g(de.$$.fragment,Re),yt=r(Re),je=c(Re,"P",{"data-svelte-h":!0}),M(je)!=="svelte-1deng2j"&&(je.textContent=Dt),wt=r(Re),Ce=c(Re,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-oplyi9"&&(Ce.innerHTML=Ot),Re.forEach(n),C.forEach(n),nt=r(e),g(pe.$$.fragment,e),ot=r(e),S=c(e,"DIV",{class:!0});var Ie=P(S);g(ge.$$.fragment,Ie),$t=r(Ie),ze=c(Ie,"P",{"data-svelte-h":!0}),M(ze)!=="svelte-1j8rfbn"&&(ze.innerHTML=Kt),xt=r(Ie),Z=c(Ie,"DIV",{class:!0});var Ze=P(Z);g(fe.$$.fragment,Ze),kt=r(Ze),Pe=c(Ze,"P",{"data-svelte-h":!0}),M(Pe)!=="svelte-hakjn5"&&(Pe.innerHTML=en),jt=r(Ze),g(L.$$.fragment,Ze),Ze.forEach(n),Ie.forEach(n),rt=r(e),g(he.$$.fragment,e),st=r(e),j=c(e,"DIV",{class:!0});var B=P(j);g(ue.$$.fragment,B),Ct=r(B),Se=c(B,"P",{"data-svelte-h":!0}),M(Se)!=="svelte-10o23m7"&&(Se.textContent=tn),zt=r(B),Ue=c(B,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-1gjh92c"&&(Ue.innerHTML=nn),Pt=r(B),z=c(B,"DIV",{class:!0});var E=P(z);g(_e.$$.fragment,E),St=r(E),Je=c(E,"P",{"data-svelte-h":!0}),M(Je)!=="svelte-6aw6t5"&&(Je.innerHTML=on),Ut=r(E),g(F.$$.fragment,E),Jt=r(E),g(N.$$.fragment,E),E.forEach(n),B.forEach(n),at=r(e),g(Me.$$.fragment,e),it=r(e),Ge=c(e,"P",{}),P(Ge).forEach(n),this.h()},h(){$(i,"name","hf:doc:metadata"),$(i,"content",bn),ln(W.src,Wt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/mgp_str_architecture.png")||$(W,"src",Wt),$(W,"alt","drawing"),$(W,"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"),$(we,"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,d,t),s(e,b,t),f(T,e,t),s(e,m,t),f(y,e,t),s(e,Ve,t),s(e,X,t),s(e,He,t),s(e,q,t),s(e,Le,t),s(e,Y,t),s(e,Fe,t),s(e,W,t),s(e,Ne,t),s(e,A,t),s(e,Be,t),s(e,D,t),s(e,Ee,t),f(O,e,t),s(e,Qe,t),s(e,K,t),s(e,Xe,t),s(e,ee,t),s(e,qe,t),s(e,te,t),s(e,Ye,t),f(ne,e,t),s(e,Ae,t),f(oe,e,t),s(e,De,t),s(e,x,t),f(re,x,null),a(x,dt),a(x,be),a(x,pt),a(x,Te),a(x,gt),f(V,x,null),s(e,Oe,t),f(se,e,t),s(e,Ke,t),s(e,k,t),f(ae,k,null),a(k,ft),a(k,ve),a(k,ht),a(k,ye),a(k,ut),a(k,we),f(ie,we,null),s(e,et,t),f(le,e,t),s(e,tt,t),s(e,w,t),f(ce,w,null),a(w,_t),a(w,$e),a(w,Mt),a(w,xe),a(w,bt),a(w,H),f(me,H,null),a(H,Tt),a(H,ke),a(w,vt),a(w,I),f(de,I,null),a(I,yt),a(I,je),a(I,wt),a(I,Ce),s(e,nt,t),f(pe,e,t),s(e,ot,t),s(e,S,t),f(ge,S,null),a(S,$t),a(S,ze),a(S,xt),a(S,Z),f(fe,Z,null),a(Z,kt),a(Z,Pe),a(Z,jt),f(L,Z,null),s(e,rt,t),f(he,e,t),s(e,st,t),s(e,j,t),f(ue,j,null),a(j,Ct),a(j,Se),a(j,zt),a(j,Ue),a(j,Pt),a(j,z),f(_e,z,null),a(z,St),a(z,Je),a(z,Ut),f(F,z,null),a(z,Jt),f(N,z,null),s(e,at,t),f(Me,e,t),s(e,it,t),s(e,Ge,t),lt=!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){lt||(h(T.$$.fragment,e),h(y.$$.fragment,e),h(O.$$.fragment,e),h(ne.$$.fragment,e),h(oe.$$.fragment,e),h(re.$$.fragment,e),h(V.$$.fragment,e),h(se.$$.fragment,e),h(ae.$$.fragment,e),h(ie.$$.fragment,e),h(le.$$.fragment,e),h(ce.$$.fragment,e),h(me.$$.fragment,e),h(de.$$.fragment,e),h(pe.$$.fragment,e),h(ge.$$.fragment,e),h(fe.$$.fragment,e),h(L.$$.fragment,e),h(he.$$.fragment,e),h(ue.$$.fragment,e),h(_e.$$.fragment,e),h(F.$$.fragment,e),h(N.$$.fragment,e),h(Me.$$.fragment,e),lt=!0)},o(e){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(me.$$.fragment,e),u(de.$$.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),u(Me.$$.fragment,e),lt=!1},d(e){e&&(n(v),n(d),n(b),n(m),n(Ve),n(X),n(He),n(q),n(Le),n(Y),n(Fe),n(W),n(Ne),n(A),n(Be),n(D),n(Ee),n(Qe),n(K),n(Xe),n(ee),n(qe),n(te),n(Ye),n(Ae),n(De),n(x),n(Oe),n(Ke),n(k),n(et),n(tt),n(w),n(nt),n(ot),n(S),n(rt),n(st),n(j),n(at),n(it),n(Ge)),n(i),_(T,e),_(y,e),_(O,e),_(ne,e),_(oe,e),_(re),_(V),_(se,e),_(ae),_(ie),_(le,e),_(ce),_(me),_(de),_(pe,e),_(ge),_(fe),_(L),_(he,e),_(ue),_(_e),_(F),_(N),_(Me,e)}}}const bn='{"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 Tn(R){return cn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Cn extends mn{constructor(i){super(),dn(this,i,Tn,Mn,an,{})}}export{Cn as component};
