import{S as Cf,i as Zf,s as Nf,e as n,k as p,w as y,t as i,M as Wf,c as s,d as o,m as h,a,x as M,h as l,b as m,G as e,g as _,y as v,q as k,o as w,B as E,v as If,L as H}from"../../chunks/vendor-hf-doc-builder.js";import{T as Le}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as D}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Y}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function xf($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEVzbU1vZGVsJTJDJTIwRXNtQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEVTTSUyMGZhY2Vib29rJTJGZXNtLTFiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTIwJTNFJTNFJTNFJTIwY29uZmlndXJhdGlvbiUyMCUzRCUyMEVzbUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMGNvbmZpZ3VyYXRpb24lMjAlM0UlM0UlM0UlMjBtb2RlbCUyMCUzRCUyMEVTTU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTIwJTNFJTNFJTNFJTIwY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> EsmModel, EsmConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ESM facebook/esm-1b style configuration &gt;&gt;&gt; configuration = EsmConfig()</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration &gt;&gt;&gt; model = ESMModel(configuration)</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration &gt;&gt;&gt; configuration = model.config</span>`}}),{c(){d=n("p"),b=i("Examples:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Examples:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function qf($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function Sf($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFc21Nb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZlc20yX3Q2XzhNX1VSNTBEJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXNtTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZXNtMl90Nl84TV9VUjUwRCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmModel.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Rf($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function Vf($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFc21Gb3JNYXNrZWRMTSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZlc20yX3Q2XzhNX1VSNTBEJTIyKSUwQW1vZGVsJTIwJTNEJTIwRXNtRm9yTWFza2VkTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZXNtMl90Nl84TV9VUjUwRCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjAlM0NtYXNrJTNFLiUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlM0NtYXNrJTNFJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RC5ub256ZXJvKGFzX3R1cGxlJTNEVHJ1ZSklNUIwJTVEJTBBJTBBcHJlZGljdGVkX3Rva2VuX2lkJTIwJTNEJTIwbG9naXRzJTVCMCUyQyUyMG1hc2tfdG9rZW5faW5kZXglNUQuYXJnbWF4KGF4aXMlM0QtMSklMEElMEFsYWJlbHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUyMyUyMG1hc2slMjBsYWJlbHMlMjBvZiUyMG5vbi0lM0NtYXNrJTNFJTIwdG9rZW5zJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2gud2hlcmUoaW5wdXRzLmlucHV0X2lkcyUyMCUzRCUzRCUyMHRva2VuaXplci5tYXNrX3Rva2VuX2lkJTJDJTIwbGFiZWxzJTJDJTIwLTEwMCklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForMaskedLM.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;mask&gt;.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of &lt;mask&gt;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-&lt;mask&gt; tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Gf($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function Bf($){let d,b,c,u,T;return u=new D({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEVzbUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBbW9kZWwlMjAlM0QlMjBFc21Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEVzbUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZXNtMl90Nl84TV9VUjUwRCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzKSUwQSUwQWxhYmVscyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUIxJTVEKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),b=i("Example of single-label classification:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example of single-label classification:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Af($){let d,b,c,u,T;return u=new D({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEVzbUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBbW9kZWwlMjAlM0QlMjBFc21Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIlMkMlMjBwcm9ibGVtX3R5cGUlM0QlMjJtdWx0aV9sYWJlbF9jbGFzc2lmaWNhdGlvbiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJhbmdlKDAlMkMlMjBsb2dpdHMuc2hhcGUlNUItMSU1RCklNUJ0b3JjaC5zaWdtb2lkKGxvZ2l0cykuc3F1ZWV6ZShkaW0lM0QwKSUyMCUzRSUyMDAuNSU1RCUwQSUwQSUyMyUyMFRvJTIwdHJhaW4lMjBhJTIwbW9kZWwlMjBvbiUyMCU2MG51bV9sYWJlbHMlNjAlMjBjbGFzc2VzJTJDJTIweW91JTIwY2FuJTIwcGFzcyUyMCU2MG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTYwJTIwdG8lMjAlNjAuZnJvbV9wcmV0cmFpbmVkKC4uLiklNjAlMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKG1vZGVsLmNvbmZpZy5pZDJsYWJlbCklMEFtb2RlbCUyMCUzRCUyMEVzbUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmZhY2Vib29rJTJGZXNtMl90Nl84TV9VUjUwRCUyMiUyQyUyMG51bV9sYWJlbHMlM0RudW1fbGFiZWxzJTJDJTIwcHJvYmxlbV90eXBlJTNEJTIybXVsdGlfbGFiZWxfY2xhc3NpZmljYXRpb24lMjIlMEEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwdG9yY2guc3VtKCUwQSUyMCUyMCUyMCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwub25lX2hvdChwcmVkaWN0ZWRfY2xhc3NfaWRzJTVCTm9uZSUyQyUyMCUzQSU1RC5jbG9uZSgpJTJDJTIwbnVtX2NsYXNzZXMlM0RudW1fbGFiZWxzKSUyQyUyMGRpbSUzRDElMEEpLnRvKHRvcmNoLmZsb2F0KSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),b=i("Example of multi-label classification:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example of multi-label classification:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Pf($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function Xf($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFc21Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBbW9kZWwlMjAlM0QlMjBFc21Gb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUwQSUyMCUyMCUyMCUyMCUyMkh1Z2dpbmdGYWNlJTIwaXMlMjBhJTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBQYXJpcyUyMGFuZCUyME5ldyUyMFlvcmslMjIlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMEEpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSklMEElMEElMjMlMjBOb3RlJTIwdGhhdCUyMHRva2VucyUyMGFyZSUyMGNsYXNzaWZpZWQlMjByYXRoZXIlMjB0aGVuJTIwaW5wdXQlMjB3b3JkcyUyMHdoaWNoJTIwbWVhbnMlMjB0aGF0JTBBJTIzJTIwdGhlcmUlMjBtaWdodCUyMGJlJTIwbW9yZSUyMHByZWRpY3RlZCUyMHRva2VuJTIwY2xhc3NlcyUyMHRoYW4lMjB3b3Jkcy4lMEElMjMlMjBNdWx0aXBsZSUyMHRva2VuJTIwY2xhc3NlcyUyMG1pZ2h0JTIwYWNjb3VudCUyMGZvciUyMHRoZSUyMHNhbWUlMjB3b3JkJTBBcHJlZGljdGVkX3Rva2Vuc19jbGFzc2VzJTIwJTNEJTIwJTVCbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCdC5pdGVtKCklNUQlMjBmb3IlMjB0JTIwaW4lMjBwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTVCMCU1RCU1RCUwQSUwQWxhYmVscyUyMCUzRCUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMEFsb3NzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMlMkMlMjBsYWJlbHMlM0RsYWJlbHMpLmxvc3M=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForTokenClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Lf($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function Yf($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBFc21Gb3JQcm90ZWluRm9sZGluZyUwQSUwQW1vZGVsJTIwJTNEJTIwRXNtRm9yUHJvdGVpbkZvbGRpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZXNtZm9sZF92MSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbWZvbGRfdjElMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMk1MS05WUVZRTFYlMjIlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UpJTIwJTIwJTIzJTIwQSUyMHRpbnklMjByYW5kb20lMjBwZXB0aWRlJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWZvbGRlZF9wb3NpdGlvbnMlMjAlM0QlMjBvdXRwdXRzLnBvc2l0aW9ucw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForProteinFolding

<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForProteinFolding.from_pretrained(<span class="hljs-string">&quot;facebook/esmfold_v1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esmfold_v1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;MLKNVQVQLV&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>)  <span class="hljs-comment"># A tiny random peptide</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>folded_positions = outputs.positions`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Hf($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function Df($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVzbU1vZGVsJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkVzbU1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFEsmModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmModel.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Qf($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function Of($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVzbUZvck1hc2tlZExNJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkVzbUZvck1hc2tlZExNLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwJTNDbWFzayUzRS4lMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjByZXRyaWV2ZSUyMGluZGV4JTIwb2YlMjAlM0NtYXNrJTNFJTBBbWFza190b2tlbl9pbmRleCUyMCUzRCUyMHRmLndoZXJlKChpbnB1dHMuaW5wdXRfaWRzJTIwJTNEJTNEJTIwdG9rZW5pemVyLm1hc2tfdG9rZW5faWQpJTVCMCU1RCklMEFzZWxlY3RlZF9sb2dpdHMlMjAlM0QlMjB0Zi5nYXRoZXJfbmQobG9naXRzJTVCMCU1RCUyQyUyMGluZGljZXMlM0RtYXNrX3Rva2VuX2luZGV4KSUwQSUwQXByZWRpY3RlZF90b2tlbl9pZCUyMCUzRCUyMHRmLm1hdGguYXJnbWF4KHNlbGVjdGVkX2xvZ2l0cyUyQyUyMGF4aXMlM0QtMSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFEsmForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForMaskedLM.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;mask&gt;.&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of &lt;mask&gt;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>selected_logits = tf.gather_nd(logits[<span class="hljs-number">0</span>], indices=mask_token_index)

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = tf.math.argmax(selected_logits, axis=-<span class="hljs-number">1</span>)`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function Kf($){let d,b;return d=new D({props:{code:"bGFiZWxzJTIwJTNEJTIwdG9rZW5pemVyKCUyMlRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMjMlMjBtYXNrJTIwbGFiZWxzJTIwb2YlMjBub24tJTNDbWFzayUzRSUyMHRva2VucyUwQWxhYmVscyUyMCUzRCUyMHRmLndoZXJlKGlucHV0cy5pbnB1dF9pZHMlMjAlM0QlM0QlMjB0b2tlbml6ZXIubWFza190b2tlbl9pZCUyQyUyMGxhYmVscyUyQyUyMC0xMDApJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-&lt;mask&gt; tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){y(d.$$.fragment)},l(c){M(d.$$.fragment,c)},m(c,u){v(d,c,u),b=!0},p:H,i(c){b||(k(d.$$.fragment,c),b=!0)},o(c){w(d.$$.fragment,c),b=!1},d(c){E(d,c)}}}function eu($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function tu($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVzbUZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZXNtMl90Nl84TV9VUjUwRCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRXNtRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZlc20yX3Q2XzhNX1VSNTBEJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBcHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFEsmForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function ou($){let d,b;return d=new D({props:{code:"JTIzJTIwVG8lMjB0cmFpbiUyMGElMjBtb2RlbCUyMG9uJTIwJTYwbnVtX2xhYmVscyU2MCUyMGNsYXNzZXMlMkMlMjB5b3UlMjBjYW4lMjBwYXNzJTIwJTYwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlNjAlMjB0byUyMCU2MC5mcm9tX3ByZXRyYWluZWQoLi4uKSU2MCUwQW51bV9sYWJlbHMlMjAlM0QlMjBsZW4obW9kZWwuY29uZmlnLmlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwVEZFc21Gb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRmVzbTJfdDZfOE1fVVI1MEQlMjIlMkMlMjBudW1fbGFiZWxzJTNEbnVtX2xhYmVscyklMEElMEFsYWJlbHMlMjAlM0QlMjB0Zi5jb25zdGFudCgxKSUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`</span>\n<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)\n<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, num_labels=num_labels)\n\n<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)\n<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss'}}),{c(){y(d.$$.fragment)},l(c){M(d.$$.fragment,c)},m(c,u){v(d,c,u),b=!0},p:H,i(c){b||(k(d.$$.fragment,c),b=!0)},o(c){w(d.$$.fragment,c),b=!1},d(c){E(d,c)}}}function nu($){let d,b,c,u,T;return{c(){d=n("p"),b=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=n("code"),u=i("Module"),T=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=s(f,"CODE",{});var F=a(c);u=l(F,"Module"),F.forEach(o),T=l(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(r,f){_(r,d,f),e(d,b),e(d,c),e(c,u),e(d,T)},d(r){r&&o(d)}}}function su($){let d,b,c,u,T;return u=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkVzbUZvclRva2VuQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmZhY2Vib29rJTJGZXNtMl90Nl84TV9VUjUwRCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRXNtRm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZlc20yX3Q2XzhNX1VSNTBEJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMEElMjAlMjAlMjAlMjAlMjJIdWdnaW5nRmFjZSUyMGlzJTIwYSUyMGNvbXBhbnklMjBiYXNlZCUyMGluJTIwUGFyaXMlMjBhbmQlMjBOZXclMjBZb3JrJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyJTBBKSUwQSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEFwcmVkaWN0ZWRfdG9rZW5fY2xhc3NfaWRzJTIwJTNEJTIwdGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwdG9rZW5zJTIwYXJlJTIwY2xhc3NpZmllZCUyMHJhdGhlciUyMHRoZW4lMjBpbnB1dCUyMHdvcmRzJTIwd2hpY2glMjBtZWFucyUyMHRoYXQlMEElMjMlMjB0aGVyZSUyMG1pZ2h0JTIwYmUlMjBtb3JlJTIwcHJlZGljdGVkJTIwdG9rZW4lMjBjbGFzc2VzJTIwdGhhbiUyMHdvcmRzLiUwQSUyMyUyME11bHRpcGxlJTIwdG9rZW4lMjBjbGFzc2VzJTIwbWlnaHQlMjBhY2NvdW50JTIwZm9yJTIwdGhlJTIwc2FtZSUyMHdvcmQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMjAlM0QlMjAlNUJtb2RlbC5jb25maWcuaWQybGFiZWwlNUJ0JTVEJTIwZm9yJTIwdCUyMGluJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyU1QjAlNUQubnVtcHkoKS50b2xpc3QoKSU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFEsmForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForTokenClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>].numpy().tolist()]`}}),{c(){d=n("p"),b=i("Example:"),c=p(),y(u.$$.fragment)},l(r){d=s(r,"P",{});var f=a(d);b=l(f,"Example:"),f.forEach(o),c=h(r),M(u.$$.fragment,r)},m(r,f){_(r,d,f),e(d,b),_(r,c,f),v(u,r,f),T=!0},p:H,i(r){T||(k(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&o(d),r&&o(c),E(u,r)}}}function au($){let d,b;return d=new D({props:{code:"bGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjB0Zi5tYXRoLnJlZHVjZV9tZWFuKG1vZGVsKCoqaW5wdXRzJTJDJTIwbGFiZWxzJTNEbGFiZWxzKS5sb3NzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)`}}),{c(){y(d.$$.fragment)},l(c){M(d.$$.fragment,c)},m(c,u){v(d,c,u),b=!0},p:H,i(c){b||(k(d.$$.fragment,c),b=!0)},o(c){w(d.$$.fragment,c),b=!1},d(c){E(d,c)}}}function ru($){let d,b,c,u,T,r,f,F,ni,qa,ve,Ye,ps,St,si,hs,ai,Sa,He,ri,Rt,ii,li,Ra,De,di,Vt,ci,mi,Va,gn,pi,Ga,_n,fs,hi,Ba,bn,fi,Aa,Tn,us,ui,Pa,yn,gi,Xa,Mn,gs,_i,La,Q,bi,Gt,Ti,yi,Bt,Mi,vi,At,ki,wi,Ya,ae,Ei,Pt,$i,Fi,Xt,zi,Ji,Ha,re,ji,Lt,Ui,Ci,_s,Zi,Ni,Da,ke,Qe,bs,Yt,Wi,Ts,Ii,Qa,ie,ys,vn,xi,qi,Ms,kn,Si,Ri,vs,wn,Vi,Oa,we,Oe,ks,Ht,Gi,ws,Bi,Ka,C,Dt,Ai,Ee,Pi,Es,Xi,Li,Qt,Yi,Hi,Di,$e,Qi,En,Oi,Ki,$n,el,tl,ol,Ke,nl,et,Ot,sl,Kt,al,Fn,rl,il,er,Fe,tt,$s,eo,ll,Fs,dl,tr,j,to,cl,zs,ml,pl,zn,oo,hl,ot,no,fl,ze,ul,Js,gl,_l,js,bl,Tl,yl,le,so,Ml,Jn,vl,jn,kl,wl,Us,El,$l,Un,ao,or,Je,nt,Cs,ro,Fl,Zs,zl,nr,J,io,Jl,Ns,jl,Ul,lo,Cl,Cn,Zl,Nl,Wl,co,Il,mo,xl,ql,Sl,po,Rl,ho,Vl,Gl,Bl,U,Al,Ws,Pl,Xl,Is,Ll,Yl,xs,Hl,Dl,qs,Ql,Ol,Ss,Kl,ed,Rs,td,od,nd,O,fo,sd,je,ad,Zn,rd,id,Vs,ld,dd,cd,st,md,at,sr,Ue,rt,Gs,uo,pd,Bs,hd,ar,Z,go,fd,_o,ud,As,gd,_d,bd,bo,Td,Nn,yd,Md,vd,To,kd,yo,wd,Ed,$d,K,Mo,Fd,Ce,zd,Wn,Jd,jd,Ps,Ud,Cd,Zd,it,Nd,lt,rr,Ze,dt,Xs,vo,Wd,Ls,Id,ir,N,ko,xd,Ys,qd,Sd,wo,Rd,In,Vd,Gd,Bd,Eo,Ad,$o,Pd,Xd,Ld,V,Fo,Yd,Ne,Hd,xn,Dd,Qd,Hs,Od,Kd,ec,ct,tc,mt,oc,pt,lr,We,ht,Ds,zo,nc,Qs,sc,dr,W,Jo,ac,Os,rc,ic,jo,lc,qn,dc,cc,mc,Uo,pc,Co,hc,fc,uc,ee,Zo,gc,Ie,_c,Sn,bc,Tc,Ks,yc,Mc,vc,ft,kc,ut,cr,xe,gt,ea,No,wc,ta,Ec,mr,I,Wo,$c,oa,Fc,zc,Io,Jc,Rn,jc,Uc,Cc,xo,Zc,qo,Nc,Wc,Ic,te,So,xc,qe,qc,Vn,Sc,Rc,na,Vc,Gc,Bc,_t,Ac,bt,pr,Se,Tt,sa,Ro,Pc,aa,Xc,hr,x,Vo,Lc,ra,Yc,Hc,Go,Dc,Gn,Qc,Oc,Kc,Bo,em,Ao,tm,om,nm,oe,Po,sm,Re,am,Bn,rm,im,ia,lm,dm,cm,yt,mm,Mt,fr,Ve,vt,la,Xo,pm,da,hm,ur,q,Lo,fm,Yo,um,ca,gm,_m,bm,Ho,Tm,An,ym,Mm,vm,Do,km,Qo,wm,Em,$m,G,Oo,Fm,Ge,zm,Pn,Jm,jm,ma,Um,Cm,Zm,kt,Nm,wt,Wm,Et,gr,Be,$t,pa,Ko,Im,ha,xm,_r,S,en,qm,fa,Sm,Rm,tn,Vm,Xn,Gm,Bm,Am,on,Pm,nn,Xm,Lm,Ym,B,sn,Hm,Ae,Dm,Ln,Qm,Om,ua,Km,ep,tp,Ft,op,zt,np,Jt,br,Pe,jt,ga,an,sp,_a,ap,Tr,R,rn,rp,ba,ip,lp,ln,dp,Yn,cp,mp,pp,dn,hp,cn,fp,up,gp,A,mn,_p,Xe,bp,Hn,Tp,yp,Ta,Mp,vp,kp,Ut,wp,Ct,Ep,Zt,yr;return r=new L({}),St=new L({}),Yt=new L({}),Ht=new L({}),Dt=new z({props:{name:"class transformers.EsmConfig",anchor:"transformers.EsmConfig",parameters:[{name:"vocab_size",val:" = None"},{name:"mask_token_id",val:" = None"},{name:"pad_token_id",val:" = None"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 1026"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"emb_layer_norm_before",val:" = None"},{name:"token_dropout",val:" = False"},{name:"is_folding_model",val:" = False"},{name:"esmfold_config",val:" = None"},{name:"vocab_list",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EsmConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Vocabulary size of the ESM model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <code>ESMModel</code>.`,name:"vocab_size"},{anchor:"transformers.EsmConfig.mask_token_id",description:`<strong>mask_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the mask token in the vocabulary. This must be included in the config because of the
&#x201C;mask-dropout&#x201D; scaling trick, which will scale the inputs depending on the number of masked tokens.`,name:"mask_token_id"},{anchor:"transformers.EsmConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the padding token in the vocabulary. This must be included in the config because certain parts
of the ESM code use this instead of the attention mask.`,name:"pad_token_id"},{anchor:"transformers.EsmConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.EsmConfig.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.EsmConfig.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.EsmConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.EsmConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.EsmConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.EsmConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1026) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.EsmConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.EsmConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.EsmConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;, &quot;rotary&quot;</code>.
For positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.EsmConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.EsmConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.EsmConfig.emb_layer_norm_before",description:`<strong>emb_layer_norm_before</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to apply layer normalization after embeddings but before the main stem of the network.`,name:"emb_layer_norm_before"},{anchor:"transformers.EsmConfig.token_dropout",description:`<strong>token_dropout</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
When this is enabled, masked tokens are treated as if they had been dropped out by input dropout.`,name:"token_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/configuration_esm.py#L33"}}),Ke=new Y({props:{anchor:"transformers.EsmConfig.example",$$slots:{default:[xf]},$$scope:{ctx:$}}}),Ot=new z({props:{name:"to_dict",anchor:"transformers.EsmConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/configuration_esm.py#L160",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),eo=new L({}),to=new z({props:{name:"class transformers.EsmTokenizer",anchor:"transformers.EsmTokenizer",parameters:[{name:"vocab_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"cls_token",val:" = '<cls>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"eos_token",val:" = '<eos>'"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/tokenization_esm.py#L47"}}),oo=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.EsmTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/tokenization_esm.py#L100"}}),no=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.EsmTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List"},{name:"token_ids_1",val:": typing.Optional[typing.List] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.EsmTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids of the first sequence.`,name:"token_ids_0"},{anchor:"transformers.EsmTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
List of ids of the second sequence.`,name:"token_ids_1"},{anchor:"transformers.EsmTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/tokenization_esm.py#L114",returnDescription:`
<p>1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p>A list of integers in the range [0, 1]</p>
`}}),so=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.EsmTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.EsmTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.EsmTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3101",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ao=new z({props:{name:"save_vocabulary",anchor:"transformers.EsmTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:""},{name:"filename_prefix",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/tokenization_esm.py#L145"}}),ro=new L({}),io=new z({props:{name:"class transformers.EsmModel",anchor:"transformers.EsmModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.EsmModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L775"}}),fo=new z({props:{name:"forward",anchor:"transformers.EsmModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.EsmModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>((batch_size, sequence_length))</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>((batch_size, sequence_length))</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>((batch_size, sequence_length))</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.EsmModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>((batch_size, sequence_length), hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmModel.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.EsmModel.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.EsmModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.EsmModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.EsmModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.EsmModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L824",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new Le({props:{$$slots:{default:[qf]},$$scope:{ctx:$}}}),at=new Y({props:{anchor:"transformers.EsmModel.forward.example",$$slots:{default:[Sf]},$$scope:{ctx:$}}}),uo=new L({}),go=new z({props:{name:"class transformers.EsmForMaskedLM",anchor:"transformers.EsmForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L964"}}),Mo=new z({props:{name:"forward",anchor:"transformers.EsmForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.EsmForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.EsmForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmForMaskedLM.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.EsmForMaskedLM.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.EsmForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.EsmForMaskedLM.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L987",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),it=new Le({props:{$$slots:{default:[Rf]},$$scope:{ctx:$}}}),lt=new Y({props:{anchor:"transformers.EsmForMaskedLM.forward.example",$$slots:{default:[Vf]},$$scope:{ctx:$}}}),vo=new L({}),ko=new z({props:{name:"class transformers.EsmForSequenceClassification",anchor:"transformers.EsmForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L1083"}}),Fo=new z({props:{name:"forward",anchor:"transformers.EsmForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.EsmForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.EsmForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmForSequenceClassification.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.EsmForSequenceClassification.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.EsmForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L1094",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ct=new Le({props:{$$slots:{default:[Gf]},$$scope:{ctx:$}}}),mt=new Y({props:{anchor:"transformers.EsmForSequenceClassification.forward.example",$$slots:{default:[Bf]},$$scope:{ctx:$}}}),pt=new Y({props:{anchor:"transformers.EsmForSequenceClassification.forward.example-2",$$slots:{default:[Af]},$$scope:{ctx:$}}}),zo=new L({}),Jo=new z({props:{name:"class transformers.EsmForTokenClassification",anchor:"transformers.EsmForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L1177"}}),Zo=new z({props:{name:"forward",anchor:"transformers.EsmForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.EsmForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.EsmForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmForTokenClassification.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.EsmForTokenClassification.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.EsmForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esm.py#L1188",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new Le({props:{$$slots:{default:[Pf]},$$scope:{ctx:$}}}),ut=new Y({props:{anchor:"transformers.EsmForTokenClassification.forward.example",$$slots:{default:[Xf]},$$scope:{ctx:$}}}),No=new L({}),Wo=new z({props:{name:"class transformers.EsmForProteinFolding",anchor:"transformers.EsmForProteinFolding",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForProteinFolding.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esmfold.py#L2020"}}),So=new z({props:{name:"forward",anchor:"transformers.EsmForProteinFolding.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"masking_pattern",val:": typing.Optional[torch.Tensor] = None"},{name:"num_recycles",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.EsmForProteinFolding.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForProteinFolding.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForProteinFolding.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForProteinFolding.forward.masking_pattern",description:`<strong>masking_pattern</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Locations of tokens to mask during training as a form of regularization. Mask values selected in <code>[0, 1]</code>.`,name:"masking_pattern"},{anchor:"transformers.EsmForProteinFolding.forward.num_recycles",description:`<strong>num_recycles</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Number of times to recycle the input sequence. If <code>None</code>, defaults to <code>config.num_recycles</code>. &#x201C;Recycling&#x201D;
consists of passing the output of the folding trunk back in as input to the trunk. During training, the
number of recycles should vary with each batch, to ensure that the model learns to output valid predictions
after each recycle. During inference, num_recycles should be set to the highest value that the model was
trained with for maximum accuracy. Accordingly, when this value is set to <code>None</code>, config.max_recycles is
used.`,name:"num_recycles"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_esmfold.py#L2084",returnDescription:`
<p>A <code>transformers.models.esm.modeling_esmfold.EsmForProteinFoldingOutput</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.esm.configuration_esm.EsmConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>frames</strong> (<code>torch.FloatTensor</code>) \u2014 Output frames.</li>
<li><strong>sidechain_frames</strong> (<code>torch.FloatTensor</code>) \u2014 Output sidechain frames.</li>
<li><strong>unnormalized_angles</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted unnormalized backbone and side chain torsion angles.</li>
<li><strong>angles</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted backbone and side chain torsion angles.</li>
<li><strong>positions</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted positions of the backbone and side chain atoms.</li>
<li><strong>states</strong> (<code>torch.FloatTensor</code>) \u2014 Hidden states from the protein folding trunk.</li>
<li><strong>s_s</strong> (<code>torch.FloatTensor</code>) \u2014 Per-residue embeddings derived by concatenating the hidden states of each layer of the ESM-2 LM stem.</li>
<li><strong>s_z</strong> (<code>torch.FloatTensor</code>) \u2014 Pairwise residue embeddings.</li>
<li><strong>distogram_logits</strong> (<code>torch.FloatTensor</code>) \u2014 Input logits to the distogram used to compute residue distances.</li>
<li><strong>lm_logits</strong> (<code>torch.FloatTensor</code>) \u2014 Logits output by the ESM-2 protein language model stem.</li>
<li><strong>aatype</strong> (<code>torch.FloatTensor</code>) \u2014 Input amino acids (AlphaFold2 indices).</li>
<li><strong>atom14_atom_exists</strong> (<code>torch.FloatTensor</code>) \u2014 Whether each atom exists in the atom14 representation.</li>
<li><strong>residx_atom14_to_atom37</strong> (<code>torch.FloatTensor</code>) \u2014 Mapping between atoms in the atom14 and atom37 representations.</li>
<li><strong>residx_atom37_to_atom14</strong> (<code>torch.FloatTensor</code>) \u2014 Mapping between atoms in the atom37 and atom14 representations.</li>
<li><strong>atom37_atom_exists</strong> (<code>torch.FloatTensor</code>) \u2014 Whether each atom exists in the atom37 representation.</li>
<li><strong>residue_index</strong> (<code>torch.FloatTensor</code>) \u2014 The index of each residue in the protein chain. Unless internal padding tokens are used, this will just be
a sequence of integers from 0 to <code>sequence_length</code>.</li>
<li><strong>lddt_head</strong> (<code>torch.FloatTensor</code>) \u2014 Raw outputs from the lddt head used to compute plddt.</li>
<li><strong>plddt</strong> (<code>torch.FloatTensor</code>) \u2014 Per-residue confidence scores. Regions of low confidence may indicate areas where the model\u2019s prediction is
uncertain, or where the protein structure is disordered.</li>
<li><strong>ptm_logits</strong> (<code>torch.FloatTensor</code>) \u2014 Raw logits used for computing ptm.</li>
<li><strong>ptm</strong> (<code>torch.FloatTensor</code>) \u2014 TM-score output representing the model\u2019s high-level confidence in the overall structure.</li>
<li><strong>aligned_confidence_probs</strong> (<code>torch.FloatTensor</code>) \u2014 Per-residue confidence scores for the aligned structure.</li>
<li><strong>predicted_aligned_error</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted error between the model\u2019s prediction and the ground truth.</li>
<li><strong>max_predicted_aligned_error</strong> (<code>torch.FloatTensor</code>) \u2014 Per-sample maximum predicted error.</li>
</ul>
`,returnType:`
<p><code>transformers.models.esm.modeling_esmfold.EsmForProteinFoldingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_t=new Le({props:{$$slots:{default:[Lf]},$$scope:{ctx:$}}}),bt=new Y({props:{anchor:"transformers.EsmForProteinFolding.forward.example",$$slots:{default:[Yf]},$$scope:{ctx:$}}}),Ro=new L({}),Vo=new z({props:{name:"class transformers.TFEsmModel",anchor:"transformers.TFEsmModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L975"}}),Po=new z({props:{name:"call",anchor:"transformers.TFEsmModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"past_key_values",val:": Optional[Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]] = None"},{name:"use_cache",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFEsmModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFEsmModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmModel.call.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.TFEsmModel.call.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.TFEsmModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFEsmModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.TFEsmModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</code>) &#x2014;
contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.TFEsmModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L981",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),yt=new Le({props:{$$slots:{default:[Hf]},$$scope:{ctx:$}}}),Mt=new Y({props:{anchor:"transformers.TFEsmModel.call.example",$$slots:{default:[Df]},$$scope:{ctx:$}}}),Xo=new L({}),Lo=new z({props:{name:"class transformers.TFEsmForMaskedLM",anchor:"transformers.TFEsmForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L1046"}}),Oo=new z({props:{name:"call",anchor:"transformers.TFEsmForMaskedLM.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_hidden_states",val:": np.ndarray | tf.Tensor | None = None"},{name:"encoder_attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEsmForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFEsmForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmForMaskedLM.call.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.TFEsmForMaskedLM.call.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.TFEsmForMaskedLM.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmForMaskedLM.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.TFEsmForMaskedLM.call.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L1076",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),kt=new Le({props:{$$slots:{default:[Qf]},$$scope:{ctx:$}}}),wt=new Y({props:{anchor:"transformers.TFEsmForMaskedLM.call.example",$$slots:{default:[Of]},$$scope:{ctx:$}}}),Et=new Y({props:{anchor:"transformers.TFEsmForMaskedLM.call.example-2",$$slots:{default:[Kf]},$$scope:{ctx:$}}}),Ko=new L({}),en=new z({props:{name:"class transformers.TFEsmForSequenceClassification",anchor:"transformers.TFEsmForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L1194"}}),sn=new z({props:{name:"call",anchor:"transformers.TFEsmForSequenceClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEsmForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFEsmForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmForSequenceClassification.call.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.TFEsmForSequenceClassification.call.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.TFEsmForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L1205",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ft=new Le({props:{$$slots:{default:[eu]},$$scope:{ctx:$}}}),zt=new Y({props:{anchor:"transformers.TFEsmForSequenceClassification.call.example",$$slots:{default:[tu]},$$scope:{ctx:$}}}),Jt=new Y({props:{anchor:"transformers.TFEsmForSequenceClassification.call.example-2",$$slots:{default:[ou]},$$scope:{ctx:$}}}),an=new L({}),rn=new z({props:{name:"class transformers.TFEsmForTokenClassification",anchor:"transformers.TFEsmForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L1268"}}),mn=new z({props:{name:"call",anchor:"transformers.TFEsmForTokenClassification.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"head_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"inputs_embeds",val:": np.ndarray | tf.Tensor | None = None"},{name:"labels",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEsmForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.TFEsmForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmForTokenClassification.call.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.TFEsmForTokenClassification.call.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.TFEsmForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/esm/modeling_tf_esm.py#L1280",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Ut=new Le({props:{$$slots:{default:[nu]},$$scope:{ctx:$}}}),Ct=new Y({props:{anchor:"transformers.TFEsmForTokenClassification.call.example",$$slots:{default:[su]},$$scope:{ctx:$}}}),Zt=new Y({props:{anchor:"transformers.TFEsmForTokenClassification.call.example-2",$$slots:{default:[au]},$$scope:{ctx:$}}}),{c(){d=n("meta"),b=p(),c=n("h1"),u=n("a"),T=n("span"),y(r.$$.fragment),f=p(),F=n("span"),ni=i("ESM"),qa=p(),ve=n("h2"),Ye=n("a"),ps=n("span"),y(St.$$.fragment),si=p(),hs=n("span"),ai=i("Overview"),Sa=i(`

This page provides code and pre-trained weights for Transformer protein language models from Meta AI's Fundamental 
AI Research Team, providing the state-of-the-art ESMFold and ESM-2, and the previously released ESM-1b and ESM-1v.
Transformer protein language models were introduced in the paper [Biological structure and function emerge from scaling
unsupervised learning to 250 million protein sequences](https://www.pnas.org/content/118/15/e2016239118) by 
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, 
C. Lawrence Zitnick, Jerry Ma, and Rob Fergus.
The first version of this paper was [preprinted in 2019](https://www.biorxiv.org/content/10.1101/622803v1?versioned=true).
`),He=n("p"),ri=i(`ESM-2 outperforms all tested single-sequence protein language models across a range of structure prediction tasks,
and enables atomic resolution structure prediction.
It was released with the paper `),Rt=n("a"),ii=i(`Language models of protein sequences at the scale of evolution enable accurate
structure prediction`),li=i(` by Zeming Lin, Halil Akin, Roshan Rao, Brian Hie,
Zhongkai Zhu, Wenting Lu, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Sal Candido and Alexander Rives.`),Ra=p(),De=n("p"),di=i(`Also introduced in this paper was ESMFold. It uses an ESM-2 stem with a head that can predict folded protein
structures with state-of-the-art accuracy. Unlike `),Vt=n("a"),ci=i("AlphaFold2"),mi=i(`,
it relies on the token embeddings from the large pre-trained protein language model stem and does not perform a multiple
sequence alignment (MSA) step at inference time, which means that ESMFold checkpoints are fully \u201Cstandalone\u201D -
they do not require a database of known protein sequences and structures with associated external query tools
to make predictions, and are much faster as a result.`),Va=p(),gn=n("p"),pi=i(`The abstract from
\u201CBiological structure and function emerge from scaling unsupervised learning to 250
million protein sequences\u201D is`),Ga=p(),_n=n("p"),fs=n("em"),hi=i(`In the field of artificial intelligence, a combination of scale in data and model capacity enabled by unsupervised
learning has led to major advances in representation learning and statistical generation. In the life sciences, the
anticipated growth of sequencing promises unprecedented data on natural sequence diversity. Protein language modeling
at the scale of evolution is a logical step toward predictive and generative artificial intelligence for biology. To
this end, we use unsupervised learning to train a deep contextual language model on 86 billion amino acids across 250
million protein sequences spanning evolutionary diversity. The resulting model contains information about biological
properties in its representations. The representations are learned from sequence data alone. The learned representation
space has a multiscale organization reflecting structure from the level of biochemical properties of amino acids to
remote homology of proteins. Information about secondary and tertiary structure is encoded in the representations and
can be identified by linear projections. Representation learning produces features that generalize across a range of
applications, enabling state-of-the-art supervised prediction of mutational effect and secondary structure and
improving state-of-the-art features for long-range contact prediction.`),Ba=p(),bn=n("p"),fi=i(`The abstract from
\u201CLanguage models of protein sequences at the scale of evolution enable accurate structure prediction\u201D is`),Aa=p(),Tn=n("p"),us=n("em"),ui=i(`Large language models have recently been shown to develop emergent capabilities with scale, going beyond
simple pattern matching to perform higher level reasoning and generate lifelike images and text. While
language models trained on protein sequences have been studied at a smaller scale, little is known about
what they learn about biology as they are scaled up. In this work we train models up to 15 billion parameters,
the largest language models of proteins to be evaluated to date. We find that as models are scaled they learn
information enabling the prediction of the three-dimensional structure of a protein at the resolution of
individual atoms. We present ESMFold for high accuracy end-to-end atomic level structure prediction directly
from the individual sequence of a protein. ESMFold has similar accuracy to AlphaFold2 and RoseTTAFold for
sequences with low perplexity that are well understood by the language model. ESMFold inference is an
order of magnitude faster than AlphaFold2, enabling exploration of the structural space of metagenomic
proteins in practical timescales.`),Pa=p(),yn=n("p"),gi=i("Tips:"),Xa=p(),Mn=n("ul"),gs=n("li"),_i=i("ESM models are trained with a masked language modeling (MLM) objective."),La=p(),Q=n("p"),bi=i("The original code can be found "),Gt=n("a"),Ti=i("here"),yi=i(` and was
was developed by the Fundamental AI Research team at Meta AI.
ESM-1b, ESM-1v and ESM-2 were contributed to huggingface by `),Bt=n("a"),Mi=i("jasonliu"),vi=i(`
and `),At=n("a"),ki=i("Matt"),wi=i("."),Ya=p(),ae=n("p"),Ei=i("ESMFold was contributed to huggingface by "),Pt=n("a"),$i=i("Matt"),Fi=i(` and
`),Xt=n("a"),zi=i("Sylvain"),Ji=i(`, with a big thank you to Nikita Smetanin, Roshan Rao and Tom Sercu for their
help throughout the process!`),Ha=p(),re=n("p"),ji=i("The HuggingFace port of ESMFold uses portions of the "),Lt=n("a"),Ui=i("openfold"),Ci=i(` library.
The `),_s=n("code"),Zi=i("openfold"),Ni=i(" library is licensed under the Apache License 2.0."),Da=p(),ke=n("h2"),Qe=n("a"),bs=n("span"),y(Yt.$$.fragment),Wi=p(),Ts=n("span"),Ii=i("Documentation resources"),Qa=p(),ie=n("ul"),ys=n("li"),vn=n("a"),xi=i("Text classification task guide"),qi=p(),Ms=n("li"),kn=n("a"),Si=i("Token classification task guide"),Ri=p(),vs=n("li"),wn=n("a"),Vi=i("Masked language modeling task guide"),Oa=p(),we=n("h2"),Oe=n("a"),ks=n("span"),y(Ht.$$.fragment),Gi=p(),ws=n("span"),Bi=i("EsmConfig"),Ka=p(),C=n("div"),y(Dt.$$.fragment),Ai=p(),Ee=n("p"),Pi=i("This is the configuration class to store the configuration of a "),Es=n("code"),Xi=i("ESMModel"),Li=i(`. It is used to instantiate a ESM 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 ESM
`),Qt=n("a"),Yi=i("facebook/esm-1b"),Hi=i(" architecture."),Di=p(),$e=n("p"),Qi=i("Configuration objects inherit from "),En=n("a"),Oi=i("PretrainedConfig"),Ki=i(` and can be used to control the model outputs. Read the
documentation from `),$n=n("a"),el=i("PretrainedConfig"),tl=i(" for more information."),ol=p(),y(Ke.$$.fragment),nl=p(),et=n("div"),y(Ot.$$.fragment),sl=p(),Kt=n("p"),al=i("Serializes this instance to a Python dictionary. Override the default "),Fn=n("a"),rl=i("to_dict()"),il=i("."),er=p(),Fe=n("h2"),tt=n("a"),$s=n("span"),y(eo.$$.fragment),ll=p(),Fs=n("span"),dl=i("EsmTokenizer"),tr=p(),j=n("div"),y(to.$$.fragment),cl=p(),zs=n("p"),ml=i("Constructs an ESM tokenizer."),pl=p(),zn=n("div"),y(oo.$$.fragment),hl=p(),ot=n("div"),y(no.$$.fragment),fl=p(),ze=n("p"),ul=i(`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Js=n("code"),gl=i("prepare_for_model"),_l=i(" or "),js=n("code"),bl=i("encode_plus"),Tl=i(" methods."),yl=p(),le=n("div"),y(so.$$.fragment),Ml=p(),Jn=n("p"),vl=i("Create the token type IDs corresponding to the sequences passed. "),jn=n("a"),kl=i(`What are token type
IDs?`),wl=p(),Us=n("p"),El=i("Should be overridden in a subclass if the model has a special way of building those."),$l=p(),Un=n("div"),y(ao.$$.fragment),or=p(),Je=n("h2"),nt=n("a"),Cs=n("span"),y(ro.$$.fragment),Fl=p(),Zs=n("span"),zl=i("EsmModel"),nr=p(),J=n("div"),y(io.$$.fragment),Jl=p(),Ns=n("p"),jl=i("The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),Ul=p(),lo=n("p"),Cl=i("This model inherits from "),Cn=n("a"),Zl=i("PreTrainedModel"),Nl=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Wl=p(),co=n("p"),Il=i("This model is also a PyTorch "),mo=n("a"),xl=i("torch.nn.Module"),ql=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sl=p(),po=n("p"),Rl=i(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),ho=n("a"),Vl=i(`Attention is
all you need`),Gl=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Bl=p(),U=n("p"),Al=i("To behave as an decoder the model needs to be initialized with the "),Ws=n("code"),Pl=i("is_decoder"),Xl=i(` argument of the configuration set
to `),Is=n("code"),Ll=i("True"),Yl=i(". To be used in a Seq2Seq model, the model needs to initialized with both "),xs=n("code"),Hl=i("is_decoder"),Dl=i(` argument and
`),qs=n("code"),Ql=i("add_cross_attention"),Ol=i(" set to "),Ss=n("code"),Kl=i("True"),ed=i("; an "),Rs=n("code"),td=i("encoder_hidden_states"),od=i(" is then expected as an input to the forward pass."),nd=p(),O=n("div"),y(fo.$$.fragment),sd=p(),je=n("p"),ad=i("The "),Zn=n("a"),rd=i("EsmModel"),id=i(" forward method, overrides the "),Vs=n("code"),ld=i("__call__"),dd=i(" special method."),cd=p(),y(st.$$.fragment),md=p(),y(at.$$.fragment),sr=p(),Ue=n("h2"),rt=n("a"),Gs=n("span"),y(uo.$$.fragment),pd=p(),Bs=n("span"),hd=i("EsmForMaskedLM"),ar=p(),Z=n("div"),y(go.$$.fragment),fd=p(),_o=n("p"),ud=i("ESM Model with a "),As=n("code"),gd=i("language modeling"),_d=i(" head on top."),bd=p(),bo=n("p"),Td=i("This model inherits from "),Nn=n("a"),yd=i("PreTrainedModel"),Md=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),vd=p(),To=n("p"),kd=i("This model is also a PyTorch "),yo=n("a"),wd=i("torch.nn.Module"),Ed=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$d=p(),K=n("div"),y(Mo.$$.fragment),Fd=p(),Ce=n("p"),zd=i("The "),Wn=n("a"),Jd=i("EsmForMaskedLM"),jd=i(" forward method, overrides the "),Ps=n("code"),Ud=i("__call__"),Cd=i(" special method."),Zd=p(),y(it.$$.fragment),Nd=p(),y(lt.$$.fragment),rr=p(),Ze=n("h2"),dt=n("a"),Xs=n("span"),y(vo.$$.fragment),Wd=p(),Ls=n("span"),Id=i("EsmForSequenceClassification"),ir=p(),N=n("div"),y(ko.$$.fragment),xd=p(),Ys=n("p"),qd=i(`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Sd=p(),wo=n("p"),Rd=i("This model inherits from "),In=n("a"),Vd=i("PreTrainedModel"),Gd=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Bd=p(),Eo=n("p"),Ad=i("This model is also a PyTorch "),$o=n("a"),Pd=i("torch.nn.Module"),Xd=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ld=p(),V=n("div"),y(Fo.$$.fragment),Yd=p(),Ne=n("p"),Hd=i("The "),xn=n("a"),Dd=i("EsmForSequenceClassification"),Qd=i(" forward method, overrides the "),Hs=n("code"),Od=i("__call__"),Kd=i(" special method."),ec=p(),y(ct.$$.fragment),tc=p(),y(mt.$$.fragment),oc=p(),y(pt.$$.fragment),lr=p(),We=n("h2"),ht=n("a"),Ds=n("span"),y(zo.$$.fragment),nc=p(),Qs=n("span"),sc=i("EsmForTokenClassification"),dr=p(),W=n("div"),y(Jo.$$.fragment),ac=p(),Os=n("p"),rc=i(`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),ic=p(),jo=n("p"),lc=i("This model inherits from "),qn=n("a"),dc=i("PreTrainedModel"),cc=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),mc=p(),Uo=n("p"),pc=i("This model is also a PyTorch "),Co=n("a"),hc=i("torch.nn.Module"),fc=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),uc=p(),ee=n("div"),y(Zo.$$.fragment),gc=p(),Ie=n("p"),_c=i("The "),Sn=n("a"),bc=i("EsmForTokenClassification"),Tc=i(" forward method, overrides the "),Ks=n("code"),yc=i("__call__"),Mc=i(" special method."),vc=p(),y(ft.$$.fragment),kc=p(),y(ut.$$.fragment),cr=p(),xe=n("h2"),gt=n("a"),ea=n("span"),y(No.$$.fragment),wc=p(),ta=n("span"),Ec=i("EsmForProteinFolding"),mr=p(),I=n("div"),y(Wo.$$.fragment),$c=p(),oa=n("p"),Fc=i(`ESMForProteinFolding is the HuggingFace port of the original ESMFold model. It consists of an ESM-2 \u201Cstem\u201D followed
by a protein folding \u201Chead\u201D, although unlike most other output heads, this \u201Chead\u201D is similar in size and runtime to
the rest of the model combined! It outputs a dictionary containing predicted structural information about the input
protein(s).`),zc=p(),Io=n("p"),Jc=i("This model inherits from "),Rn=n("a"),jc=i("PreTrainedModel"),Uc=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Cc=p(),xo=n("p"),Zc=i("This model is also a PyTorch "),qo=n("a"),Nc=i("torch.nn.Module"),Wc=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ic=p(),te=n("div"),y(So.$$.fragment),xc=p(),qe=n("p"),qc=i("The "),Vn=n("a"),Sc=i("EsmForProteinFolding"),Rc=i(" forward method, overrides the "),na=n("code"),Vc=i("__call__"),Gc=i(" special method."),Bc=p(),y(_t.$$.fragment),Ac=p(),y(bt.$$.fragment),pr=p(),Se=n("h2"),Tt=n("a"),sa=n("span"),y(Ro.$$.fragment),Pc=p(),aa=n("span"),Xc=i("TFEsmModel"),hr=p(),x=n("div"),y(Vo.$$.fragment),Lc=p(),ra=n("p"),Yc=i("The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),Hc=p(),Go=n("p"),Dc=i("This model inherits from "),Gn=n("a"),Qc=i("TFPreTrainedModel"),Oc=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Kc=p(),Bo=n("p"),em=i("This model is also a Keras "),Ao=n("a"),tm=i("Model"),om=i(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),nm=p(),oe=n("div"),y(Po.$$.fragment),sm=p(),Re=n("p"),am=i("The "),Bn=n("a"),rm=i("TFEsmModel"),im=i(" forward method, overrides the "),ia=n("code"),lm=i("__call__"),dm=i(" special method."),cm=p(),y(yt.$$.fragment),mm=p(),y(Mt.$$.fragment),fr=p(),Ve=n("h2"),vt=n("a"),la=n("span"),y(Xo.$$.fragment),pm=p(),da=n("span"),hm=i("TFEsmForMaskedLM"),ur=p(),q=n("div"),y(Lo.$$.fragment),fm=p(),Yo=n("p"),um=i("ESM Model with a "),ca=n("code"),gm=i("language modeling"),_m=i(" head on top."),bm=p(),Ho=n("p"),Tm=i("This model inherits from "),An=n("a"),ym=i("TFPreTrainedModel"),Mm=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),vm=p(),Do=n("p"),km=i("This model is also a Keras "),Qo=n("a"),wm=i("Model"),Em=i(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),$m=p(),G=n("div"),y(Oo.$$.fragment),Fm=p(),Ge=n("p"),zm=i("The "),Pn=n("a"),Jm=i("TFEsmForMaskedLM"),jm=i(" forward method, overrides the "),ma=n("code"),Um=i("__call__"),Cm=i(" special method."),Zm=p(),y(kt.$$.fragment),Nm=p(),y(wt.$$.fragment),Wm=p(),y(Et.$$.fragment),gr=p(),Be=n("h2"),$t=n("a"),pa=n("span"),y(Ko.$$.fragment),Im=p(),ha=n("span"),xm=i("TFEsmForSequenceClassification"),_r=p(),S=n("div"),y(en.$$.fragment),qm=p(),fa=n("p"),Sm=i(`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Rm=p(),tn=n("p"),Vm=i("This model inherits from "),Xn=n("a"),Gm=i("TFPreTrainedModel"),Bm=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Am=p(),on=n("p"),Pm=i("This model is also a Keras "),nn=n("a"),Xm=i("Model"),Lm=i(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Ym=p(),B=n("div"),y(sn.$$.fragment),Hm=p(),Ae=n("p"),Dm=i("The "),Ln=n("a"),Qm=i("TFEsmForSequenceClassification"),Om=i(" forward method, overrides the "),ua=n("code"),Km=i("__call__"),ep=i(" special method."),tp=p(),y(Ft.$$.fragment),op=p(),y(zt.$$.fragment),np=p(),y(Jt.$$.fragment),br=p(),Pe=n("h2"),jt=n("a"),ga=n("span"),y(an.$$.fragment),sp=p(),_a=n("span"),ap=i("TFEsmForTokenClassification"),Tr=p(),R=n("div"),y(rn.$$.fragment),rp=p(),ba=n("p"),ip=i(`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),lp=p(),ln=n("p"),dp=i("This model inherits from "),Yn=n("a"),cp=i("TFPreTrainedModel"),mp=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pp=p(),dn=n("p"),hp=i("This model is also a Keras "),cn=n("a"),fp=i("Model"),up=i(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),gp=p(),A=n("div"),y(mn.$$.fragment),_p=p(),Xe=n("p"),bp=i("The "),Hn=n("a"),Tp=i("TFEsmForTokenClassification"),yp=i(" forward method, overrides the "),Ta=n("code"),Mp=i("__call__"),vp=i(" special method."),kp=p(),y(Ut.$$.fragment),wp=p(),y(Ct.$$.fragment),Ep=p(),y(Zt.$$.fragment),this.h()},l(t){const g=Wf('[data-svelte="svelte-1phssyn"]',document.head);d=s(g,"META",{name:!0,content:!0}),g.forEach(o),b=h(t),c=s(t,"H1",{class:!0});var pn=a(c);u=s(pn,"A",{id:!0,class:!0,href:!0});var ya=a(u);T=s(ya,"SPAN",{});var Ma=a(T);M(r.$$.fragment,Ma),Ma.forEach(o),ya.forEach(o),f=h(pn),F=s(pn,"SPAN",{});var va=a(F);ni=l(va,"ESM"),va.forEach(o),pn.forEach(o),qa=h(t),ve=s(t,"H2",{class:!0});var hn=a(ve);Ye=s(hn,"A",{id:!0,class:!0,href:!0});var ka=a(Ye);ps=s(ka,"SPAN",{});var wa=a(ps);M(St.$$.fragment,wa),wa.forEach(o),ka.forEach(o),si=h(hn),hs=s(hn,"SPAN",{});var Ea=a(hs);ai=l(Ea,"Overview"),Ea.forEach(o),hn.forEach(o),Sa=l(t,`

This page provides code and pre-trained weights for Transformer protein language models from Meta AI's Fundamental 
AI Research Team, providing the state-of-the-art ESMFold and ESM-2, and the previously released ESM-1b and ESM-1v.
Transformer protein language models were introduced in the paper [Biological structure and function emerge from scaling
unsupervised learning to 250 million protein sequences](https://www.pnas.org/content/118/15/e2016239118) by 
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, 
C. Lawrence Zitnick, Jerry Ma, and Rob Fergus.
The first version of this paper was [preprinted in 2019](https://www.biorxiv.org/content/10.1101/622803v1?versioned=true).
`),He=s(t,"P",{});var fn=a(He);ri=l(fn,`ESM-2 outperforms all tested single-sequence protein language models across a range of structure prediction tasks,
and enables atomic resolution structure prediction.
It was released with the paper `),Rt=s(fn,"A",{href:!0,rel:!0});var $a=a(Rt);ii=l($a,`Language models of protein sequences at the scale of evolution enable accurate
structure prediction`),$a.forEach(o),li=l(fn,` by Zeming Lin, Halil Akin, Roshan Rao, Brian Hie,
Zhongkai Zhu, Wenting Lu, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Sal Candido and Alexander Rives.`),fn.forEach(o),Ra=h(t),De=s(t,"P",{});var un=a(De);di=l(un,`Also introduced in this paper was ESMFold. It uses an ESM-2 stem with a head that can predict folded protein
structures with state-of-the-art accuracy. Unlike `),Vt=s(un,"A",{href:!0,rel:!0});var Fa=a(Vt);ci=l(Fa,"AlphaFold2"),Fa.forEach(o),mi=l(un,`,
it relies on the token embeddings from the large pre-trained protein language model stem and does not perform a multiple
sequence alignment (MSA) step at inference time, which means that ESMFold checkpoints are fully \u201Cstandalone\u201D -
they do not require a database of known protein sequences and structures with associated external query tools
to make predictions, and are much faster as a result.`),un.forEach(o),Va=h(t),gn=s(t,"P",{});var za=a(gn);pi=l(za,`The abstract from
\u201CBiological structure and function emerge from scaling unsupervised learning to 250
million protein sequences\u201D is`),za.forEach(o),Ga=h(t),_n=s(t,"P",{});var Ja=a(_n);fs=s(Ja,"EM",{});var ja=a(fs);hi=l(ja,`In the field of artificial intelligence, a combination of scale in data and model capacity enabled by unsupervised
learning has led to major advances in representation learning and statistical generation. In the life sciences, the
anticipated growth of sequencing promises unprecedented data on natural sequence diversity. Protein language modeling
at the scale of evolution is a logical step toward predictive and generative artificial intelligence for biology. To
this end, we use unsupervised learning to train a deep contextual language model on 86 billion amino acids across 250
million protein sequences spanning evolutionary diversity. The resulting model contains information about biological
properties in its representations. The representations are learned from sequence data alone. The learned representation
space has a multiscale organization reflecting structure from the level of biochemical properties of amino acids to
remote homology of proteins. Information about secondary and tertiary structure is encoded in the representations and
can be identified by linear projections. Representation learning produces features that generalize across a range of
applications, enabling state-of-the-art supervised prediction of mutational effect and secondary structure and
improving state-of-the-art features for long-range contact prediction.`),ja.forEach(o),Ja.forEach(o),Ba=h(t),bn=s(t,"P",{});var Ua=a(bn);fi=l(Ua,`The abstract from
\u201CLanguage models of protein sequences at the scale of evolution enable accurate structure prediction\u201D is`),Ua.forEach(o),Aa=h(t),Tn=s(t,"P",{});var Ca=a(Tn);us=s(Ca,"EM",{});var Za=a(us);ui=l(Za,`Large language models have recently been shown to develop emergent capabilities with scale, going beyond
simple pattern matching to perform higher level reasoning and generate lifelike images and text. While
language models trained on protein sequences have been studied at a smaller scale, little is known about
what they learn about biology as they are scaled up. In this work we train models up to 15 billion parameters,
the largest language models of proteins to be evaluated to date. We find that as models are scaled they learn
information enabling the prediction of the three-dimensional structure of a protein at the resolution of
individual atoms. We present ESMFold for high accuracy end-to-end atomic level structure prediction directly
from the individual sequence of a protein. ESMFold has similar accuracy to AlphaFold2 and RoseTTAFold for
sequences with low perplexity that are well understood by the language model. ESMFold inference is an
order of magnitude faster than AlphaFold2, enabling exploration of the structural space of metagenomic
proteins in practical timescales.`),Za.forEach(o),Ca.forEach(o),Pa=h(t),yn=s(t,"P",{});var Na=a(yn);gi=l(Na,"Tips:"),Na.forEach(o),Xa=h(t),Mn=s(t,"UL",{});var Wa=a(Mn);gs=s(Wa,"LI",{});var Ia=a(gs);_i=l(Ia,"ESM models are trained with a masked language modeling (MLM) objective."),Ia.forEach(o),Wa.forEach(o),La=h(t),Q=s(t,"P",{});var se=a(Q);bi=l(se,"The original code can be found "),Gt=s(se,"A",{href:!0,rel:!0});var xa=a(Gt);Ti=l(xa,"here"),xa.forEach(o),yi=l(se,` and was
was developed by the Fundamental AI Research team at Meta AI.
ESM-1b, ESM-1v and ESM-2 were contributed to huggingface by `),Bt=s(se,"A",{href:!0,rel:!0});var Fp=a(Bt);Mi=l(Fp,"jasonliu"),Fp.forEach(o),vi=l(se,`
and `),At=s(se,"A",{href:!0,rel:!0});var zp=a(At);ki=l(zp,"Matt"),zp.forEach(o),wi=l(se,"."),se.forEach(o),Ya=h(t),ae=s(t,"P",{});var Dn=a(ae);Ei=l(Dn,"ESMFold was contributed to huggingface by "),Pt=s(Dn,"A",{href:!0,rel:!0});var Jp=a(Pt);$i=l(Jp,"Matt"),Jp.forEach(o),Fi=l(Dn,` and
`),Xt=s(Dn,"A",{href:!0,rel:!0});var jp=a(Xt);zi=l(jp,"Sylvain"),jp.forEach(o),Ji=l(Dn,`, with a big thank you to Nikita Smetanin, Roshan Rao and Tom Sercu for their
help throughout the process!`),Dn.forEach(o),Ha=h(t),re=s(t,"P",{});var Qn=a(re);ji=l(Qn,"The HuggingFace port of ESMFold uses portions of the "),Lt=s(Qn,"A",{href:!0,rel:!0});var Up=a(Lt);Ui=l(Up,"openfold"),Up.forEach(o),Ci=l(Qn,` library.
The `),_s=s(Qn,"CODE",{});var Cp=a(_s);Zi=l(Cp,"openfold"),Cp.forEach(o),Ni=l(Qn," library is licensed under the Apache License 2.0."),Qn.forEach(o),Da=h(t),ke=s(t,"H2",{class:!0});var Mr=a(ke);Qe=s(Mr,"A",{id:!0,class:!0,href:!0});var Zp=a(Qe);bs=s(Zp,"SPAN",{});var Np=a(bs);M(Yt.$$.fragment,Np),Np.forEach(o),Zp.forEach(o),Wi=h(Mr),Ts=s(Mr,"SPAN",{});var Wp=a(Ts);Ii=l(Wp,"Documentation resources"),Wp.forEach(o),Mr.forEach(o),Qa=h(t),ie=s(t,"UL",{});var On=a(ie);ys=s(On,"LI",{});var Ip=a(ys);vn=s(Ip,"A",{href:!0});var xp=a(vn);xi=l(xp,"Text classification task guide"),xp.forEach(o),Ip.forEach(o),qi=h(On),Ms=s(On,"LI",{});var qp=a(Ms);kn=s(qp,"A",{href:!0});var Sp=a(kn);Si=l(Sp,"Token classification task guide"),Sp.forEach(o),qp.forEach(o),Ri=h(On),vs=s(On,"LI",{});var Rp=a(vs);wn=s(Rp,"A",{href:!0});var Vp=a(wn);Vi=l(Vp,"Masked language modeling task guide"),Vp.forEach(o),Rp.forEach(o),On.forEach(o),Oa=h(t),we=s(t,"H2",{class:!0});var vr=a(we);Oe=s(vr,"A",{id:!0,class:!0,href:!0});var Gp=a(Oe);ks=s(Gp,"SPAN",{});var Bp=a(ks);M(Ht.$$.fragment,Bp),Bp.forEach(o),Gp.forEach(o),Gi=h(vr),ws=s(vr,"SPAN",{});var Ap=a(ws);Bi=l(Ap,"EsmConfig"),Ap.forEach(o),vr.forEach(o),Ka=h(t),C=s(t,"DIV",{class:!0});var de=a(C);M(Dt.$$.fragment,de),Ai=h(de),Ee=s(de,"P",{});var Kn=a(Ee);Pi=l(Kn,"This is the configuration class to store the configuration of a "),Es=s(Kn,"CODE",{});var Pp=a(Es);Xi=l(Pp,"ESMModel"),Pp.forEach(o),Li=l(Kn,`. It is used to instantiate a ESM 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 ESM
`),Qt=s(Kn,"A",{href:!0,rel:!0});var Xp=a(Qt);Yi=l(Xp,"facebook/esm-1b"),Xp.forEach(o),Hi=l(Kn," architecture."),Kn.forEach(o),Di=h(de),$e=s(de,"P",{});var es=a($e);Qi=l(es,"Configuration objects inherit from "),En=s(es,"A",{href:!0});var Lp=a(En);Oi=l(Lp,"PretrainedConfig"),Lp.forEach(o),Ki=l(es,` and can be used to control the model outputs. Read the
documentation from `),$n=s(es,"A",{href:!0});var Yp=a($n);el=l(Yp,"PretrainedConfig"),Yp.forEach(o),tl=l(es," for more information."),es.forEach(o),ol=h(de),M(Ke.$$.fragment,de),nl=h(de),et=s(de,"DIV",{class:!0});var kr=a(et);M(Ot.$$.fragment,kr),sl=h(kr),Kt=s(kr,"P",{});var wr=a(Kt);al=l(wr,"Serializes this instance to a Python dictionary. Override the default "),Fn=s(wr,"A",{href:!0});var Hp=a(Fn);rl=l(Hp,"to_dict()"),Hp.forEach(o),il=l(wr,"."),wr.forEach(o),kr.forEach(o),de.forEach(o),er=h(t),Fe=s(t,"H2",{class:!0});var Er=a(Fe);tt=s(Er,"A",{id:!0,class:!0,href:!0});var Dp=a(tt);$s=s(Dp,"SPAN",{});var Qp=a($s);M(eo.$$.fragment,Qp),Qp.forEach(o),Dp.forEach(o),ll=h(Er),Fs=s(Er,"SPAN",{});var Op=a(Fs);dl=l(Op,"EsmTokenizer"),Op.forEach(o),Er.forEach(o),tr=h(t),j=s(t,"DIV",{class:!0});var ne=a(j);M(to.$$.fragment,ne),cl=h(ne),zs=s(ne,"P",{});var Kp=a(zs);ml=l(Kp,"Constructs an ESM tokenizer."),Kp.forEach(o),pl=h(ne),zn=s(ne,"DIV",{class:!0});var eh=a(zn);M(oo.$$.fragment,eh),eh.forEach(o),hl=h(ne),ot=s(ne,"DIV",{class:!0});var $r=a(ot);M(no.$$.fragment,$r),fl=h($r),ze=s($r,"P",{});var ts=a(ze);ul=l(ts,`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Js=s(ts,"CODE",{});var th=a(Js);gl=l(th,"prepare_for_model"),th.forEach(o),_l=l(ts," or "),js=s(ts,"CODE",{});var oh=a(js);bl=l(oh,"encode_plus"),oh.forEach(o),Tl=l(ts," methods."),ts.forEach(o),$r.forEach(o),yl=h(ne),le=s(ne,"DIV",{class:!0});var os=a(le);M(so.$$.fragment,os),Ml=h(os),Jn=s(os,"P",{});var $p=a(Jn);vl=l($p,"Create the token type IDs corresponding to the sequences passed. "),jn=s($p,"A",{href:!0});var nh=a(jn);kl=l(nh,`What are token type
IDs?`),nh.forEach(o),$p.forEach(o),wl=h(os),Us=s(os,"P",{});var sh=a(Us);El=l(sh,"Should be overridden in a subclass if the model has a special way of building those."),sh.forEach(o),os.forEach(o),$l=h(ne),Un=s(ne,"DIV",{class:!0});var ah=a(Un);M(ao.$$.fragment,ah),ah.forEach(o),ne.forEach(o),or=h(t),Je=s(t,"H2",{class:!0});var Fr=a(Je);nt=s(Fr,"A",{id:!0,class:!0,href:!0});var rh=a(nt);Cs=s(rh,"SPAN",{});var ih=a(Cs);M(ro.$$.fragment,ih),ih.forEach(o),rh.forEach(o),Fl=h(Fr),Zs=s(Fr,"SPAN",{});var lh=a(Zs);zl=l(lh,"EsmModel"),lh.forEach(o),Fr.forEach(o),nr=h(t),J=s(t,"DIV",{class:!0});var P=a(J);M(io.$$.fragment,P),Jl=h(P),Ns=s(P,"P",{});var dh=a(Ns);jl=l(dh,"The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),dh.forEach(o),Ul=h(P),lo=s(P,"P",{});var zr=a(lo);Cl=l(zr,"This model inherits from "),Cn=s(zr,"A",{href:!0});var ch=a(Cn);Zl=l(ch,"PreTrainedModel"),ch.forEach(o),Nl=l(zr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),zr.forEach(o),Wl=h(P),co=s(P,"P",{});var Jr=a(co);Il=l(Jr,"This model is also a PyTorch "),mo=s(Jr,"A",{href:!0,rel:!0});var mh=a(mo);xl=l(mh,"torch.nn.Module"),mh.forEach(o),ql=l(Jr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Jr.forEach(o),Sl=h(P),po=s(P,"P",{});var jr=a(po);Rl=l(jr,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),ho=s(jr,"A",{href:!0,rel:!0});var ph=a(ho);Vl=l(ph,`Attention is
all you need`),ph.forEach(o),Gl=l(jr,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),jr.forEach(o),Bl=h(P),U=s(P,"P",{});var X=a(U);Al=l(X,"To behave as an decoder the model needs to be initialized with the "),Ws=s(X,"CODE",{});var hh=a(Ws);Pl=l(hh,"is_decoder"),hh.forEach(o),Xl=l(X,` argument of the configuration set
to `),Is=s(X,"CODE",{});var fh=a(Is);Ll=l(fh,"True"),fh.forEach(o),Yl=l(X,". To be used in a Seq2Seq model, the model needs to initialized with both "),xs=s(X,"CODE",{});var uh=a(xs);Hl=l(uh,"is_decoder"),uh.forEach(o),Dl=l(X,` argument and
`),qs=s(X,"CODE",{});var gh=a(qs);Ql=l(gh,"add_cross_attention"),gh.forEach(o),Ol=l(X," set to "),Ss=s(X,"CODE",{});var _h=a(Ss);Kl=l(_h,"True"),_h.forEach(o),ed=l(X,"; an "),Rs=s(X,"CODE",{});var bh=a(Rs);td=l(bh,"encoder_hidden_states"),bh.forEach(o),od=l(X," is then expected as an input to the forward pass."),X.forEach(o),nd=h(P),O=s(P,"DIV",{class:!0});var Nt=a(O);M(fo.$$.fragment,Nt),sd=h(Nt),je=s(Nt,"P",{});var ns=a(je);ad=l(ns,"The "),Zn=s(ns,"A",{href:!0});var Th=a(Zn);rd=l(Th,"EsmModel"),Th.forEach(o),id=l(ns," forward method, overrides the "),Vs=s(ns,"CODE",{});var yh=a(Vs);ld=l(yh,"__call__"),yh.forEach(o),dd=l(ns," special method."),ns.forEach(o),cd=h(Nt),M(st.$$.fragment,Nt),md=h(Nt),M(at.$$.fragment,Nt),Nt.forEach(o),P.forEach(o),sr=h(t),Ue=s(t,"H2",{class:!0});var Ur=a(Ue);rt=s(Ur,"A",{id:!0,class:!0,href:!0});var Mh=a(rt);Gs=s(Mh,"SPAN",{});var vh=a(Gs);M(uo.$$.fragment,vh),vh.forEach(o),Mh.forEach(o),pd=h(Ur),Bs=s(Ur,"SPAN",{});var kh=a(Bs);hd=l(kh,"EsmForMaskedLM"),kh.forEach(o),Ur.forEach(o),ar=h(t),Z=s(t,"DIV",{class:!0});var ce=a(Z);M(go.$$.fragment,ce),fd=h(ce),_o=s(ce,"P",{});var Cr=a(_o);ud=l(Cr,"ESM Model with a "),As=s(Cr,"CODE",{});var wh=a(As);gd=l(wh,"language modeling"),wh.forEach(o),_d=l(Cr," head on top."),Cr.forEach(o),bd=h(ce),bo=s(ce,"P",{});var Zr=a(bo);Td=l(Zr,"This model inherits from "),Nn=s(Zr,"A",{href:!0});var Eh=a(Nn);yd=l(Eh,"PreTrainedModel"),Eh.forEach(o),Md=l(Zr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zr.forEach(o),vd=h(ce),To=s(ce,"P",{});var Nr=a(To);kd=l(Nr,"This model is also a PyTorch "),yo=s(Nr,"A",{href:!0,rel:!0});var $h=a(yo);wd=l($h,"torch.nn.Module"),$h.forEach(o),Ed=l(Nr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Nr.forEach(o),$d=h(ce),K=s(ce,"DIV",{class:!0});var Wt=a(K);M(Mo.$$.fragment,Wt),Fd=h(Wt),Ce=s(Wt,"P",{});var ss=a(Ce);zd=l(ss,"The "),Wn=s(ss,"A",{href:!0});var Fh=a(Wn);Jd=l(Fh,"EsmForMaskedLM"),Fh.forEach(o),jd=l(ss," forward method, overrides the "),Ps=s(ss,"CODE",{});var zh=a(Ps);Ud=l(zh,"__call__"),zh.forEach(o),Cd=l(ss," special method."),ss.forEach(o),Zd=h(Wt),M(it.$$.fragment,Wt),Nd=h(Wt),M(lt.$$.fragment,Wt),Wt.forEach(o),ce.forEach(o),rr=h(t),Ze=s(t,"H2",{class:!0});var Wr=a(Ze);dt=s(Wr,"A",{id:!0,class:!0,href:!0});var Jh=a(dt);Xs=s(Jh,"SPAN",{});var jh=a(Xs);M(vo.$$.fragment,jh),jh.forEach(o),Jh.forEach(o),Wd=h(Wr),Ls=s(Wr,"SPAN",{});var Uh=a(Ls);Id=l(Uh,"EsmForSequenceClassification"),Uh.forEach(o),Wr.forEach(o),ir=h(t),N=s(t,"DIV",{class:!0});var me=a(N);M(ko.$$.fragment,me),xd=h(me),Ys=s(me,"P",{});var Ch=a(Ys);qd=l(Ch,`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Ch.forEach(o),Sd=h(me),wo=s(me,"P",{});var Ir=a(wo);Rd=l(Ir,"This model inherits from "),In=s(Ir,"A",{href:!0});var Zh=a(In);Vd=l(Zh,"PreTrainedModel"),Zh.forEach(o),Gd=l(Ir,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ir.forEach(o),Bd=h(me),Eo=s(me,"P",{});var xr=a(Eo);Ad=l(xr,"This model is also a PyTorch "),$o=s(xr,"A",{href:!0,rel:!0});var Nh=a($o);Pd=l(Nh,"torch.nn.Module"),Nh.forEach(o),Xd=l(xr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xr.forEach(o),Ld=h(me),V=s(me,"DIV",{class:!0});var pe=a(V);M(Fo.$$.fragment,pe),Yd=h(pe),Ne=s(pe,"P",{});var as=a(Ne);Hd=l(as,"The "),xn=s(as,"A",{href:!0});var Wh=a(xn);Dd=l(Wh,"EsmForSequenceClassification"),Wh.forEach(o),Qd=l(as," forward method, overrides the "),Hs=s(as,"CODE",{});var Ih=a(Hs);Od=l(Ih,"__call__"),Ih.forEach(o),Kd=l(as," special method."),as.forEach(o),ec=h(pe),M(ct.$$.fragment,pe),tc=h(pe),M(mt.$$.fragment,pe),oc=h(pe),M(pt.$$.fragment,pe),pe.forEach(o),me.forEach(o),lr=h(t),We=s(t,"H2",{class:!0});var qr=a(We);ht=s(qr,"A",{id:!0,class:!0,href:!0});var xh=a(ht);Ds=s(xh,"SPAN",{});var qh=a(Ds);M(zo.$$.fragment,qh),qh.forEach(o),xh.forEach(o),nc=h(qr),Qs=s(qr,"SPAN",{});var Sh=a(Qs);sc=l(Sh,"EsmForTokenClassification"),Sh.forEach(o),qr.forEach(o),dr=h(t),W=s(t,"DIV",{class:!0});var he=a(W);M(Jo.$$.fragment,he),ac=h(he),Os=s(he,"P",{});var Rh=a(Os);rc=l(Rh,`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Rh.forEach(o),ic=h(he),jo=s(he,"P",{});var Sr=a(jo);lc=l(Sr,"This model inherits from "),qn=s(Sr,"A",{href:!0});var Vh=a(qn);dc=l(Vh,"PreTrainedModel"),Vh.forEach(o),cc=l(Sr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Sr.forEach(o),mc=h(he),Uo=s(he,"P",{});var Rr=a(Uo);pc=l(Rr,"This model is also a PyTorch "),Co=s(Rr,"A",{href:!0,rel:!0});var Gh=a(Co);hc=l(Gh,"torch.nn.Module"),Gh.forEach(o),fc=l(Rr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rr.forEach(o),uc=h(he),ee=s(he,"DIV",{class:!0});var It=a(ee);M(Zo.$$.fragment,It),gc=h(It),Ie=s(It,"P",{});var rs=a(Ie);_c=l(rs,"The "),Sn=s(rs,"A",{href:!0});var Bh=a(Sn);bc=l(Bh,"EsmForTokenClassification"),Bh.forEach(o),Tc=l(rs," forward method, overrides the "),Ks=s(rs,"CODE",{});var Ah=a(Ks);yc=l(Ah,"__call__"),Ah.forEach(o),Mc=l(rs," special method."),rs.forEach(o),vc=h(It),M(ft.$$.fragment,It),kc=h(It),M(ut.$$.fragment,It),It.forEach(o),he.forEach(o),cr=h(t),xe=s(t,"H2",{class:!0});var Vr=a(xe);gt=s(Vr,"A",{id:!0,class:!0,href:!0});var Ph=a(gt);ea=s(Ph,"SPAN",{});var Xh=a(ea);M(No.$$.fragment,Xh),Xh.forEach(o),Ph.forEach(o),wc=h(Vr),ta=s(Vr,"SPAN",{});var Lh=a(ta);Ec=l(Lh,"EsmForProteinFolding"),Lh.forEach(o),Vr.forEach(o),mr=h(t),I=s(t,"DIV",{class:!0});var fe=a(I);M(Wo.$$.fragment,fe),$c=h(fe),oa=s(fe,"P",{});var Yh=a(oa);Fc=l(Yh,`ESMForProteinFolding is the HuggingFace port of the original ESMFold model. It consists of an ESM-2 \u201Cstem\u201D followed
by a protein folding \u201Chead\u201D, although unlike most other output heads, this \u201Chead\u201D is similar in size and runtime to
the rest of the model combined! It outputs a dictionary containing predicted structural information about the input
protein(s).`),Yh.forEach(o),zc=h(fe),Io=s(fe,"P",{});var Gr=a(Io);Jc=l(Gr,"This model inherits from "),Rn=s(Gr,"A",{href:!0});var Hh=a(Rn);jc=l(Hh,"PreTrainedModel"),Hh.forEach(o),Uc=l(Gr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gr.forEach(o),Cc=h(fe),xo=s(fe,"P",{});var Br=a(xo);Zc=l(Br,"This model is also a PyTorch "),qo=s(Br,"A",{href:!0,rel:!0});var Dh=a(qo);Nc=l(Dh,"torch.nn.Module"),Dh.forEach(o),Wc=l(Br,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Br.forEach(o),Ic=h(fe),te=s(fe,"DIV",{class:!0});var xt=a(te);M(So.$$.fragment,xt),xc=h(xt),qe=s(xt,"P",{});var is=a(qe);qc=l(is,"The "),Vn=s(is,"A",{href:!0});var Qh=a(Vn);Sc=l(Qh,"EsmForProteinFolding"),Qh.forEach(o),Rc=l(is," forward method, overrides the "),na=s(is,"CODE",{});var Oh=a(na);Vc=l(Oh,"__call__"),Oh.forEach(o),Gc=l(is," special method."),is.forEach(o),Bc=h(xt),M(_t.$$.fragment,xt),Ac=h(xt),M(bt.$$.fragment,xt),xt.forEach(o),fe.forEach(o),pr=h(t),Se=s(t,"H2",{class:!0});var Ar=a(Se);Tt=s(Ar,"A",{id:!0,class:!0,href:!0});var Kh=a(Tt);sa=s(Kh,"SPAN",{});var ef=a(sa);M(Ro.$$.fragment,ef),ef.forEach(o),Kh.forEach(o),Pc=h(Ar),aa=s(Ar,"SPAN",{});var tf=a(aa);Xc=l(tf,"TFEsmModel"),tf.forEach(o),Ar.forEach(o),hr=h(t),x=s(t,"DIV",{class:!0});var ue=a(x);M(Vo.$$.fragment,ue),Lc=h(ue),ra=s(ue,"P",{});var of=a(ra);Yc=l(of,"The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),of.forEach(o),Hc=h(ue),Go=s(ue,"P",{});var Pr=a(Go);Dc=l(Pr,"This model inherits from "),Gn=s(Pr,"A",{href:!0});var nf=a(Gn);Qc=l(nf,"TFPreTrainedModel"),nf.forEach(o),Oc=l(Pr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Pr.forEach(o),Kc=h(ue),Bo=s(ue,"P",{});var Xr=a(Bo);em=l(Xr,"This model is also a Keras "),Ao=s(Xr,"A",{href:!0,rel:!0});var sf=a(Ao);tm=l(sf,"Model"),sf.forEach(o),om=l(Xr,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Xr.forEach(o),nm=h(ue),oe=s(ue,"DIV",{class:!0});var qt=a(oe);M(Po.$$.fragment,qt),sm=h(qt),Re=s(qt,"P",{});var ls=a(Re);am=l(ls,"The "),Bn=s(ls,"A",{href:!0});var af=a(Bn);rm=l(af,"TFEsmModel"),af.forEach(o),im=l(ls," forward method, overrides the "),ia=s(ls,"CODE",{});var rf=a(ia);lm=l(rf,"__call__"),rf.forEach(o),dm=l(ls," special method."),ls.forEach(o),cm=h(qt),M(yt.$$.fragment,qt),mm=h(qt),M(Mt.$$.fragment,qt),qt.forEach(o),ue.forEach(o),fr=h(t),Ve=s(t,"H2",{class:!0});var Lr=a(Ve);vt=s(Lr,"A",{id:!0,class:!0,href:!0});var lf=a(vt);la=s(lf,"SPAN",{});var df=a(la);M(Xo.$$.fragment,df),df.forEach(o),lf.forEach(o),pm=h(Lr),da=s(Lr,"SPAN",{});var cf=a(da);hm=l(cf,"TFEsmForMaskedLM"),cf.forEach(o),Lr.forEach(o),ur=h(t),q=s(t,"DIV",{class:!0});var ge=a(q);M(Lo.$$.fragment,ge),fm=h(ge),Yo=s(ge,"P",{});var Yr=a(Yo);um=l(Yr,"ESM Model with a "),ca=s(Yr,"CODE",{});var mf=a(ca);gm=l(mf,"language modeling"),mf.forEach(o),_m=l(Yr," head on top."),Yr.forEach(o),bm=h(ge),Ho=s(ge,"P",{});var Hr=a(Ho);Tm=l(Hr,"This model inherits from "),An=s(Hr,"A",{href:!0});var pf=a(An);ym=l(pf,"TFPreTrainedModel"),pf.forEach(o),Mm=l(Hr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Hr.forEach(o),vm=h(ge),Do=s(ge,"P",{});var Dr=a(Do);km=l(Dr,"This model is also a Keras "),Qo=s(Dr,"A",{href:!0,rel:!0});var hf=a(Qo);wm=l(hf,"Model"),hf.forEach(o),Em=l(Dr,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Dr.forEach(o),$m=h(ge),G=s(ge,"DIV",{class:!0});var _e=a(G);M(Oo.$$.fragment,_e),Fm=h(_e),Ge=s(_e,"P",{});var ds=a(Ge);zm=l(ds,"The "),Pn=s(ds,"A",{href:!0});var ff=a(Pn);Jm=l(ff,"TFEsmForMaskedLM"),ff.forEach(o),jm=l(ds," forward method, overrides the "),ma=s(ds,"CODE",{});var uf=a(ma);Um=l(uf,"__call__"),uf.forEach(o),Cm=l(ds," special method."),ds.forEach(o),Zm=h(_e),M(kt.$$.fragment,_e),Nm=h(_e),M(wt.$$.fragment,_e),Wm=h(_e),M(Et.$$.fragment,_e),_e.forEach(o),ge.forEach(o),gr=h(t),Be=s(t,"H2",{class:!0});var Qr=a(Be);$t=s(Qr,"A",{id:!0,class:!0,href:!0});var gf=a($t);pa=s(gf,"SPAN",{});var _f=a(pa);M(Ko.$$.fragment,_f),_f.forEach(o),gf.forEach(o),Im=h(Qr),ha=s(Qr,"SPAN",{});var bf=a(ha);xm=l(bf,"TFEsmForSequenceClassification"),bf.forEach(o),Qr.forEach(o),_r=h(t),S=s(t,"DIV",{class:!0});var be=a(S);M(en.$$.fragment,be),qm=h(be),fa=s(be,"P",{});var Tf=a(fa);Sm=l(Tf,`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Tf.forEach(o),Rm=h(be),tn=s(be,"P",{});var Or=a(tn);Vm=l(Or,"This model inherits from "),Xn=s(Or,"A",{href:!0});var yf=a(Xn);Gm=l(yf,"TFPreTrainedModel"),yf.forEach(o),Bm=l(Or,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Or.forEach(o),Am=h(be),on=s(be,"P",{});var Kr=a(on);Pm=l(Kr,"This model is also a Keras "),nn=s(Kr,"A",{href:!0,rel:!0});var Mf=a(nn);Xm=l(Mf,"Model"),Mf.forEach(o),Lm=l(Kr,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Kr.forEach(o),Ym=h(be),B=s(be,"DIV",{class:!0});var Te=a(B);M(sn.$$.fragment,Te),Hm=h(Te),Ae=s(Te,"P",{});var cs=a(Ae);Dm=l(cs,"The "),Ln=s(cs,"A",{href:!0});var vf=a(Ln);Qm=l(vf,"TFEsmForSequenceClassification"),vf.forEach(o),Om=l(cs," forward method, overrides the "),ua=s(cs,"CODE",{});var kf=a(ua);Km=l(kf,"__call__"),kf.forEach(o),ep=l(cs," special method."),cs.forEach(o),tp=h(Te),M(Ft.$$.fragment,Te),op=h(Te),M(zt.$$.fragment,Te),np=h(Te),M(Jt.$$.fragment,Te),Te.forEach(o),be.forEach(o),br=h(t),Pe=s(t,"H2",{class:!0});var ei=a(Pe);jt=s(ei,"A",{id:!0,class:!0,href:!0});var wf=a(jt);ga=s(wf,"SPAN",{});var Ef=a(ga);M(an.$$.fragment,Ef),Ef.forEach(o),wf.forEach(o),sp=h(ei),_a=s(ei,"SPAN",{});var $f=a(_a);ap=l($f,"TFEsmForTokenClassification"),$f.forEach(o),ei.forEach(o),Tr=h(t),R=s(t,"DIV",{class:!0});var ye=a(R);M(rn.$$.fragment,ye),rp=h(ye),ba=s(ye,"P",{});var Ff=a(ba);ip=l(Ff,`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Ff.forEach(o),lp=h(ye),ln=s(ye,"P",{});var ti=a(ln);dp=l(ti,"This model inherits from "),Yn=s(ti,"A",{href:!0});var zf=a(Yn);cp=l(zf,"TFPreTrainedModel"),zf.forEach(o),mp=l(ti,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ti.forEach(o),pp=h(ye),dn=s(ye,"P",{});var oi=a(dn);hp=l(oi,"This model is also a Keras "),cn=s(oi,"A",{href:!0,rel:!0});var Jf=a(cn);fp=l(Jf,"Model"),Jf.forEach(o),up=l(oi,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),oi.forEach(o),gp=h(ye),A=s(ye,"DIV",{class:!0});var Me=a(A);M(mn.$$.fragment,Me),_p=h(Me),Xe=s(Me,"P",{});var ms=a(Xe);bp=l(ms,"The "),Hn=s(ms,"A",{href:!0});var jf=a(Hn);Tp=l(jf,"TFEsmForTokenClassification"),jf.forEach(o),yp=l(ms," forward method, overrides the "),Ta=s(ms,"CODE",{});var Uf=a(Ta);Mp=l(Uf,"__call__"),Uf.forEach(o),vp=l(ms," special method."),ms.forEach(o),kp=h(Me),M(Ut.$$.fragment,Me),wp=h(Me),M(Ct.$$.fragment,Me),Ep=h(Me),M(Zt.$$.fragment,Me),Me.forEach(o),ye.forEach(o),this.h()},h(){m(d,"name","hf:doc:metadata"),m(d,"content",JSON.stringify(iu)),m(u,"id","esm"),m(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(u,"href","#esm"),m(c,"class","relative group"),m(Ye,"id","overview"),m(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ye,"href","#overview"),m(ve,"class","relative group"),m(Rt,"href","https://doi.org/10.1101/2022.07.20.500902"),m(Rt,"rel","nofollow"),m(Vt,"href","https://www.nature.com/articles/s41586-021-03819-2"),m(Vt,"rel","nofollow"),m(Gt,"href","https://github.com/facebookresearch/esm"),m(Gt,"rel","nofollow"),m(Bt,"href","https://huggingface.co/jasonliu"),m(Bt,"rel","nofollow"),m(At,"href","https://huggingface.co/Rocketknight1"),m(At,"rel","nofollow"),m(Pt,"href","https://huggingface.co/Rocketknight1"),m(Pt,"rel","nofollow"),m(Xt,"href","https://huggingface.co/sgugger"),m(Xt,"rel","nofollow"),m(Lt,"href","https://github.com/aqlaboratory/openfold"),m(Lt,"rel","nofollow"),m(Qe,"id","documentation-resources"),m(Qe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Qe,"href","#documentation-resources"),m(ke,"class","relative group"),m(vn,"href","../tasks/sequence_classification"),m(kn,"href","../tasks/token_classification"),m(wn,"href","../tasks/masked_language_modeling"),m(Oe,"id","transformers.EsmConfig"),m(Oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Oe,"href","#transformers.EsmConfig"),m(we,"class","relative group"),m(Qt,"href","https://huggingface.co/facebook/esm-1b"),m(Qt,"rel","nofollow"),m(En,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),m($n,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),m(Fn,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),m(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(tt,"id","transformers.EsmTokenizer"),m(tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(tt,"href","#transformers.EsmTokenizer"),m(Fe,"class","relative group"),m(zn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(jn,"href","../glossary#token-type-ids"),m(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(nt,"id","transformers.EsmModel"),m(nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(nt,"href","#transformers.EsmModel"),m(Je,"class","relative group"),m(Cn,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),m(mo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(mo,"rel","nofollow"),m(ho,"href","https://arxiv.org/abs/1706.03762"),m(ho,"rel","nofollow"),m(Zn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmModel"),m(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(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(rt,"id","transformers.EsmForMaskedLM"),m(rt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(rt,"href","#transformers.EsmForMaskedLM"),m(Ue,"class","relative group"),m(Nn,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),m(yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(yo,"rel","nofollow"),m(Wn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmForMaskedLM"),m(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(dt,"id","transformers.EsmForSequenceClassification"),m(dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(dt,"href","#transformers.EsmForSequenceClassification"),m(Ze,"class","relative group"),m(In,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),m($o,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m($o,"rel","nofollow"),m(xn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmForSequenceClassification"),m(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ht,"id","transformers.EsmForTokenClassification"),m(ht,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ht,"href","#transformers.EsmForTokenClassification"),m(We,"class","relative group"),m(qn,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),m(Co,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(Co,"rel","nofollow"),m(Sn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmForTokenClassification"),m(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(gt,"id","transformers.EsmForProteinFolding"),m(gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(gt,"href","#transformers.EsmForProteinFolding"),m(xe,"class","relative group"),m(Rn,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),m(qo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),m(qo,"rel","nofollow"),m(Vn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.EsmForProteinFolding"),m(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Tt,"id","transformers.TFEsmModel"),m(Tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Tt,"href","#transformers.TFEsmModel"),m(Se,"class","relative group"),m(Gn,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Ao,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Ao,"rel","nofollow"),m(Bn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.TFEsmModel"),m(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(vt,"id","transformers.TFEsmForMaskedLM"),m(vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(vt,"href","#transformers.TFEsmForMaskedLM"),m(Ve,"class","relative group"),m(An,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(Qo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(Qo,"rel","nofollow"),m(Pn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.TFEsmForMaskedLM"),m(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($t,"id","transformers.TFEsmForSequenceClassification"),m($t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m($t,"href","#transformers.TFEsmForSequenceClassification"),m(Be,"class","relative group"),m(Xn,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(nn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(nn,"rel","nofollow"),m(Ln,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.TFEsmForSequenceClassification"),m(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(jt,"id","transformers.TFEsmForTokenClassification"),m(jt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(jt,"href","#transformers.TFEsmForTokenClassification"),m(Pe,"class","relative group"),m(Yn,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),m(cn,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),m(cn,"rel","nofollow"),m(Hn,"href","/docs/transformers/v4.32.0/en/model_doc/esm#transformers.TFEsmForTokenClassification"),m(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),_(t,b,g),_(t,c,g),e(c,u),e(u,T),v(r,T,null),e(c,f),e(c,F),e(F,ni),_(t,qa,g),_(t,ve,g),e(ve,Ye),e(Ye,ps),v(St,ps,null),e(ve,si),e(ve,hs),e(hs,ai),_(t,Sa,g),_(t,He,g),e(He,ri),e(He,Rt),e(Rt,ii),e(He,li),_(t,Ra,g),_(t,De,g),e(De,di),e(De,Vt),e(Vt,ci),e(De,mi),_(t,Va,g),_(t,gn,g),e(gn,pi),_(t,Ga,g),_(t,_n,g),e(_n,fs),e(fs,hi),_(t,Ba,g),_(t,bn,g),e(bn,fi),_(t,Aa,g),_(t,Tn,g),e(Tn,us),e(us,ui),_(t,Pa,g),_(t,yn,g),e(yn,gi),_(t,Xa,g),_(t,Mn,g),e(Mn,gs),e(gs,_i),_(t,La,g),_(t,Q,g),e(Q,bi),e(Q,Gt),e(Gt,Ti),e(Q,yi),e(Q,Bt),e(Bt,Mi),e(Q,vi),e(Q,At),e(At,ki),e(Q,wi),_(t,Ya,g),_(t,ae,g),e(ae,Ei),e(ae,Pt),e(Pt,$i),e(ae,Fi),e(ae,Xt),e(Xt,zi),e(ae,Ji),_(t,Ha,g),_(t,re,g),e(re,ji),e(re,Lt),e(Lt,Ui),e(re,Ci),e(re,_s),e(_s,Zi),e(re,Ni),_(t,Da,g),_(t,ke,g),e(ke,Qe),e(Qe,bs),v(Yt,bs,null),e(ke,Wi),e(ke,Ts),e(Ts,Ii),_(t,Qa,g),_(t,ie,g),e(ie,ys),e(ys,vn),e(vn,xi),e(ie,qi),e(ie,Ms),e(Ms,kn),e(kn,Si),e(ie,Ri),e(ie,vs),e(vs,wn),e(wn,Vi),_(t,Oa,g),_(t,we,g),e(we,Oe),e(Oe,ks),v(Ht,ks,null),e(we,Gi),e(we,ws),e(ws,Bi),_(t,Ka,g),_(t,C,g),v(Dt,C,null),e(C,Ai),e(C,Ee),e(Ee,Pi),e(Ee,Es),e(Es,Xi),e(Ee,Li),e(Ee,Qt),e(Qt,Yi),e(Ee,Hi),e(C,Di),e(C,$e),e($e,Qi),e($e,En),e(En,Oi),e($e,Ki),e($e,$n),e($n,el),e($e,tl),e(C,ol),v(Ke,C,null),e(C,nl),e(C,et),v(Ot,et,null),e(et,sl),e(et,Kt),e(Kt,al),e(Kt,Fn),e(Fn,rl),e(Kt,il),_(t,er,g),_(t,Fe,g),e(Fe,tt),e(tt,$s),v(eo,$s,null),e(Fe,ll),e(Fe,Fs),e(Fs,dl),_(t,tr,g),_(t,j,g),v(to,j,null),e(j,cl),e(j,zs),e(zs,ml),e(j,pl),e(j,zn),v(oo,zn,null),e(j,hl),e(j,ot),v(no,ot,null),e(ot,fl),e(ot,ze),e(ze,ul),e(ze,Js),e(Js,gl),e(ze,_l),e(ze,js),e(js,bl),e(ze,Tl),e(j,yl),e(j,le),v(so,le,null),e(le,Ml),e(le,Jn),e(Jn,vl),e(Jn,jn),e(jn,kl),e(le,wl),e(le,Us),e(Us,El),e(j,$l),e(j,Un),v(ao,Un,null),_(t,or,g),_(t,Je,g),e(Je,nt),e(nt,Cs),v(ro,Cs,null),e(Je,Fl),e(Je,Zs),e(Zs,zl),_(t,nr,g),_(t,J,g),v(io,J,null),e(J,Jl),e(J,Ns),e(Ns,jl),e(J,Ul),e(J,lo),e(lo,Cl),e(lo,Cn),e(Cn,Zl),e(lo,Nl),e(J,Wl),e(J,co),e(co,Il),e(co,mo),e(mo,xl),e(co,ql),e(J,Sl),e(J,po),e(po,Rl),e(po,ho),e(ho,Vl),e(po,Gl),e(J,Bl),e(J,U),e(U,Al),e(U,Ws),e(Ws,Pl),e(U,Xl),e(U,Is),e(Is,Ll),e(U,Yl),e(U,xs),e(xs,Hl),e(U,Dl),e(U,qs),e(qs,Ql),e(U,Ol),e(U,Ss),e(Ss,Kl),e(U,ed),e(U,Rs),e(Rs,td),e(U,od),e(J,nd),e(J,O),v(fo,O,null),e(O,sd),e(O,je),e(je,ad),e(je,Zn),e(Zn,rd),e(je,id),e(je,Vs),e(Vs,ld),e(je,dd),e(O,cd),v(st,O,null),e(O,md),v(at,O,null),_(t,sr,g),_(t,Ue,g),e(Ue,rt),e(rt,Gs),v(uo,Gs,null),e(Ue,pd),e(Ue,Bs),e(Bs,hd),_(t,ar,g),_(t,Z,g),v(go,Z,null),e(Z,fd),e(Z,_o),e(_o,ud),e(_o,As),e(As,gd),e(_o,_d),e(Z,bd),e(Z,bo),e(bo,Td),e(bo,Nn),e(Nn,yd),e(bo,Md),e(Z,vd),e(Z,To),e(To,kd),e(To,yo),e(yo,wd),e(To,Ed),e(Z,$d),e(Z,K),v(Mo,K,null),e(K,Fd),e(K,Ce),e(Ce,zd),e(Ce,Wn),e(Wn,Jd),e(Ce,jd),e(Ce,Ps),e(Ps,Ud),e(Ce,Cd),e(K,Zd),v(it,K,null),e(K,Nd),v(lt,K,null),_(t,rr,g),_(t,Ze,g),e(Ze,dt),e(dt,Xs),v(vo,Xs,null),e(Ze,Wd),e(Ze,Ls),e(Ls,Id),_(t,ir,g),_(t,N,g),v(ko,N,null),e(N,xd),e(N,Ys),e(Ys,qd),e(N,Sd),e(N,wo),e(wo,Rd),e(wo,In),e(In,Vd),e(wo,Gd),e(N,Bd),e(N,Eo),e(Eo,Ad),e(Eo,$o),e($o,Pd),e(Eo,Xd),e(N,Ld),e(N,V),v(Fo,V,null),e(V,Yd),e(V,Ne),e(Ne,Hd),e(Ne,xn),e(xn,Dd),e(Ne,Qd),e(Ne,Hs),e(Hs,Od),e(Ne,Kd),e(V,ec),v(ct,V,null),e(V,tc),v(mt,V,null),e(V,oc),v(pt,V,null),_(t,lr,g),_(t,We,g),e(We,ht),e(ht,Ds),v(zo,Ds,null),e(We,nc),e(We,Qs),e(Qs,sc),_(t,dr,g),_(t,W,g),v(Jo,W,null),e(W,ac),e(W,Os),e(Os,rc),e(W,ic),e(W,jo),e(jo,lc),e(jo,qn),e(qn,dc),e(jo,cc),e(W,mc),e(W,Uo),e(Uo,pc),e(Uo,Co),e(Co,hc),e(Uo,fc),e(W,uc),e(W,ee),v(Zo,ee,null),e(ee,gc),e(ee,Ie),e(Ie,_c),e(Ie,Sn),e(Sn,bc),e(Ie,Tc),e(Ie,Ks),e(Ks,yc),e(Ie,Mc),e(ee,vc),v(ft,ee,null),e(ee,kc),v(ut,ee,null),_(t,cr,g),_(t,xe,g),e(xe,gt),e(gt,ea),v(No,ea,null),e(xe,wc),e(xe,ta),e(ta,Ec),_(t,mr,g),_(t,I,g),v(Wo,I,null),e(I,$c),e(I,oa),e(oa,Fc),e(I,zc),e(I,Io),e(Io,Jc),e(Io,Rn),e(Rn,jc),e(Io,Uc),e(I,Cc),e(I,xo),e(xo,Zc),e(xo,qo),e(qo,Nc),e(xo,Wc),e(I,Ic),e(I,te),v(So,te,null),e(te,xc),e(te,qe),e(qe,qc),e(qe,Vn),e(Vn,Sc),e(qe,Rc),e(qe,na),e(na,Vc),e(qe,Gc),e(te,Bc),v(_t,te,null),e(te,Ac),v(bt,te,null),_(t,pr,g),_(t,Se,g),e(Se,Tt),e(Tt,sa),v(Ro,sa,null),e(Se,Pc),e(Se,aa),e(aa,Xc),_(t,hr,g),_(t,x,g),v(Vo,x,null),e(x,Lc),e(x,ra),e(ra,Yc),e(x,Hc),e(x,Go),e(Go,Dc),e(Go,Gn),e(Gn,Qc),e(Go,Oc),e(x,Kc),e(x,Bo),e(Bo,em),e(Bo,Ao),e(Ao,tm),e(Bo,om),e(x,nm),e(x,oe),v(Po,oe,null),e(oe,sm),e(oe,Re),e(Re,am),e(Re,Bn),e(Bn,rm),e(Re,im),e(Re,ia),e(ia,lm),e(Re,dm),e(oe,cm),v(yt,oe,null),e(oe,mm),v(Mt,oe,null),_(t,fr,g),_(t,Ve,g),e(Ve,vt),e(vt,la),v(Xo,la,null),e(Ve,pm),e(Ve,da),e(da,hm),_(t,ur,g),_(t,q,g),v(Lo,q,null),e(q,fm),e(q,Yo),e(Yo,um),e(Yo,ca),e(ca,gm),e(Yo,_m),e(q,bm),e(q,Ho),e(Ho,Tm),e(Ho,An),e(An,ym),e(Ho,Mm),e(q,vm),e(q,Do),e(Do,km),e(Do,Qo),e(Qo,wm),e(Do,Em),e(q,$m),e(q,G),v(Oo,G,null),e(G,Fm),e(G,Ge),e(Ge,zm),e(Ge,Pn),e(Pn,Jm),e(Ge,jm),e(Ge,ma),e(ma,Um),e(Ge,Cm),e(G,Zm),v(kt,G,null),e(G,Nm),v(wt,G,null),e(G,Wm),v(Et,G,null),_(t,gr,g),_(t,Be,g),e(Be,$t),e($t,pa),v(Ko,pa,null),e(Be,Im),e(Be,ha),e(ha,xm),_(t,_r,g),_(t,S,g),v(en,S,null),e(S,qm),e(S,fa),e(fa,Sm),e(S,Rm),e(S,tn),e(tn,Vm),e(tn,Xn),e(Xn,Gm),e(tn,Bm),e(S,Am),e(S,on),e(on,Pm),e(on,nn),e(nn,Xm),e(on,Lm),e(S,Ym),e(S,B),v(sn,B,null),e(B,Hm),e(B,Ae),e(Ae,Dm),e(Ae,Ln),e(Ln,Qm),e(Ae,Om),e(Ae,ua),e(ua,Km),e(Ae,ep),e(B,tp),v(Ft,B,null),e(B,op),v(zt,B,null),e(B,np),v(Jt,B,null),_(t,br,g),_(t,Pe,g),e(Pe,jt),e(jt,ga),v(an,ga,null),e(Pe,sp),e(Pe,_a),e(_a,ap),_(t,Tr,g),_(t,R,g),v(rn,R,null),e(R,rp),e(R,ba),e(ba,ip),e(R,lp),e(R,ln),e(ln,dp),e(ln,Yn),e(Yn,cp),e(ln,mp),e(R,pp),e(R,dn),e(dn,hp),e(dn,cn),e(cn,fp),e(dn,up),e(R,gp),e(R,A),v(mn,A,null),e(A,_p),e(A,Xe),e(Xe,bp),e(Xe,Hn),e(Hn,Tp),e(Xe,yp),e(Xe,Ta),e(Ta,Mp),e(Xe,vp),e(A,kp),v(Ut,A,null),e(A,wp),v(Ct,A,null),e(A,Ep),v(Zt,A,null),yr=!0},p(t,[g]){const pn={};g&2&&(pn.$$scope={dirty:g,ctx:t}),Ke.$set(pn);const ya={};g&2&&(ya.$$scope={dirty:g,ctx:t}),st.$set(ya);const Ma={};g&2&&(Ma.$$scope={dirty:g,ctx:t}),at.$set(Ma);const va={};g&2&&(va.$$scope={dirty:g,ctx:t}),it.$set(va);const hn={};g&2&&(hn.$$scope={dirty:g,ctx:t}),lt.$set(hn);const ka={};g&2&&(ka.$$scope={dirty:g,ctx:t}),ct.$set(ka);const wa={};g&2&&(wa.$$scope={dirty:g,ctx:t}),mt.$set(wa);const Ea={};g&2&&(Ea.$$scope={dirty:g,ctx:t}),pt.$set(Ea);const fn={};g&2&&(fn.$$scope={dirty:g,ctx:t}),ft.$set(fn);const $a={};g&2&&($a.$$scope={dirty:g,ctx:t}),ut.$set($a);const un={};g&2&&(un.$$scope={dirty:g,ctx:t}),_t.$set(un);const Fa={};g&2&&(Fa.$$scope={dirty:g,ctx:t}),bt.$set(Fa);const za={};g&2&&(za.$$scope={dirty:g,ctx:t}),yt.$set(za);const Ja={};g&2&&(Ja.$$scope={dirty:g,ctx:t}),Mt.$set(Ja);const ja={};g&2&&(ja.$$scope={dirty:g,ctx:t}),kt.$set(ja);const Ua={};g&2&&(Ua.$$scope={dirty:g,ctx:t}),wt.$set(Ua);const Ca={};g&2&&(Ca.$$scope={dirty:g,ctx:t}),Et.$set(Ca);const Za={};g&2&&(Za.$$scope={dirty:g,ctx:t}),Ft.$set(Za);const Na={};g&2&&(Na.$$scope={dirty:g,ctx:t}),zt.$set(Na);const Wa={};g&2&&(Wa.$$scope={dirty:g,ctx:t}),Jt.$set(Wa);const Ia={};g&2&&(Ia.$$scope={dirty:g,ctx:t}),Ut.$set(Ia);const se={};g&2&&(se.$$scope={dirty:g,ctx:t}),Ct.$set(se);const xa={};g&2&&(xa.$$scope={dirty:g,ctx:t}),Zt.$set(xa)},i(t){yr||(k(r.$$.fragment,t),k(St.$$.fragment,t),k(Yt.$$.fragment,t),k(Ht.$$.fragment,t),k(Dt.$$.fragment,t),k(Ke.$$.fragment,t),k(Ot.$$.fragment,t),k(eo.$$.fragment,t),k(to.$$.fragment,t),k(oo.$$.fragment,t),k(no.$$.fragment,t),k(so.$$.fragment,t),k(ao.$$.fragment,t),k(ro.$$.fragment,t),k(io.$$.fragment,t),k(fo.$$.fragment,t),k(st.$$.fragment,t),k(at.$$.fragment,t),k(uo.$$.fragment,t),k(go.$$.fragment,t),k(Mo.$$.fragment,t),k(it.$$.fragment,t),k(lt.$$.fragment,t),k(vo.$$.fragment,t),k(ko.$$.fragment,t),k(Fo.$$.fragment,t),k(ct.$$.fragment,t),k(mt.$$.fragment,t),k(pt.$$.fragment,t),k(zo.$$.fragment,t),k(Jo.$$.fragment,t),k(Zo.$$.fragment,t),k(ft.$$.fragment,t),k(ut.$$.fragment,t),k(No.$$.fragment,t),k(Wo.$$.fragment,t),k(So.$$.fragment,t),k(_t.$$.fragment,t),k(bt.$$.fragment,t),k(Ro.$$.fragment,t),k(Vo.$$.fragment,t),k(Po.$$.fragment,t),k(yt.$$.fragment,t),k(Mt.$$.fragment,t),k(Xo.$$.fragment,t),k(Lo.$$.fragment,t),k(Oo.$$.fragment,t),k(kt.$$.fragment,t),k(wt.$$.fragment,t),k(Et.$$.fragment,t),k(Ko.$$.fragment,t),k(en.$$.fragment,t),k(sn.$$.fragment,t),k(Ft.$$.fragment,t),k(zt.$$.fragment,t),k(Jt.$$.fragment,t),k(an.$$.fragment,t),k(rn.$$.fragment,t),k(mn.$$.fragment,t),k(Ut.$$.fragment,t),k(Ct.$$.fragment,t),k(Zt.$$.fragment,t),yr=!0)},o(t){w(r.$$.fragment,t),w(St.$$.fragment,t),w(Yt.$$.fragment,t),w(Ht.$$.fragment,t),w(Dt.$$.fragment,t),w(Ke.$$.fragment,t),w(Ot.$$.fragment,t),w(eo.$$.fragment,t),w(to.$$.fragment,t),w(oo.$$.fragment,t),w(no.$$.fragment,t),w(so.$$.fragment,t),w(ao.$$.fragment,t),w(ro.$$.fragment,t),w(io.$$.fragment,t),w(fo.$$.fragment,t),w(st.$$.fragment,t),w(at.$$.fragment,t),w(uo.$$.fragment,t),w(go.$$.fragment,t),w(Mo.$$.fragment,t),w(it.$$.fragment,t),w(lt.$$.fragment,t),w(vo.$$.fragment,t),w(ko.$$.fragment,t),w(Fo.$$.fragment,t),w(ct.$$.fragment,t),w(mt.$$.fragment,t),w(pt.$$.fragment,t),w(zo.$$.fragment,t),w(Jo.$$.fragment,t),w(Zo.$$.fragment,t),w(ft.$$.fragment,t),w(ut.$$.fragment,t),w(No.$$.fragment,t),w(Wo.$$.fragment,t),w(So.$$.fragment,t),w(_t.$$.fragment,t),w(bt.$$.fragment,t),w(Ro.$$.fragment,t),w(Vo.$$.fragment,t),w(Po.$$.fragment,t),w(yt.$$.fragment,t),w(Mt.$$.fragment,t),w(Xo.$$.fragment,t),w(Lo.$$.fragment,t),w(Oo.$$.fragment,t),w(kt.$$.fragment,t),w(wt.$$.fragment,t),w(Et.$$.fragment,t),w(Ko.$$.fragment,t),w(en.$$.fragment,t),w(sn.$$.fragment,t),w(Ft.$$.fragment,t),w(zt.$$.fragment,t),w(Jt.$$.fragment,t),w(an.$$.fragment,t),w(rn.$$.fragment,t),w(mn.$$.fragment,t),w(Ut.$$.fragment,t),w(Ct.$$.fragment,t),w(Zt.$$.fragment,t),yr=!1},d(t){o(d),t&&o(b),t&&o(c),E(r),t&&o(qa),t&&o(ve),E(St),t&&o(Sa),t&&o(He),t&&o(Ra),t&&o(De),t&&o(Va),t&&o(gn),t&&o(Ga),t&&o(_n),t&&o(Ba),t&&o(bn),t&&o(Aa),t&&o(Tn),t&&o(Pa),t&&o(yn),t&&o(Xa),t&&o(Mn),t&&o(La),t&&o(Q),t&&o(Ya),t&&o(ae),t&&o(Ha),t&&o(re),t&&o(Da),t&&o(ke),E(Yt),t&&o(Qa),t&&o(ie),t&&o(Oa),t&&o(we),E(Ht),t&&o(Ka),t&&o(C),E(Dt),E(Ke),E(Ot),t&&o(er),t&&o(Fe),E(eo),t&&o(tr),t&&o(j),E(to),E(oo),E(no),E(so),E(ao),t&&o(or),t&&o(Je),E(ro),t&&o(nr),t&&o(J),E(io),E(fo),E(st),E(at),t&&o(sr),t&&o(Ue),E(uo),t&&o(ar),t&&o(Z),E(go),E(Mo),E(it),E(lt),t&&o(rr),t&&o(Ze),E(vo),t&&o(ir),t&&o(N),E(ko),E(Fo),E(ct),E(mt),E(pt),t&&o(lr),t&&o(We),E(zo),t&&o(dr),t&&o(W),E(Jo),E(Zo),E(ft),E(ut),t&&o(cr),t&&o(xe),E(No),t&&o(mr),t&&o(I),E(Wo),E(So),E(_t),E(bt),t&&o(pr),t&&o(Se),E(Ro),t&&o(hr),t&&o(x),E(Vo),E(Po),E(yt),E(Mt),t&&o(fr),t&&o(Ve),E(Xo),t&&o(ur),t&&o(q),E(Lo),E(Oo),E(kt),E(wt),E(Et),t&&o(gr),t&&o(Be),E(Ko),t&&o(_r),t&&o(S),E(en),E(sn),E(Ft),E(zt),E(Jt),t&&o(br),t&&o(Pe),E(an),t&&o(Tr),t&&o(R),E(rn),E(mn),E(Ut),E(Ct),E(Zt)}}}const iu={local:"esm",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.EsmConfig",title:"EsmConfig"},{local:"transformers.EsmTokenizer",title:"EsmTokenizer"},{local:"transformers.EsmModel",title:"EsmModel"},{local:"transformers.EsmForMaskedLM",title:"EsmForMaskedLM"},{local:"transformers.EsmForSequenceClassification",title:"EsmForSequenceClassification"},{local:"transformers.EsmForTokenClassification",title:"EsmForTokenClassification"},{local:"transformers.EsmForProteinFolding",title:"EsmForProteinFolding"},{local:"transformers.TFEsmModel",title:"TFEsmModel"},{local:"transformers.TFEsmForMaskedLM",title:"TFEsmForMaskedLM"},{local:"transformers.TFEsmForSequenceClassification",title:"TFEsmForSequenceClassification"},{local:"transformers.TFEsmForTokenClassification",title:"TFEsmForTokenClassification"}],title:"ESM"};function lu($){return If(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class uu extends Cf{constructor(d){super();Zf(this,d,lu,ru,Nf,{})}}export{uu as default,iu as metadata};
