import{s as Cl,o as Nl,n as Zl}from"../chunks/scheduler.cc52f4b9.js";import{S as Ql,i as Vl,e as U,s as i,c as d,h as El,a as h,d as p,b as o,f as $l,g as b,j as J,k as gl,l as zl,m as u,n as j,o as c,u as G,t as M,p as y,v as H}from"../chunks/index.9480bb2b.js";import{T as Il}from"../chunks/Tip.f7b80743.js";import{C as Wl,H as He,E as Bl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.04d617be.js";import{Y as vl}from"../chunks/Youtube.7b12d9e8.js";import{C as T}from"../chunks/CodeBlock.f4148b32.js";import{C as Al}from"../chunks/CourseFloatingBanner.cdc38ef1.js";import{F as Rl}from"../chunks/FrameworkSwitchCourse.42d12053.js";function Gl(m){let l,a;return l=new Al({props:{chapter:2,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"English",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter2/section5_tf.ipynb"},{label:"Français",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/fr/chapter2/section5_tf.ipynb"},{label:"English",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section5_tf.ipynb"},{label:"Français",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/fr/chapter2/section5_tf.ipynb"}]}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function Hl(m){let l,a;return l=new Al({props:{chapter:2,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"English",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter2/section5_pt.ipynb"},{label:"Français",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/fr/chapter2/section5_pt.ipynb"},{label:"English",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section5_pt.ipynb"},{label:"Français",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/fr/chapter2/section5_pt.ipynb"}]}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function Xl(m){let l,a;return l=new vl({props:{id:"ROxrFOEbsQE"}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function ql(m){let l,a;return l=new vl({props:{id:"M6adb1j2jPI"}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function Dl(m){let l,a,s,r;return l=new T({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZC1maW5ldHVuZWQtc3N0LTItZW5nbGlzaCUyMiUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBc2VxdWVuY2UlMjAlM0QlMjAlMjJJJ3ZlJTIwYmVlbiUyMHdhaXRpbmclMjBmb3IlMjBhJTIwSHVnZ2luZ0ZhY2UlMjBjb3Vyc2UlMjBteSUyMHdob2xlJTIwbGlmZS4lMjIlMEElMjMlMjBKJ2FpJTIwYXR0ZW5kdSUyMHVuJTIwY291cnMlMjBkJUUyJTgwJTk5SHVnZ2luZ0ZhY2UlMjB0b3V0ZSUyMG1hJTIwdmllLiUwQSUwQXRva2VucyUyMCUzRCUyMHRva2VuaXplci50b2tlbml6ZShzZXF1ZW5jZSklMEFpZHMlMjAlM0QlMjB0b2tlbml6ZXIuY29udmVydF90b2tlbnNfdG9faWRzKHRva2VucyklMEFpbnB1dF9pZHMlMjAlM0QlMjB0Zi5jb25zdGFudChpZHMpJTBBJTIzJTIwVGhpcyUyMGxpbmUlMjB3aWxsJTIwZmFpbC4lMEFtb2RlbChpbnB1dF9pZHMp",highlighted:`<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFAutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint)

sequence = <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>
<span class="hljs-comment"># J&#x27;ai attendu un cours d’HuggingFace toute ma vie.</span>

tokens = tokenizer.tokenize(sequence)
ids = tokenizer.convert_tokens_to_ids(tokens)
input_ids = tf.constant(ids)
<span class="hljs-comment"># This line will fail.</span>
model(input_ids)`,wrap:!1}}),s=new T({props:{code:"SW52YWxpZEFyZ3VtZW50RXJyb3IlM0ElMjBJbnB1dCUyMHRvJTIwcmVzaGFwZSUyMGlzJTIwYSUyMHRlbnNvciUyMHdpdGglMjAxNCUyMHZhbHVlcyUyQyUyMGJ1dCUyMHRoZSUyMHJlcXVlc3RlZCUyMHNoYXBlJTIwaGFzJTIwMTk2JTIwJTVCT3AlM0FSZXNoYXBlJTVE",highlighted:'InvalidArgumentError: Input to reshape <span class="hljs-keyword">is</span> a tensor <span class="hljs-keyword">with</span> <span class="hljs-number">14</span> values, but the requested shape has <span class="hljs-number">196</span> [Op:Reshape]',wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function xl(m){let l,a,s,r;return l=new T({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQtZmluZXR1bmVkLXNzdC0yLWVuZ2xpc2glMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCklMEElMEFzZXF1ZW5jZSUyMCUzRCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUwQSUyMyUyMEonYWklMjBhdHRlbmR1JTIwdW4lMjBjb3VycyUyMGQlRTIlODAlOTlIdWdnaW5nRmFjZSUyMHRvdXRlJTIwbWElMjB2aWUuJTBBJTBBdG9rZW5zJTIwJTNEJTIwdG9rZW5pemVyLnRva2VuaXplKHNlcXVlbmNlKSUwQWlkcyUyMCUzRCUyMHRva2VuaXplci5jb252ZXJ0X3Rva2Vuc190b19pZHModG9rZW5zKSUwQWlucHV0X2lkcyUyMCUzRCUyMHRvcmNoLnRlbnNvcihpZHMpJTBBJTIzJTIwQ2V0dGUlMjBsaWduZSUyMHZhJTIwJUMzJUE5Y2hvdWVyLiUwQW1vZGVsKGlucHV0X2lkcyk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)

sequence = <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>
<span class="hljs-comment"># J&#x27;ai attendu un cours d’HuggingFace toute ma vie.</span>

tokens = tokenizer.tokenize(sequence)
ids = tokenizer.convert_tokens_to_ids(tokens)
input_ids = torch.tensor(ids)
<span class="hljs-comment"># Cette ligne va échouer.</span>
model(input_ids)`,wrap:!1}}),s=new T({props:{code:"SW5kZXhFcnJvciUzQSUyMERpbWVuc2lvbiUyMG91dCUyMG9mJTIwcmFuZ2UlMjAoZXhwZWN0ZWQlMjB0byUyMGJlJTIwaW4lMjByYW5nZSUyMG9mJTIwJTVCLTElMkMlMjAwJTVEJTJDJTIwYnV0JTIwZ290JTIwMSk=",highlighted:'IndexError: Dimension out of <span class="hljs-built_in">range</span> (expected to be <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span> of [-<span class="hljs-number">1</span>, <span class="hljs-number">0</span>], but got <span class="hljs-number">1</span>)',wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function Fl(m){let l,a,s,r;return l=new T({props:{code:"dG9rZW5pemVkX2lucHV0cyUyMCUzRCUyMHRva2VuaXplcihzZXF1ZW5jZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBcHJpbnQodG9rZW5pemVkX2lucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCk=",highlighted:`tokenized_inputs = tokenizer(sequence, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-built_in">print</span>(tokenized_inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])`,wrap:!1}}),s=new T({props:{code:"JTNDdGYuVGVuc29yJTNBJTIwc2hhcGUlM0QoMSUyQyUyMDE2KSUyQyUyMGR0eXBlJTNEaW50MzIlMkMlMjBudW1weSUzRCUwQWFycmF5KCU1QiU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjAxMDA1JTJDJTIwJTIwMjMxMCUyQyUyMCUyMDIwNDIlMkMlMjAlMjAzNDAzJTJDJTIwJTIwMjAwNSUyQyUyMCUyMDEwMzclMkMlMjAxNzY2MiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMDEyMTcyJTJDJTIwJTIwMjYwNyUyQyUyMCUyMDIwMjYlMkMlMjAlMjAyODc4JTJDJTIwJTIwMjE2NiUyQyUyMCUyMDEwMTIlMkMlMjAlMjAlMjAxMDIlNUQlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRQ==",highlighted:`&lt;tf.Tensor: shape=(<span class="hljs-number">1</span>, <span class="hljs-number">16</span>), dtype=int32, numpy=
array([[  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2310</span>,  <span class="hljs-number">2042</span>,  <span class="hljs-number">3403</span>,  <span class="hljs-number">2005</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">17662</span>,
        <span class="hljs-number">12172</span>,  <span class="hljs-number">2607</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">2878</span>,  <span class="hljs-number">2166</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>]], dtype=int32)&gt;`,wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function Sl(m){let l,a,s,r;return l=new T({props:{code:"dG9rZW5pemVkX2lucHV0cyUyMCUzRCUyMHRva2VuaXplcihzZXF1ZW5jZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBcHJpbnQodG9rZW5pemVkX2lucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCk=",highlighted:`tokenized_inputs = tokenizer(sequence, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-built_in">print</span>(tokenized_inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])`,wrap:!1}}),s=new T({props:{code:"dGVuc29yKCU1QiU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjAxMDA1JTJDJTIwJTIwMjMxMCUyQyUyMCUyMDIwNDIlMkMlMjAlMjAzNDAzJTJDJTIwJTIwMjAwNSUyQyUyMCUyMDEwMzclMkMlMjAxNzY2MiUyQyUyMDEyMTcyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwMjYwNyUyQyUyMCUyMDIwMjYlMkMlMjAlMjAyODc4JTJDJTIwJTIwMjE2NiUyQyUyMCUyMDEwMTIlMkMlMjAlMjAlMjAxMDIlNUQlNUQp",highlighted:`tensor([[  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2310</span>,  <span class="hljs-number">2042</span>,  <span class="hljs-number">3403</span>,  <span class="hljs-number">2005</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">17662</span>, <span class="hljs-number">12172</span>,
          <span class="hljs-number">2607</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">2878</span>,  <span class="hljs-number">2166</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>]])`,wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function Yl(m){let l,a;return l=new T({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZC1maW5ldHVuZWQtc3N0LTItZW5nbGlzaCUyMiUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBc2VxdWVuY2UlMjAlM0QlMjAlMjJJJ3ZlJTIwYmVlbiUyMHdhaXRpbmclMjBmb3IlMjBhJTIwSHVnZ2luZ0ZhY2UlMjBjb3Vyc2UlMjBteSUyMHdob2xlJTIwbGlmZS4lMjIlMEElMjMlMjBKJ2FpJTIwYXR0ZW5kdSUyMHVuJTIwY291cnMlMjBkJUUyJTgwJTk5SHVnZ2luZ0ZhY2UlMjB0b3V0ZSUyMG1hJTIwdmllLiUwQSUwQSUwQXRva2VucyUyMCUzRCUyMHRva2VuaXplci50b2tlbml6ZShzZXF1ZW5jZSklMEFpZHMlMjAlM0QlMjB0b2tlbml6ZXIuY29udmVydF90b2tlbnNfdG9faWRzKHRva2VucyklMEElMEFpbnB1dF9pZHMlMjAlM0QlMjB0Zi5jb25zdGFudCglNUJpZHMlNUQpJTBBcHJpbnQoJTIySW5wdXQlMjBJRHMlM0ElMjIlMkMlMjBpbnB1dF9pZHMpJTBBJTBBb3V0cHV0JTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzKSUwQXByaW50KCUyMkxvZ2l0cyUzQSUyMiUyQyUyMG91dHB1dC5sb2dpdHMp",highlighted:`<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFAutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint)

sequence = <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>
<span class="hljs-comment"># J&#x27;ai attendu un cours d’HuggingFace toute ma vie.</span>


tokens = tokenizer.tokenize(sequence)
ids = tokenizer.convert_tokens_to_ids(tokens)

input_ids = tf.constant([ids])
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Input IDs:&quot;</span>, input_ids)

output = model(input_ids)
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Logits:&quot;</span>, output.logits)`,wrap:!1}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function Ll(m){let l,a;return l=new T({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQtZmluZXR1bmVkLXNzdC0yLWVuZ2xpc2glMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCklMEElMEFzZXF1ZW5jZSUyMCUzRCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUwQSUyMyUyMEonYWklMjBhdHRlbmR1JTIwdW4lMjBjb3VycyUyMGQlRTIlODAlOTlIdWdnaW5nRmFjZSUyMHRvdXRlJTIwbWElMjB2aWUuJTBBJTBBJTBBdG9rZW5zJTIwJTNEJTIwdG9rZW5pemVyLnRva2VuaXplKHNlcXVlbmNlKSUwQWlkcyUyMCUzRCUyMHRva2VuaXplci5jb252ZXJ0X3Rva2Vuc190b19pZHModG9rZW5zKSUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHRvcmNoLnRlbnNvciglNUJpZHMlNUQpJTBBcHJpbnQoJTIySW5wdXQlMjBJRHMlM0ElMjIlMkMlMjBpbnB1dF9pZHMpJTBBJTBBb3V0cHV0JTIwJTNEJTIwbW9kZWwoaW5wdXRfaWRzKSUwQXByaW50KCUyMkxvZ2l0cyUzQSUyMiUyQyUyMG91dHB1dC5sb2dpdHMp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)

sequence = <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>
<span class="hljs-comment"># J&#x27;ai attendu un cours d’HuggingFace toute ma vie.</span>


tokens = tokenizer.tokenize(sequence)
ids = tokenizer.convert_tokens_to_ids(tokens)

input_ids = torch.tensor([ids])
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Input IDs:&quot;</span>, input_ids)

output = model(input_ids)
<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Logits:&quot;</span>, output.logits)`,wrap:!1}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function Kl(m){let l,a;return l=new T({props:{code:"SW5wdXQlMjBJRHMlM0ElMjB0Zi5UZW5zb3IoJTBBJTVCJTVCJTIwMTA0NSUyMCUyMDEwMDUlMjAlMjAyMzEwJTIwJTIwMjA0MiUyMCUyMDM0MDMlMjAlMjAyMDA1JTIwJTIwMTAzNyUyMDE3NjYyJTIwMTIxNzIlMjAlMjAyNjA3JTIwJTIwMjAyNiUyMCUyMDI4NzglMEElMjAlMjAlMjAyMTY2JTIwJTIwMTAxMiU1RCU1RCUyQyUyMHNoYXBlJTNEKDElMkMlMjAxNCklMkMlMjBkdHlwZSUzRGludDMyKSUwQUxvZ2l0cyUzQSUyMHRmLlRlbnNvciglNUIlNUItMi43Mjc2MjA4JTIwJTIwMi44Nzg5Mzc3JTVEJTVEJTJDJTIwc2hhcGUlM0QoMSUyQyUyMDIpJTJDJTIwZHR5cGUlM0RmbG9hdDMyKQ==",highlighted:`Input IDs: tf.Tensor(
[[ <span class="hljs-number">1045</span>  <span class="hljs-number">1005</span>  <span class="hljs-number">2310</span>  <span class="hljs-number">2042</span>  <span class="hljs-number">3403</span>  <span class="hljs-number">2005</span>  <span class="hljs-number">1037</span> <span class="hljs-number">17662</span> <span class="hljs-number">12172</span>  <span class="hljs-number">2607</span>  <span class="hljs-number">2026</span>  <span class="hljs-number">2878</span>
   <span class="hljs-number">2166</span>  <span class="hljs-number">1012</span>]], shape=(<span class="hljs-number">1</span>, <span class="hljs-number">14</span>), dtype=int32)
Logits: tf.Tensor([[-<span class="hljs-number">2.7276208</span>  <span class="hljs-number">2.8789377</span>]], shape=(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>), dtype=float32)`,wrap:!1}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function Pl(m){let l,a;return l=new T({props:{code:"SW5wdXQlMjBJRHMlM0ElMjAlNUIlNUIlMjAxMDQ1JTJDJTIwJTIwMTAwNSUyQyUyMCUyMDIzMTAlMkMlMjAlMjAyMDQyJTJDJTIwJTIwMzQwMyUyQyUyMCUyMDIwMDUlMkMlMjAlMjAxMDM3JTJDJTIwMTc2NjIlMkMlMjAxMjE3MiUyQyUyMCUyMDI2MDclMkMlMjAyMDI2JTJDJTIwJTIwMjg3OCUyQyUyMCUyMDIxNjYlMkMlMjAlMjAxMDEyJTVEJTVEJTBBTG9naXRzJTNBJTIwJTVCJTVCLTIuNzI3NiUyQyUyMCUyMDIuODc4OSU1RCU1RA==",highlighted:`Input IDs: [[ <span class="hljs-number">1045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2310</span>,  <span class="hljs-number">2042</span>,  <span class="hljs-number">3403</span>,  <span class="hljs-number">2005</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">17662</span>, <span class="hljs-number">12172</span>,  <span class="hljs-number">2607</span>, <span class="hljs-number">2026</span>,  <span class="hljs-number">2878</span>,  <span class="hljs-number">2166</span>,  <span class="hljs-number">1012</span>]]
Logits: [[-<span class="hljs-number">2.7276</span>,  <span class="hljs-number">2.8789</span>]]`,wrap:!1}}),{c(){d(l.$$.fragment)},l(s){b(l.$$.fragment,s)},m(s,r){j(l,s,r),a=!0},i(s){a||(M(l.$$.fragment,s),a=!0)},o(s){c(l.$$.fragment,s),a=!1},d(s){y(l,s)}}}function Ol(m){let l,a="✏️ <strong>Essayez !</strong> Convertissez cette liste <code>batched_ids</code> en un tenseur et passez-la dans votre modèle. Vérifiez que vous obtenez les mêmes logits que précédemment (mais deux fois) !";return{c(){l=U("p"),l.innerHTML=a},l(s){l=h(s,"P",{"data-svelte-h":!0}),J(l)!=="svelte-u1wvi8"&&(l.innerHTML=a)},m(s,r){u(s,l,r)},p:Zl,d(s){s&&p(l)}}}function en(m){let l,a,s,r;return l=new T({props:{code:"bW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBJTBBc2VxdWVuY2UxX2lkcyUyMCUzRCUyMCU1QiU1QjIwMCUyQyUyMDIwMCUyQyUyMDIwMCU1RCU1RCUwQXNlcXVlbmNlMl9pZHMlMjAlM0QlMjAlNUIlNUIyMDAlMkMlMjAyMDAlNUQlNUQlMEFiYXRjaGVkX2lkcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU1QjIwMCUyQyUyMDIwMCUyQyUyMDIwMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCU1QjIwMCUyQyUyMDIwMCUyQyUyMHRva2VuaXplci5wYWRfdG9rZW5faWQlNUQlMkMlMEElNUQlMEElMEFwcmludChtb2RlbCh0Zi5jb25zdGFudChzZXF1ZW5jZTFfaWRzKSkubG9naXRzKSUwQXByaW50KG1vZGVsKHRmLmNvbnN0YW50KHNlcXVlbmNlMl9pZHMpKS5sb2dpdHMpJTBBcHJpbnQobW9kZWwodGYuY29uc3RhbnQoYmF0Y2hlZF9pZHMpKS5sb2dpdHMp",highlighted:`model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint)

sequence1_ids = [[<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>]]
sequence2_ids = [[<span class="hljs-number">200</span>, <span class="hljs-number">200</span>]]
batched_ids = [
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>],
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, tokenizer.pad_token_id],
]

<span class="hljs-built_in">print</span>(model(tf.constant(sequence1_ids)).logits)
<span class="hljs-built_in">print</span>(model(tf.constant(sequence2_ids)).logits)
<span class="hljs-built_in">print</span>(model(tf.constant(batched_ids)).logits)`,wrap:!1}}),s=new T({props:{code:"dGYuVGVuc29yKCU1QiU1QiUyMDEuNTY5MzY3OCUyMC0xLjM4OTQ1ODElNUQlNUQlMkMlMjBzaGFwZSUzRCgxJTJDJTIwMiklMkMlMjBkdHlwZSUzRGZsb2F0MzIpJTBBdGYuVGVuc29yKCU1QiU1QiUyMDAuNTgwMzAwNSUyMCUyMC0wLjQxMjUyNDI4JTVEJTVEJTJDJTIwc2hhcGUlM0QoMSUyQyUyMDIpJTJDJTIwZHR5cGUlM0RmbG9hdDMyKSUwQXRmLlRlbnNvciglMEElNUIlNUIlMjAxLjU2OTM2ODElMjAtMS4zODk0NTgyJTVEJTBBJTIwJTVCJTIwMS4zMzczNDg2JTIwLTEuMjE2MzE5MyU1RCU1RCUyQyUyMHNoYXBlJTNEKDIlMkMlMjAyKSUyQyUyMGR0eXBlJTNEZmxvYXQzMik=",highlighted:`tf.Tensor([[ <span class="hljs-number">1.5693678</span> -<span class="hljs-number">1.3894581</span>]], shape=(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>), dtype=float32)
tf.Tensor([[ <span class="hljs-number">0.5803005</span>  -<span class="hljs-number">0.41252428</span>]], shape=(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>), dtype=float32)
tf.Tensor(
[[ <span class="hljs-number">1.5693681</span> -<span class="hljs-number">1.3894582</span>]
 [ <span class="hljs-number">1.3373486</span> -<span class="hljs-number">1.2163193</span>]], shape=(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>), dtype=float32)`,wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function sn(m){let l,a,s,r;return l=new T({props:{code:"bW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQSUwQXNlcXVlbmNlMV9pZHMlMjAlM0QlMjAlNUIlNUIyMDAlMkMlMjAyMDAlMkMlMjAyMDAlNUQlNUQlMEFzZXF1ZW5jZTJfaWRzJTIwJTNEJTIwJTVCJTVCMjAwJTJDJTIwMjAwJTVEJTVEJTBBYmF0Y2hlZF9pZHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlMkMlMjAyMDAlNUQlMkMlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlMkMlMjB0b2tlbml6ZXIucGFkX3Rva2VuX2lkJTVEJTJDJTBBJTVEJTBBJTBBcHJpbnQobW9kZWwodG9yY2gudGVuc29yKHNlcXVlbmNlMV9pZHMpKS5sb2dpdHMpJTBBcHJpbnQobW9kZWwodG9yY2gudGVuc29yKHNlcXVlbmNlMl9pZHMpKS5sb2dpdHMpJTBBcHJpbnQobW9kZWwodG9yY2gudGVuc29yKGJhdGNoZWRfaWRzKSkubG9naXRzKQ==",highlighted:`model = AutoModelForSequenceClassification.from_pretrained(checkpoint)

sequence1_ids = [[<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>]]
sequence2_ids = [[<span class="hljs-number">200</span>, <span class="hljs-number">200</span>]]
batched_ids = [
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>],
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, tokenizer.pad_token_id],
]

<span class="hljs-built_in">print</span>(model(torch.tensor(sequence1_ids)).logits)
<span class="hljs-built_in">print</span>(model(torch.tensor(sequence2_ids)).logits)
<span class="hljs-built_in">print</span>(model(torch.tensor(batched_ids)).logits)`,wrap:!1}}),s=new T({props:{code:"dGVuc29yKCU1QiU1QiUyMDEuNTY5NCUyQyUyMC0xLjM4OTUlNUQlNUQlMkMlMjBncmFkX2ZuJTNEJTNDQWRkbW1CYWNrd2FyZCUzRSklMEF0ZW5zb3IoJTVCJTVCJTIwMC41ODAzJTJDJTIwLTAuNDEyNSU1RCU1RCUyQyUyMGdyYWRfZm4lM0QlM0NBZGRtbUJhY2t3YXJkJTNFKSUwQXRlbnNvciglNUIlNUIlMjAxLjU2OTQlMkMlMjAtMS4zODk1JTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwMS4zMzczJTJDJTIwLTEuMjE2MyU1RCU1RCUyQyUyMGdyYWRfZm4lM0QlM0NBZGRtbUJhY2t3YXJkJTNFKQ==",highlighted:`tensor([[ <span class="hljs-number">1.5694</span>, -<span class="hljs-number">1.3895</span>]], grad_fn=&lt;AddmmBackward&gt;)
tensor([[ <span class="hljs-number">0.5803</span>, -<span class="hljs-number">0.4125</span>]], grad_fn=&lt;AddmmBackward&gt;)
tensor([[ <span class="hljs-number">1.5694</span>, -<span class="hljs-number">1.3895</span>],
        [ <span class="hljs-number">1.3373</span>, -<span class="hljs-number">1.2163</span>]], grad_fn=&lt;AddmmBackward&gt;)`,wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function ln(m){let l,a,s,r;return l=new T({props:{code:"YmF0Y2hlZF9pZHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlMkMlMjAyMDAlNUQlMkMlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlMkMlMjB0b2tlbml6ZXIucGFkX3Rva2VuX2lkJTVEJTJDJTBBJTVEJTBBJTBBYXR0ZW50aW9uX21hc2slMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDElNUQlMkMlMEElMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDAlNUQlMkMlMEElNUQlMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwodGYuY29uc3RhbnQoYmF0Y2hlZF9pZHMpJTJDJTIwYXR0ZW50aW9uX21hc2slM0R0Zi5jb25zdGFudChhdHRlbnRpb25fbWFzaykpJTBBcHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:`batched_ids = [
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>],
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, tokenizer.pad_token_id],
]

attention_mask = [
    [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>],
    [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>],
]

outputs = model(tf.constant(batched_ids), attention_mask=tf.constant(attention_mask))
<span class="hljs-built_in">print</span>(outputs.logits)`,wrap:!1}}),s=new T({props:{code:"dGYuVGVuc29yKCUwQSU1QiU1QiUyMDEuNTY5MzY4MSUyMCUyMC0xLjM4OTQ1ODIlMjAlNUQlMEElMjAlNUIlMjAwLjU4MDMwMjElMjAlMjAtMC40MTI1MjU4NiU1RCU1RCUyQyUyMHNoYXBlJTNEKDIlMkMlMjAyKSUyQyUyMGR0eXBlJTNEZmxvYXQzMik=",highlighted:`tf.Tensor(
[[ <span class="hljs-number">1.5693681</span>  -<span class="hljs-number">1.3894582</span> ]
 [ <span class="hljs-number">0.5803021</span>  -<span class="hljs-number">0.41252586</span>]], shape=(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>), dtype=float32)`,wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function nn(m){let l,a,s,r;return l=new T({props:{code:"YmF0Y2hlZF9pZHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlMkMlMjAyMDAlNUQlMkMlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlMkMlMjB0b2tlbml6ZXIucGFkX3Rva2VuX2lkJTVEJTJDJTBBJTVEJTBBJTBBYXR0ZW50aW9uX21hc2slMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDElNUQlMkMlMEElMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDAlNUQlMkMlMEElNUQlMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwodG9yY2gudGVuc29yKGJhdGNoZWRfaWRzKSUyQyUyMGF0dGVudGlvbl9tYXNrJTNEdG9yY2gudGVuc29yKGF0dGVudGlvbl9tYXNrKSklMEFwcmludChvdXRwdXRzLmxvZ2l0cyk=",highlighted:`batched_ids = [
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>],
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, tokenizer.pad_token_id],
]

attention_mask = [
    [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>],
    [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>],
]

outputs = model(torch.tensor(batched_ids), attention_mask=torch.tensor(attention_mask))
<span class="hljs-built_in">print</span>(outputs.logits)`,wrap:!1}}),s=new T({props:{code:"dGVuc29yKCU1QiU1QiUyMDEuNTY5NCUyQyUyMC0xLjM4OTUlNUQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIlMjAwLjU4MDMlMkMlMjAtMC40MTI1JTVEJTVEJTJDJTIwZ3JhZF9mbiUzRCUzQ0FkZG1tQmFja3dhcmQlM0Up",highlighted:`tensor([[ <span class="hljs-number">1.5694</span>, -<span class="hljs-number">1.3895</span>],
        [ <span class="hljs-number">0.5803</span>, -<span class="hljs-number">0.4125</span>]], grad_fn=&lt;AddmmBackward&gt;)`,wrap:!1}}),{c(){d(l.$$.fragment),a=i(),d(s.$$.fragment)},l(n){b(l.$$.fragment,n),a=o(n),b(s.$$.fragment,n)},m(n,f){j(l,n,f),u(n,a,f),j(s,n,f),r=!0},i(n){r||(M(l.$$.fragment,n),M(s.$$.fragment,n),r=!0)},o(n){c(l.$$.fragment,n),c(s.$$.fragment,n),r=!1},d(n){n&&p(a),y(l,n),y(s,n)}}}function tn(m){let l,a="✏️ <strong>Essayez !</strong> Appliquez la tokenisation manuellement sur les deux phrases utilisées dans la section 2 (« <i>I’ve been waiting for a HuggingFace course my whole life.</i> » et « <i>I hate this so much!</i> »). Passez-les dans le modèle et vérifiez que vous obtenez les mêmes logits que dans la section 2. Ensuite regroupez-les en utilisant le jeton de <em>padding</em> et créez le masque d’attention approprié. Vérifiez que vous obtenez les mêmes résultats qu’en passant par le modèle !";return{c(){l=U("p"),l.innerHTML=a},l(s){l=h(s,"P",{"data-svelte-h":!0}),J(l)!=="svelte-14lslok"&&(l.innerHTML=a)},m(s,r){u(s,l,r)},p:Zl,d(s){s&&p(l)}}}function an(m){let l,a,s,r,n,f,X,Xe,q,qe,w,k,Ne,_,$,Qe,D,Es="Dans la section précédente, nous avons exploré le cas d’utilisation le plus simple : faire une inférence sur une seule séquence de petite longueur. Cependant, certaines questions émergent déjà :",De,x,zs="<li>comment gérer de plusieurs séquences ?</li> <li>comment gérer de plusieurs séquences <em>de longueurs différentes</em> ?</li> <li>les indices du vocabulaire sont-ils les seules entrées qui permettent à un modèle de bien fonctionner ?</li> <li>existe-t-il une séquence trop longue ?</li>",xe,F,Ws="Voyons quels types de problèmes ces questions posent et comment nous pouvons les résoudre en utilisant l’API 🤗 <em>Transformers</em>.",Fe,S,Se,Y,Bs=`Dans l’exercice précédent, vous avez vu comment les séquences sont traduites en listes de nombres.
Convertissons cette liste de nombres en un tenseur et envoyons-le au modèle :`,Ye,g,I,Ve,L,Rs="Pourquoi cela a échoué ? Nous avons suivi les étapes du pipeline de la section 2.",Le,K,Gs="Le problème est que nous avons envoyé une seule séquence au modèle, alors que les modèles de l’API 🤗 <em>Transformers</em> attendent plusieurs phrases par défaut. Ici, nous avons essayé de faire ce que le <em>tokenizer</em> fait en coulisses lorsque nous l’avons appliqué à une <code>séquence</code>. Cependant si vous regardez de près, vous verrez qu’il n’a pas seulement converti la liste des identifiants d’entrée en un tenseur mais aussi ajouté une dimension par-dessus :",Ke,Z,v,Ee,P,Hs="Essayons à nouveau en ajoutant une nouvelle dimension :",Pe,A,C,ze,O,Xs="Nous affichons les identifiants d’entrée ainsi que les logits résultants. Voici la sortie :",Oe,N,Q,We,ee,qs="Le « <em>batching</em> » est l’acte d’envoyer plusieurs phrases à travers le modèle, toutes en même temps. Si vous n’avez qu’une seule phrase, vous pouvez simplement construire un batch avec une seule séquence :",es,se,ss,le,Ds="Il s’agit d’un batch de deux séquences identiques !",ls,B,ns,ne,xs="Utiliser des <em>batchs</em> permet au modèle de fonctionner lorsque vous lui donnez plusieurs séquences. Utiliser plusieurs séquences est aussi simple que de construire un batch avec une seule séquence. Il y a cependant un deuxième problème. Lorsque vous essayez de regrouper deux phrases (ou plus), elles peuvent être de longueurs différentes. Si vous avez déjà travaillé avec des tenseurs, vous savez qu’ils doivent être de forme rectangulaire. Vous ne pourrez donc pas convertir directement la liste des identifiants d’entrée en un tenseur. Pour contourner ce problème, nous avons l’habitude de <em>rembourrer</em>/<em>remplir</em> (le <em>padding</em> en anglais) les entrées.",ts,te,as,ae,Fs="La liste de listes suivante ne peut pas être convertie en un tenseur :",ps,pe,us,ue,Ss="Afin de contourner ce problème, nous utilisons le <em>padding</em> pour que nos tenseurs aient une forme rectangulaire. Le <em>padding</em> permet de s’assurer que toutes nos phrases ont la même longueur en ajoutant un mot spécial appelé <em>padding token</em> aux phrases ayant moins de valeurs. Par exemple, si vous avez 10 phrases de 10 mots et 1 phrase de 20 mots, le <em>padding</em> fait en sorte que toutes les phrases aient 20 mots. Dans notre exemple, le tenseur résultant ressemble à ceci :",rs,re,is,ie,Ys="L’identifiant du jeton de <em>padding</em> peut être trouvé dans <code>tokenizer.pad_token_id</code>. Utilisons-le et envoyons nos deux phrases à travers le modèle premièrement individuellement puis en étant mises dans un même batch :",os,V,E,Be,oe,Ls="Il y a quelque chose qui ne va pas avec les logits de notre prédiction avec les séquences mises dans un même batch. La deuxième ligne devrait être la même que les logits pour la deuxième phrase, mais nous avons des valeurs complètement différentes !",cs,ce,Ks="C’est parce que dans un <em>transformer</em> les couches d’attention <em>contextualisent</em> chaque <em>token</em>. Celles-ci prennent en compte les <em>tokens</em> de <em>padding</em> puisqu’elles analysent tous les <em>tokens</em> d’une séquence. Pour obtenir le même résultat lorsque l’on passe dans notre modèle des phrases individuelles de différentes longueurs ou un batch composé de mêmes phrases avec <em>padding</em>, nous devons dire à ces couches d’attention d’ignorer les jetons de <em>padding</em>. Ceci est fait en utilisant un masque d’attention.",Ms,Me,ms,me,Ps="Les masques d’attention sont des tenseurs ayant exactement la même forme que le tenseur d’identifiants d’entrée, remplis de 0 et de 1 :",ds,de,Os="<li>1 indique que les <em>tokens</em> correspondants doivent être analysés</li> <li>0 indique que les <em>tokens</em> correspondants ne doivent pas être analysés (c’est-à-dire qu’ils doivent être ignorés par les couches d’attention du modèle).</li>",bs,be,el="Complétons l’exemple précédent avec un masque d’attention :",js,z,W,Re,je,sl="Nous obtenons maintenant les mêmes logits pour la deuxième phrase du batch.",ys,ye,ll="Remarquez comment la dernière valeur de la deuxième séquence est un identifiant de <em>padding</em> valant 0 dans le masque d’attention.",fs,R,Us,fe,hs,Ue,nl="Les <em>transformers</em> acceptent en entrée que des séquences d’une longueur limitée. La plupart des modèles traitent des séquences allant jusqu’à 512 ou 1024 <em>tokens</em> et plantent lorsqu’on leur demande de traiter des séquences plus longues. Il existe deux solutions à ce problème :",Js,he,tl="<li>utiliser un modèle avec une longueur de séquence supportée plus longue,</li> <li>tronquer les séquences.</li>",Ts,Je,al='Certains modèles sont spécialisés dans le traitement de très longues séquences comme par exemple le <a href="https://huggingface.co/transformers/model_doc/longformer.html" rel="nofollow">Longformer</a> ou le <a href="https://huggingface.co/transformers/model_doc/led.html" rel="nofollow">LED</a>. Si vous travaillez sur une tâche qui nécessite de très longues séquences, nous vous recommandons de jeter un coup d’œil à ces modèles.',ws,Te,pl="Sinon, nous vous recommandons de tronquer vos séquences en spécifiant le paramètre <code>max_sequence_length</code> :",ks,we,_s,ke,$s,Ge,gs;n=new Rl({props:{fw:m[0]}}),X=new Wl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),q=new He({props:{title:"Manipulation de plusieurs séquences",local:"manipulation-de-plusieurs-séquences",headingTag:"h1"}});const ul=[Hl,Gl],_e=[];function rl(e,t){return e[0]==="pt"?0:1}w=rl(m),k=_e[w]=ul[w](m);const il=[ql,Xl],$e=[];function ol(e,t){return e[0]==="pt"?0:1}_=ol(m),$=$e[_]=il[_](m),S=new He({props:{title:"Les modèles attendent un batch d’entrées",local:"les-modèles-attendent-un-batch-dentrées",headingTag:"h2"}});const cl=[xl,Dl],ge=[];function Ml(e,t){return e[0]==="pt"?0:1}g=Ml(m),I=ge[g]=cl[g](m);const ml=[Sl,Fl],Ie=[];function dl(e,t){return e[0]==="pt"?0:1}Z=dl(m),v=Ie[Z]=ml[Z](m);const bl=[Ll,Yl],Ze=[];function jl(e,t){return e[0]==="pt"?0:1}A=jl(m),C=Ze[A]=bl[A](m);const yl=[Pl,Kl],ve=[];function fl(e,t){return e[0]==="pt"?0:1}N=fl(m),Q=ve[N]=yl[N](m),se=new T({props:{code:"YmF0Y2hlZF9pZHMlMjAlM0QlMjAlNUJpZHMlMkMlMjBpZHMlNUQ=",highlighted:'<span class="hljs-attr">batched_ids</span> = [ids, ids]',wrap:!1}}),B=new Il({props:{$$slots:{default:[Ol]},$$scope:{ctx:m}}}),te=new He({props:{title:"<i> Padding </i> des entrées",local:"i-padding-i-des-entrées",headingTag:"h2"}}),pe=new T({props:{code:"YmF0Y2hlZF9pZHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlMkMlMjAyMDAlNUQlMkMlMEElMjAlMjAlMjAlMjAlNUIyMDAlMkMlMjAyMDAlNUQlMEElNUQ=",highlighted:`batched_ids = [
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>],
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>]
]`,wrap:!1}}),re=new T({props:{code:"cGFkZGluZ19pZCUyMCUzRCUyMDEwMCUwQSUwQWJhdGNoZWRfaWRzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTVCMjAwJTJDJTIwMjAwJTJDJTIwMjAwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTVCMjAwJTJDJTIwMjAwJTJDJTIwcGFkZGluZ19pZCU1RCUyQyUwQSU1RA==",highlighted:`padding_id = <span class="hljs-number">100</span>

batched_ids = [
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>],
    [<span class="hljs-number">200</span>, <span class="hljs-number">200</span>, padding_id],
]`,wrap:!1}});const Ul=[sn,en],Ae=[];function hl(e,t){return e[0]==="pt"?0:1}V=hl(m),E=Ae[V]=Ul[V](m),Me=new He({props:{title:"Masques d’attention",local:"masques-dattention",headingTag:"h2"}});const Jl=[nn,ln],Ce=[];function Tl(e,t){return e[0]==="pt"?0:1}return z=Tl(m),W=Ce[z]=Jl[z](m),R=new Il({props:{$$slots:{default:[tn]},$$scope:{ctx:m}}}),fe=new He({props:{title:"Séquences plus longues",local:"séquences-plus-longues",headingTag:"h2"}}),we=new T({props:{code:"c2VxdWVuY2UlMjAlM0QlMjBzZXF1ZW5jZSU1QiUzQW1heF9zZXF1ZW5jZV9sZW5ndGglNUQ=",highlighted:"sequence = sequence[:max_sequence_length]",wrap:!1}}),ke=new Bl({props:{source:"https://github.com/huggingface/course/blob/main/chapters/fr/chapter2/5.mdx"}}),{c(){l=U("meta"),a=i(),s=U("p"),r=i(),d(n.$$.fragment),f=i(),d(X.$$.fragment),Xe=i(),d(q.$$.fragment),qe=i(),k.c(),Ne=i(),$.c(),Qe=i(),D=U("p"),D.textContent=Es,De=i(),x=U("ul"),x.innerHTML=zs,xe=i(),F=U("p"),F.innerHTML=Ws,Fe=i(),d(S.$$.fragment),Se=i(),Y=U("p"),Y.textContent=Bs,Ye=i(),I.c(),Ve=i(),L=U("p"),L.textContent=Rs,Le=i(),K=U("p"),K.innerHTML=Gs,Ke=i(),v.c(),Ee=i(),P=U("p"),P.textContent=Hs,Pe=i(),C.c(),ze=i(),O=U("p"),O.textContent=Xs,Oe=i(),Q.c(),We=i(),ee=U("p"),ee.innerHTML=qs,es=i(),d(se.$$.fragment),ss=i(),le=U("p"),le.textContent=Ds,ls=i(),d(B.$$.fragment),ns=i(),ne=U("p"),ne.innerHTML=xs,ts=i(),d(te.$$.fragment),as=i(),ae=U("p"),ae.textContent=Fs,ps=i(),d(pe.$$.fragment),us=i(),ue=U("p"),ue.innerHTML=Ss,rs=i(),d(re.$$.fragment),is=i(),ie=U("p"),ie.innerHTML=Ys,os=i(),E.c(),Be=i(),oe=U("p"),oe.textContent=Ls,cs=i(),ce=U("p"),ce.innerHTML=Ks,Ms=i(),d(Me.$$.fragment),ms=i(),me=U("p"),me.textContent=Ps,ds=i(),de=U("ul"),de.innerHTML=Os,bs=i(),be=U("p"),be.textContent=el,js=i(),W.c(),Re=i(),je=U("p"),je.textContent=sl,ys=i(),ye=U("p"),ye.innerHTML=ll,fs=i(),d(R.$$.fragment),Us=i(),d(fe.$$.fragment),hs=i(),Ue=U("p"),Ue.innerHTML=nl,Js=i(),he=U("ul"),he.innerHTML=tl,Ts=i(),Je=U("p"),Je.innerHTML=al,ws=i(),Te=U("p"),Te.innerHTML=pl,ks=i(),d(we.$$.fragment),_s=i(),d(ke.$$.fragment),$s=i(),Ge=U("p"),this.h()},l(e){const t=El("svelte-u9bgzb",document.head);l=h(t,"META",{name:!0,content:!0}),t.forEach(p),a=o(e),s=h(e,"P",{}),$l(s).forEach(p),r=o(e),b(n.$$.fragment,e),f=o(e),b(X.$$.fragment,e),Xe=o(e),b(q.$$.fragment,e),qe=o(e),k.l(e),Ne=o(e),$.l(e),Qe=o(e),D=h(e,"P",{"data-svelte-h":!0}),J(D)!=="svelte-13pdcpq"&&(D.textContent=Es),De=o(e),x=h(e,"UL",{"data-svelte-h":!0}),J(x)!=="svelte-1htqdau"&&(x.innerHTML=zs),xe=o(e),F=h(e,"P",{"data-svelte-h":!0}),J(F)!=="svelte-1cqzeo2"&&(F.innerHTML=Ws),Fe=o(e),b(S.$$.fragment,e),Se=o(e),Y=h(e,"P",{"data-svelte-h":!0}),J(Y)!=="svelte-ziencv"&&(Y.textContent=Bs),Ye=o(e),I.l(e),Ve=o(e),L=h(e,"P",{"data-svelte-h":!0}),J(L)!=="svelte-1dc7q6m"&&(L.textContent=Rs),Le=o(e),K=h(e,"P",{"data-svelte-h":!0}),J(K)!=="svelte-vs1vxt"&&(K.innerHTML=Gs),Ke=o(e),v.l(e),Ee=o(e),P=h(e,"P",{"data-svelte-h":!0}),J(P)!=="svelte-c3gb2l"&&(P.textContent=Hs),Pe=o(e),C.l(e),ze=o(e),O=h(e,"P",{"data-svelte-h":!0}),J(O)!=="svelte-9n4sm7"&&(O.textContent=Xs),Oe=o(e),Q.l(e),We=o(e),ee=h(e,"P",{"data-svelte-h":!0}),J(ee)!=="svelte-1n722ay"&&(ee.innerHTML=qs),es=o(e),b(se.$$.fragment,e),ss=o(e),le=h(e,"P",{"data-svelte-h":!0}),J(le)!=="svelte-y8149p"&&(le.textContent=Ds),ls=o(e),b(B.$$.fragment,e),ns=o(e),ne=h(e,"P",{"data-svelte-h":!0}),J(ne)!=="svelte-1y1e589"&&(ne.innerHTML=xs),ts=o(e),b(te.$$.fragment,e),as=o(e),ae=h(e,"P",{"data-svelte-h":!0}),J(ae)!=="svelte-arsqyj"&&(ae.textContent=Fs),ps=o(e),b(pe.$$.fragment,e),us=o(e),ue=h(e,"P",{"data-svelte-h":!0}),J(ue)!=="svelte-agnh4j"&&(ue.innerHTML=Ss),rs=o(e),b(re.$$.fragment,e),is=o(e),ie=h(e,"P",{"data-svelte-h":!0}),J(ie)!=="svelte-1afsobr"&&(ie.innerHTML=Ys),os=o(e),E.l(e),Be=o(e),oe=h(e,"P",{"data-svelte-h":!0}),J(oe)!=="svelte-12j75sg"&&(oe.textContent=Ls),cs=o(e),ce=h(e,"P",{"data-svelte-h":!0}),J(ce)!=="svelte-cqhnrg"&&(ce.innerHTML=Ks),Ms=o(e),b(Me.$$.fragment,e),ms=o(e),me=h(e,"P",{"data-svelte-h":!0}),J(me)!=="svelte-1itz9ww"&&(me.textContent=Ps),ds=o(e),de=h(e,"UL",{"data-svelte-h":!0}),J(de)!=="svelte-12tc3tz"&&(de.innerHTML=Os),bs=o(e),be=h(e,"P",{"data-svelte-h":!0}),J(be)!=="svelte-5cirng"&&(be.textContent=el),js=o(e),W.l(e),Re=o(e),je=h(e,"P",{"data-svelte-h":!0}),J(je)!=="svelte-9gsnfq"&&(je.textContent=sl),ys=o(e),ye=h(e,"P",{"data-svelte-h":!0}),J(ye)!=="svelte-gbywhd"&&(ye.innerHTML=ll),fs=o(e),b(R.$$.fragment,e),Us=o(e),b(fe.$$.fragment,e),hs=o(e),Ue=h(e,"P",{"data-svelte-h":!0}),J(Ue)!=="svelte-1oimxg5"&&(Ue.innerHTML=nl),Js=o(e),he=h(e,"UL",{"data-svelte-h":!0}),J(he)!=="svelte-sv9tfg"&&(he.innerHTML=tl),Ts=o(e),Je=h(e,"P",{"data-svelte-h":!0}),J(Je)!=="svelte-xc8uee"&&(Je.innerHTML=al),ws=o(e),Te=h(e,"P",{"data-svelte-h":!0}),J(Te)!=="svelte-1fyxyso"&&(Te.innerHTML=pl),ks=o(e),b(we.$$.fragment,e),_s=o(e),b(ke.$$.fragment,e),$s=o(e),Ge=h(e,"P",{}),$l(Ge).forEach(p),this.h()},h(){gl(l,"name","hf:doc:metadata"),gl(l,"content",pn)},m(e,t){zl(document.head,l),u(e,a,t),u(e,s,t),u(e,r,t),j(n,e,t),u(e,f,t),j(X,e,t),u(e,Xe,t),j(q,e,t),u(e,qe,t),_e[w].m(e,t),u(e,Ne,t),$e[_].m(e,t),u(e,Qe,t),u(e,D,t),u(e,De,t),u(e,x,t),u(e,xe,t),u(e,F,t),u(e,Fe,t),j(S,e,t),u(e,Se,t),u(e,Y,t),u(e,Ye,t),ge[g].m(e,t),u(e,Ve,t),u(e,L,t),u(e,Le,t),u(e,K,t),u(e,Ke,t),Ie[Z].m(e,t),u(e,Ee,t),u(e,P,t),u(e,Pe,t),Ze[A].m(e,t),u(e,ze,t),u(e,O,t),u(e,Oe,t),ve[N].m(e,t),u(e,We,t),u(e,ee,t),u(e,es,t),j(se,e,t),u(e,ss,t),u(e,le,t),u(e,ls,t),j(B,e,t),u(e,ns,t),u(e,ne,t),u(e,ts,t),j(te,e,t),u(e,as,t),u(e,ae,t),u(e,ps,t),j(pe,e,t),u(e,us,t),u(e,ue,t),u(e,rs,t),j(re,e,t),u(e,is,t),u(e,ie,t),u(e,os,t),Ae[V].m(e,t),u(e,Be,t),u(e,oe,t),u(e,cs,t),u(e,ce,t),u(e,Ms,t),j(Me,e,t),u(e,ms,t),u(e,me,t),u(e,ds,t),u(e,de,t),u(e,bs,t),u(e,be,t),u(e,js,t),Ce[z].m(e,t),u(e,Re,t),u(e,je,t),u(e,ys,t),u(e,ye,t),u(e,fs,t),j(R,e,t),u(e,Us,t),j(fe,e,t),u(e,hs,t),u(e,Ue,t),u(e,Js,t),u(e,he,t),u(e,Ts,t),u(e,Je,t),u(e,ws,t),u(e,Te,t),u(e,ks,t),j(we,e,t),u(e,_s,t),j(ke,e,t),u(e,$s,t),u(e,Ge,t),gs=!0},p(e,[t]){const wl={};t&1&&(wl.fw=e[0]),n.$set(wl);let Is=w;w=rl(e),w!==Is&&(H(),c(_e[Is],1,1,()=>{_e[Is]=null}),G(),k=_e[w],k||(k=_e[w]=ul[w](e),k.c()),M(k,1),k.m(Ne.parentNode,Ne));let Zs=_;_=ol(e),_!==Zs&&(H(),c($e[Zs],1,1,()=>{$e[Zs]=null}),G(),$=$e[_],$||($=$e[_]=il[_](e),$.c()),M($,1),$.m(Qe.parentNode,Qe));let vs=g;g=Ml(e),g!==vs&&(H(),c(ge[vs],1,1,()=>{ge[vs]=null}),G(),I=ge[g],I||(I=ge[g]=cl[g](e),I.c()),M(I,1),I.m(Ve.parentNode,Ve));let As=Z;Z=dl(e),Z!==As&&(H(),c(Ie[As],1,1,()=>{Ie[As]=null}),G(),v=Ie[Z],v||(v=Ie[Z]=ml[Z](e),v.c()),M(v,1),v.m(Ee.parentNode,Ee));let Cs=A;A=jl(e),A!==Cs&&(H(),c(Ze[Cs],1,1,()=>{Ze[Cs]=null}),G(),C=Ze[A],C||(C=Ze[A]=bl[A](e),C.c()),M(C,1),C.m(ze.parentNode,ze));let Ns=N;N=fl(e),N!==Ns&&(H(),c(ve[Ns],1,1,()=>{ve[Ns]=null}),G(),Q=ve[N],Q||(Q=ve[N]=yl[N](e),Q.c()),M(Q,1),Q.m(We.parentNode,We));const kl={};t&2&&(kl.$$scope={dirty:t,ctx:e}),B.$set(kl);let Qs=V;V=hl(e),V!==Qs&&(H(),c(Ae[Qs],1,1,()=>{Ae[Qs]=null}),G(),E=Ae[V],E||(E=Ae[V]=Ul[V](e),E.c()),M(E,1),E.m(Be.parentNode,Be));let Vs=z;z=Tl(e),z!==Vs&&(H(),c(Ce[Vs],1,1,()=>{Ce[Vs]=null}),G(),W=Ce[z],W||(W=Ce[z]=Jl[z](e),W.c()),M(W,1),W.m(Re.parentNode,Re));const _l={};t&2&&(_l.$$scope={dirty:t,ctx:e}),R.$set(_l)},i(e){gs||(M(n.$$.fragment,e),M(X.$$.fragment,e),M(q.$$.fragment,e),M(k),M($),M(S.$$.fragment,e),M(I),M(v),M(C),M(Q),M(se.$$.fragment,e),M(B.$$.fragment,e),M(te.$$.fragment,e),M(pe.$$.fragment,e),M(re.$$.fragment,e),M(E),M(Me.$$.fragment,e),M(W),M(R.$$.fragment,e),M(fe.$$.fragment,e),M(we.$$.fragment,e),M(ke.$$.fragment,e),gs=!0)},o(e){c(n.$$.fragment,e),c(X.$$.fragment,e),c(q.$$.fragment,e),c(k),c($),c(S.$$.fragment,e),c(I),c(v),c(C),c(Q),c(se.$$.fragment,e),c(B.$$.fragment,e),c(te.$$.fragment,e),c(pe.$$.fragment,e),c(re.$$.fragment,e),c(E),c(Me.$$.fragment,e),c(W),c(R.$$.fragment,e),c(fe.$$.fragment,e),c(we.$$.fragment,e),c(ke.$$.fragment,e),gs=!1},d(e){e&&(p(a),p(s),p(r),p(f),p(Xe),p(qe),p(Ne),p(Qe),p(D),p(De),p(x),p(xe),p(F),p(Fe),p(Se),p(Y),p(Ye),p(Ve),p(L),p(Le),p(K),p(Ke),p(Ee),p(P),p(Pe),p(ze),p(O),p(Oe),p(We),p(ee),p(es),p(ss),p(le),p(ls),p(ns),p(ne),p(ts),p(as),p(ae),p(ps),p(us),p(ue),p(rs),p(is),p(ie),p(os),p(Be),p(oe),p(cs),p(ce),p(Ms),p(ms),p(me),p(ds),p(de),p(bs),p(be),p(js),p(Re),p(je),p(ys),p(ye),p(fs),p(Us),p(hs),p(Ue),p(Js),p(he),p(Ts),p(Je),p(ws),p(Te),p(ks),p(_s),p($s),p(Ge)),p(l),y(n,e),y(X,e),y(q,e),_e[w].d(e),$e[_].d(e),y(S,e),ge[g].d(e),Ie[Z].d(e),Ze[A].d(e),ve[N].d(e),y(se,e),y(B,e),y(te,e),y(pe,e),y(re,e),Ae[V].d(e),y(Me,e),Ce[z].d(e),y(R,e),y(fe,e),y(we,e),y(ke,e)}}}const pn='{"title":"Manipulation de plusieurs séquences","local":"manipulation-de-plusieurs-séquences","sections":[{"title":"Les modèles attendent un batch d’entrées","local":"les-modèles-attendent-un-batch-dentrées","sections":[],"depth":2},{"title":"<i> Padding </i> des entrées","local":"i-padding-i-des-entrées","sections":[],"depth":2},{"title":"Masques d’attention","local":"masques-dattention","sections":[],"depth":2},{"title":"Séquences plus longues","local":"séquences-plus-longues","sections":[],"depth":2}],"depth":1}';function un(m,l,a){let s="pt";return Nl(()=>{const r=new URLSearchParams(window.location.search);a(0,s=r.get("fw")||"pt")}),[s]}class yn extends Ql{constructor(l){super(),Vl(this,l,un,an,Cl,{})}}export{yn as component};
