import{s as na,o as oa,n as Kt}from"../chunks/scheduler.9bc65507.js";import{S as sa,i as aa,g as o,s as i,u,A as ra,h as s,f as t,c as l,j as h,v as f,y as c,k as d,l as ia,o as a,a as r,w as g,d as _,t as v,x as M}from"../chunks/index.78c82d43.js";import{T as Ro}from"../chunks/Tip.87d55b76.js";import{D as rt}from"../chunks/Docstring.4e7352e2.js";import{C as it}from"../chunks/CodeBlock.73e038be.js";import{I as z}from"../chunks/IconCopyLink.bedaa44d.js";import{E as ta}from"../chunks/ExampleCodeBlock.872b014d.js";function la(F){let p,y;return p=new it({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1pc3RyYWxNb2RlbCUyQyUyME1pc3RyYWxDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwTWlzdHJhbCUyMDdCJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyME1pc3RyYWxDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBNaXN0cmFsJTIwN0IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyME1pc3RyYWxNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MistralModel, MistralConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Mistral 7B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MistralConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the Mistral 7B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MistralModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){u(p.$$.fragment)},l(m){f(p.$$.fragment,m)},m(m,w){g(p,m,w),y=!0},p:Kt,i(m){y||(_(p.$$.fragment,m),y=!0)},o(m){v(p.$$.fragment,m),y=!1},d(m){M(p,m)}}}function da(F){let p,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){p=o("p"),p.innerHTML=y},l(m){p=s(m,"P",{"data-svelte-h":!0}),c(p)!=="svelte-fincs2"&&(p.innerHTML=y)},m(m,w){r(m,p,w)},p:Kt,d(m){m&&t(p)}}}function ca(F){let p,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){p=o("p"),p.innerHTML=y},l(m){p=s(m,"P",{"data-svelte-h":!0}),c(p)!=="svelte-fincs2"&&(p.innerHTML=y)},m(m,w){r(m,p,w)},p:Kt,d(m){m&&t(p)}}}function pa(F){let p,y="Example:",m,w,C;return w=new it({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBNaXN0cmFsRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyME1pc3RyYWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoUEFUSF9UT19DT05WRVJURURfV0VJR0hUUyklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9UT0tFTklaRVIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIySGV5JTJDJTIwYXJlJTIweW91JTIwY29uc2Npb3VzJTNGJTIwQ2FuJTIweW91JTIwdGFsayUyMHRvJTIwbWUlM0YlMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbGVuZ3RoJTNEMzApJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, MistralForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = MistralForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){p=o("p"),p.textContent=y,m=i(),u(w.$$.fragment)},l(b){p=s(b,"P",{"data-svelte-h":!0}),c(p)!=="svelte-11lpom8"&&(p.textContent=y),m=l(b),f(w.$$.fragment,b)},m(b,E){r(b,p,E),r(b,m,E),g(w,b,E),C=!0},p:Kt,i(b){C||(_(w.$$.fragment,b),C=!0)},o(b){v(w.$$.fragment,b),C=!1},d(b){b&&(t(p),t(m)),M(w,b)}}}function ha(F){let p,y=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){p=o("p"),p.innerHTML=y},l(m){p=s(m,"P",{"data-svelte-h":!0}),c(p)!=="svelte-fincs2"&&(p.innerHTML=y)},m(m,w){r(m,p,w)},p:Kt,d(m){m&&t(p)}}}function ma(F){let p,y,m,w,C,b,E,ue,no,lt,So="Mistral",en,W,Q,Ht,fe,oo,dt,No="Overview",tn,ge,Zo="Mistral-7B-v0.1 is Mistral AI’s first Large Language Model (LLM).",nn,H,Y,Rt,_e,so,ct,Po="Model Details",on,ve,qo="Mistral-7B-v0.1 is a decoder-based LM with the following architectural choices:",sn,Me,Bo="<li>Sliding Window Attention - Trained with 8k context length and fixed cache size, with a theoretical attention span of 128K tokens</li> <li>GQA (Grouped Query Attention) - allowing faster inference and lower cache size.</li> <li>Byte-fallback BPE tokenizer - ensures that characters are never mapped to out of vocabulary tokens.</li>",an,be,Ao="We also provide an instruction fine-tuned model: <code>Mistral-7B-Instruct-v0.1</code> which can be used for chat-based inference.",rn,ye,Go='For more details please read our <a href="https://mistral.ai/news/announcing-mistral-7b-v0.1/" rel="nofollow">release blog post</a>',ln,R,D,St,we,ao,pt,Vo="License",dn,Te,Xo="Both <code>Mistral-7B-v0.1</code> and <code>Mistral-7B-Instruct-v0.1</code> are released under the Apache 2.0 license.",cn,S,O,Nt,ke,ro,ht,Qo="Usage",pn,$e,Yo='<code>Mistral-7B-v0.1</code> and <code>Mistral-7B-Instruct-v0.1</code> can be found on the <a href="https://huggingface.co/mistralai" rel="nofollow">Huggingface Hub</a>',hn,Ce,Do="These ready-to-use checkpoints can be downloaded and used via the HuggingFace Hub:",mn,xe,un,ze,Oo="Raw weights for <code>Mistral-7B-v0.1</code> and <code>Mistral-7B-Instruct-v0.1</code> can be downloaded from:",fn,Fe,Ko='<thead><tr><th>Model Name</th> <th>Checkpoint</th></tr></thead> <tbody><tr><td><code>Mistral-7B-v0.1</code></td> <td><a href="https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-v0.1.tar" rel="nofollow">Raw Checkpoint</a></td></tr> <tr><td><code>Mistral-7B-Instruct-v0.1</code></td> <td><a href="https://files.mistral-7b-v0-1.mistral.ai/mistral-7B-instruct-v0.1.tar" rel="nofollow">Raw Checkpoint</a></td></tr></tbody>',gn,Je,es="To use these raw checkpoints with HuggingFace you can use the <code>convert_mistral_weights_to_hf.py</code> script to convert them to the HuggingFace format:",_n,Le,vn,je,ts="You can then load the converted model from the <code>output/path</code>:",Mn,Ue,bn,N,K,Zt,Ie,io,mt,ns="Combining Mistral and Flash Attention 2",yn,Ee,os="First, make sure to install the latest version of Flash Attention 2 to include the sliding window attention feature.",wn,We,Tn,He,ss='Make also sure that you have a hardware that is compatible with Flash-Attention 2. Read more about it in the official documentation of <a href="https://github.com/Dao-AILab/flash-attention" rel="nofollow"><code>flash-attn</code></a> repository. Make also sure to load your model in half-precision (e.g. <code>torch.float16</code>)',kn,Re,as="To load and run a model using Flash Attention 2, refer to the snippet below:",$n,Se,Cn,Z,ee,Pt,Ne,lo,ut,rs="Expected speedups",xn,Ze,is="Below is a expected speedup diagram that compares pure inference time between the native implementation in transformers using <code>mistralai/Mistral-7B-v0.1</code> checkpoint and the Flash Attention 2 version of the model.",zn,te,ls='<img src="https://huggingface.co/datasets/ybelkada/documentation-images/resolve/main/mistral-7b-inference-large-seqlen.png"/>',Fn,P,ne,qt,Pe,co,ft,ds="Sliding window Attention",Jn,qe,cs=`The current implementation supports the sliding window attention mechanism and memory efficient cache management.
To enable sliding window attention, just make sure to have a <code>flash-attn</code> version that is compatible with sliding window attention (<code>&gt;=2.3.0</code>).`,Ln,Be,ps="The Flash Attention-2 model uses also a more memory efficient cache slicing mechanism - as recommended per the official implementation of Mistral model that use rolling cache mechanism we keep the cache size fixed (<code>self.config.sliding_window</code>), support batched generation only for <code>padding_side=&quot;left&quot;</code> and use the absolute position of the current token to compute the positional embedding.",jn,q,oe,Bt,Ae,po,gt,hs="The Mistral Team",Un,Ge,ms="Albert Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lélio Renard Lavaud, Lucile Saulnier, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothée Lacroix, William El Sayed.",In,B,se,At,Ve,ho,_t,us="MistralConfig",En,k,Xe,mo,vt,fs=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralModel">MistralModel</a>. It is used to instantiate an
Mistral 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 Mistral-7B-v0.1 or Mistral-7B-Instruct-v0.1.`,uo,Mt,gs='<a href="https://huggingface.co/mistralai/Mistral-7B-v0.1" rel="nofollow">mistralai/Mistral-7B-v0.1</a> <a href="https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1" rel="nofollow">mistralai/Mistral-7B-Instruct-v0.1</a>',fo,bt,_s=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,go,ae,Wn,A,re,Gt,Qe,_o,yt,vs="MistralModel",Hn,$,Ye,vo,wt,Ms=`The bare Mistral Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Mo,Tt,bs=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,bo,kt,ys="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>MistralDecoderLayer</code>",yo,L,De,wo,$t,ws='The <a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralModel">MistralModel</a> forward method, overrides the <code>__call__</code> special method.',To,ie,Rn,G,le,Vt,Oe,ko,Ct,Ts="MistralForCausalLM",Sn,V,Ke,$o,J,et,Co,xt,ks='The <a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralForCausalLM">MistralForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',xo,de,zo,ce,Nn,X,pe,Xt,tt,Fo,zt,$s="MistralForSequenceClassification",Zn,T,nt,Jo,Ft,Cs="The Mistral Model transformer with a sequence classification head on top (linear layer).",Lo,Jt,xs=`<a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralForSequenceClassification">MistralForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,jo,Lt,zs=`Since it does classification on the last token, it requires to know the position of the last token. If a
<code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If
no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in
each row of the batch).`,Uo,jt,Fs=`This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. 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.)`,Io,Ut,Js=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Eo,j,ot,Wo,It,Ls='The <a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralForSequenceClassification">MistralForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',Ho,he,Pn,Qt,qn;return ue=new z({}),fe=new z({}),_e=new z({}),we=new z({}),ke=new z({}),xe=new it({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUwQWRldmljZSUyMCUzRCUyMCUyMmN1ZGElMjIlMjAlMjMlMjB0aGUlMjBkZXZpY2UlMjB0byUyMGxvYWQlMjB0aGUlMjBtb2RlbCUyMG9udG8lMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJtaXN0cmFsYWklMkZNaXN0cmFsLTdCLXYwLjElMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWlzdHJhbGFpJTJGTWlzdHJhbC03Qi12MC4xJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMk15JTIwZmF2b3VyaXRlJTIwY29uZGltZW50JTIwaXMlMjIlMEElMEFtb2RlbF9pbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlKSUwQW1vZGVsLnRvKGRldmljZSklMEElMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKiptb2RlbF9pbnB1dHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDEwMCUyQyUyMGRvX3NhbXBsZSUzRFRydWUpJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-comment"># the device to load the model onto</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;mistralai/Mistral-7B-v0.1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mistralai/Mistral-7B-v0.1&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;My favourite condiment is&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model_inputs = tokenizer([prompt], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**model_inputs, max_new_tokens=<span class="hljs-number">100</span>, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generated_ids)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;The expected outupt&quot;</span>`,wrap:!1}}),Le=new it({props:{code:"cHl0aG9uJTIwc3JjJTJGdHJhbnNmb3JtZXJzJTJGbW9kZWxzJTJGbWlzdHJhbCUyRmNvbnZlcnRfbWlzdHJhbF93ZWlnaHRzX3RvX2hmLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1pbnB1dF9kaXIlMjAlMkZwYXRoJTJGdG8lMkZkb3dubG9hZGVkJTJGbWlzdHJhbCUyRndlaWdodHMlMjAtLW1vZGVsX3NpemUlMjA3QiUyMC0tb3V0cHV0X2RpciUyMCUyRm91dHB1dCUyRnBhdGg=",highlighted:`python src/transformers/models/mistral/convert_mistral_weights_to_hf.py \\
    --input_dir /path/to/downloaded/mistral/weights --model_size 7B --output_dir /output/path`,wrap:!1}}),Ue=new it({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1pc3RyYWxGb3JDYXVzYWxMTSUyQyUyMExsYW1hVG9rZW56aWVyJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwTGxhbWFUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMiUyRm91dHB1dCUyRnBhdGglMjIpJTBBbW9kZWwlMjAlM0QlMjBNaXN0cmFsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMiUyRm91dHB1dCUyRnBhdGglMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MistralForCausalLM, LlamaTokenzier

tokenizer = LlamaTokenizer.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)
model = MistralForCausalLM.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)`,wrap:!1}}),Ie=new z({}),We=new it({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1VJTIwZmxhc2gtYXR0biUyMC0tbm8tYnVpbGQtaXNvbGF0aW9u",highlighted:"pip install -U flash-attn --no-build-isolation",wrap:!1}}),Se=new it({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMCUyMyUyMHRoZSUyMGRldmljZSUyMHRvJTIwbG9hZCUyMHRoZSUyMG1vZGVsJTIwb250byUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMm1pc3RyYWxhaSUyRk1pc3RyYWwtN0ItdjAuMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9mbGFzaF9hdHRlbnRpb25fMiUzRFRydWUpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIybWlzdHJhbGFpJTJGTWlzdHJhbC03Qi12MC4xJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMk15JTIwZmF2b3VyaXRlJTIwY29uZGltZW50JTIwaXMlMjIlMEElMEFtb2RlbF9pbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCcHJvbXB0JTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlKSUwQW1vZGVsLnRvKGRldmljZSklMEElMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKiptb2RlbF9pbnB1dHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDEwMCUyQyUyMGRvX3NhbXBsZSUzRFRydWUpJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzKSU1QjAlNUQ=",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> AutoModelForCausalLM, AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-comment"># the device to load the model onto</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;mistralai/Mistral-7B-v0.1&quot;</span>, torch_dtype=torch.float16, use_flash_attention_2=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;mistralai/Mistral-7B-v0.1&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;My favourite condiment is&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model_inputs = tokenizer([prompt], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**model_inputs, max_new_tokens=<span class="hljs-number">100</span>, do_sample=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generated_ids)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;The expected outupt&quot;</span>`,wrap:!1}}),Ne=new z({}),Pe=new z({}),Ae=new z({}),Ve=new z({}),Xe=new rt({props:{name:"class transformers.MistralConfig",anchor:"transformers.MistralConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 14336"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = 8"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 131072"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = None"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"sliding_window",val:" = 4096"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MistralConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the Mistral model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralModel">MistralModel</a>`,name:"vocab_size"},{anchor:"transformers.MistralConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.MistralConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 14336) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.MistralConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.MistralConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.MistralConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed by meanpooling all the original heads within that group. For more details checkout [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to </code>8\`.`,name:"num_key_value_heads"},{anchor:"transformers.MistralConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.MistralConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096<em>32) &#x2014;
The maximum sequence length that this model might ever be used with. Mistral&#x2019;s sliding window attention
allows sequence of up to 4096</em>32 tokens.`,name:"max_position_embeddings"},{anchor:"transformers.MistralConfig.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.MistralConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.MistralConfig.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.MistralConfig.tie_word_embeddings(bool,",description:`<strong>tie_word_embeddings(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings(bool,"},{anchor:"transformers.MistralConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.MistralConfig.sliding_window",description:`<strong>sliding_window</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Sliding window attention window size. If not specified, will default to <code>4096</code>.</p>
<p>Example &#x2014;`,name:"sliding_window"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/mistral/configuration_mistral.py#L29"}}),ae=new ta({props:{anchor:"transformers.MistralConfig.example",$$slots:{default:[la]},$$scope:{ctx:F}}}),Qe=new z({}),Ye=new rt({props:{name:"class transformers.MistralModel",anchor:"transformers.MistralModel",parameters:[{name:"config",val:": MistralConfig"}],parametersDescription:[{anchor:"transformers.MistralModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralConfig">MistralConfig</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.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; MistralConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/mistral/modeling_mistral.py#L762"}}),De=new rt({props:{name:"forward",anchor:"transformers.MistralModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[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.MistralModel.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.MistralModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</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:"attention_mask"},{anchor:"transformers.MistralModel.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MistralModel.forward.past_key_values",description:`<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>) &#x2014;
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 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 in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential 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.MistralModel.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.MistralModel.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"},{anchor:"transformers.MistralModel.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.MistralModel.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.MistralModel.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/mistral/modeling_mistral.py#L815"}}),ie=new Ro({props:{$$slots:{default:[da]},$$scope:{ctx:F}}}),Oe=new z({}),Ke=new rt({props:{name:"class transformers.MistralForCausalLM",anchor:"transformers.MistralForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/mistral/modeling_mistral.py#L967"}}),et=new rt({props:{name:"forward",anchor:"transformers.MistralForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.MistralForCausalLM.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.MistralForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</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:"attention_mask"},{anchor:"transformers.MistralForCausalLM.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MistralForCausalLM.forward.past_key_values",description:`<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>) &#x2014;
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 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 in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential 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.MistralForCausalLM.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.MistralForCausalLM.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"},{anchor:"transformers.MistralForCausalLM.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.MistralForCausalLM.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.MistralForCausalLM.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (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:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/mistral/modeling_mistral.py#L997",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</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.34.0/en/model_doc/mistral#transformers.MistralConfig"
>MistralConfig</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) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</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>) — 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>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-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(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, 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.34.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new Ro({props:{$$slots:{default:[ca]},$$scope:{ctx:F}}}),ce=new ta({props:{anchor:"transformers.MistralForCausalLM.forward.example",$$slots:{default:[pa]},$$scope:{ctx:F}}}),tt=new z({}),nt=new rt({props:{name:"class transformers.MistralForSequenceClassification",anchor:"transformers.MistralForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MistralForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/mistral#transformers.MistralConfig">MistralConfig</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.34.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.34.0/src/transformers/models/mistral/modeling_mistral.py#L1142"}}),ot=new rt({props:{name:"forward",anchor:"transformers.MistralForSequenceClassification.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.MistralForSequenceClassification.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. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.MistralForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.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></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</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:"attention_mask"},{anchor:"transformers.MistralForSequenceClassification.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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.MistralForSequenceClassification.forward.past_key_values",description:`<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>) &#x2014;
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 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 in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential 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.MistralForSequenceClassification.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.MistralForSequenceClassification.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"},{anchor:"transformers.MistralForSequenceClassification.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.MistralForSequenceClassification.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.MistralForSequenceClassification.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.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MistralForSequenceClassification.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.34.0/src/transformers/models/mistral/modeling_mistral.py#L1158"}}),he=new Ro({props:{$$slots:{default:[ha]},$$scope:{ctx:F}}}),{c(){p=o("meta"),y=i(),m=o("p"),w=i(),C=o("h1"),b=o("a"),E=o("span"),u(ue.$$.fragment),no=i(),lt=o("span"),lt.textContent=So,en=i(),W=o("h2"),Q=o("a"),Ht=o("span"),u(fe.$$.fragment),oo=i(),dt=o("span"),dt.textContent=No,tn=i(),ge=o("p"),ge.textContent=Zo,nn=i(),H=o("h2"),Y=o("a"),Rt=o("span"),u(_e.$$.fragment),so=i(),ct=o("span"),ct.textContent=Po,on=i(),ve=o("p"),ve.textContent=qo,sn=i(),Me=o("ul"),Me.innerHTML=Bo,an=i(),be=o("p"),be.innerHTML=Ao,rn=i(),ye=o("p"),ye.innerHTML=Go,ln=i(),R=o("h2"),D=o("a"),St=o("span"),u(we.$$.fragment),ao=i(),pt=o("span"),pt.textContent=Vo,dn=i(),Te=o("p"),Te.innerHTML=Xo,cn=i(),S=o("h2"),O=o("a"),Nt=o("span"),u(ke.$$.fragment),ro=i(),ht=o("span"),ht.textContent=Qo,pn=i(),$e=o("p"),$e.innerHTML=Yo,hn=i(),Ce=o("p"),Ce.textContent=Do,mn=i(),u(xe.$$.fragment),un=i(),ze=o("p"),ze.innerHTML=Oo,fn=i(),Fe=o("table"),Fe.innerHTML=Ko,gn=i(),Je=o("p"),Je.innerHTML=es,_n=i(),u(Le.$$.fragment),vn=i(),je=o("p"),je.innerHTML=ts,Mn=i(),u(Ue.$$.fragment),bn=i(),N=o("h2"),K=o("a"),Zt=o("span"),u(Ie.$$.fragment),io=i(),mt=o("span"),mt.textContent=ns,yn=i(),Ee=o("p"),Ee.textContent=os,wn=i(),u(We.$$.fragment),Tn=i(),He=o("p"),He.innerHTML=ss,kn=i(),Re=o("p"),Re.textContent=as,$n=i(),u(Se.$$.fragment),Cn=i(),Z=o("h3"),ee=o("a"),Pt=o("span"),u(Ne.$$.fragment),lo=i(),ut=o("span"),ut.textContent=rs,xn=i(),Ze=o("p"),Ze.innerHTML=is,zn=i(),te=o("div"),te.innerHTML=ls,Fn=i(),P=o("h3"),ne=o("a"),qt=o("span"),u(Pe.$$.fragment),co=i(),ft=o("span"),ft.textContent=ds,Jn=i(),qe=o("p"),qe.innerHTML=cs,Ln=i(),Be=o("p"),Be.innerHTML=ps,jn=i(),q=o("h2"),oe=o("a"),Bt=o("span"),u(Ae.$$.fragment),po=i(),gt=o("span"),gt.textContent=hs,Un=i(),Ge=o("p"),Ge.textContent=ms,In=i(),B=o("h2"),se=o("a"),At=o("span"),u(Ve.$$.fragment),ho=i(),_t=o("span"),_t.textContent=us,En=i(),k=o("div"),u(Xe.$$.fragment),mo=i(),vt=o("p"),vt.innerHTML=fs,uo=i(),Mt=o("p"),Mt.innerHTML=gs,fo=i(),bt=o("p"),bt.innerHTML=_s,go=i(),u(ae.$$.fragment),Wn=i(),A=o("h2"),re=o("a"),Gt=o("span"),u(Qe.$$.fragment),_o=i(),yt=o("span"),yt.textContent=vs,Hn=i(),$=o("div"),u(Ye.$$.fragment),vo=i(),wt=o("p"),wt.innerHTML=Ms,Mo=i(),Tt=o("p"),Tt.innerHTML=bs,bo=i(),kt=o("p"),kt.innerHTML=ys,yo=i(),L=o("div"),u(De.$$.fragment),wo=i(),$t=o("p"),$t.innerHTML=ws,To=i(),u(ie.$$.fragment),Rn=i(),G=o("h2"),le=o("a"),Vt=o("span"),u(Oe.$$.fragment),ko=i(),Ct=o("span"),Ct.textContent=Ts,Sn=i(),V=o("div"),u(Ke.$$.fragment),$o=i(),J=o("div"),u(et.$$.fragment),Co=i(),xt=o("p"),xt.innerHTML=ks,xo=i(),u(de.$$.fragment),zo=i(),u(ce.$$.fragment),Nn=i(),X=o("h2"),pe=o("a"),Xt=o("span"),u(tt.$$.fragment),Fo=i(),zt=o("span"),zt.textContent=$s,Zn=i(),T=o("div"),u(nt.$$.fragment),Jo=i(),Ft=o("p"),Ft.textContent=Cs,Lo=i(),Jt=o("p"),Jt.innerHTML=xs,jo=i(),Lt=o("p"),Lt.innerHTML=zs,Uo=i(),jt=o("p"),jt.innerHTML=Fs,Io=i(),Ut=o("p"),Ut.innerHTML=Js,Eo=i(),j=o("div"),u(ot.$$.fragment),Wo=i(),It=o("p"),It.innerHTML=Ls,Ho=i(),u(he.$$.fragment),Pn=i(),Qt=o("p"),this.h()},l(e){const n=ra("svelte-1phssyn",document.head);p=s(n,"META",{name:!0,content:!0}),n.forEach(t),y=l(e),m=s(e,"P",{}),h(m).forEach(t),w=l(e),C=s(e,"H1",{class:!0});var st=h(C);b=s(st,"A",{id:!0,class:!0,href:!0});var Yt=h(b);E=s(Yt,"SPAN",{});var Dt=h(E);f(ue.$$.fragment,Dt),Dt.forEach(t),Yt.forEach(t),no=l(st),lt=s(st,"SPAN",{"data-svelte-h":!0}),c(lt)!=="svelte-1vtcy7n"&&(lt.textContent=So),st.forEach(t),en=l(e),W=s(e,"H2",{class:!0});var at=h(W);Q=s(at,"A",{id:!0,class:!0,href:!0});var Ot=h(Q);Ht=s(Ot,"SPAN",{});var js=h(Ht);f(fe.$$.fragment,js),js.forEach(t),Ot.forEach(t),oo=l(at),dt=s(at,"SPAN",{"data-svelte-h":!0}),c(dt)!=="svelte-1jsw1pg"&&(dt.textContent=No),at.forEach(t),tn=l(e),ge=s(e,"P",{"data-svelte-h":!0}),c(ge)!=="svelte-1nseuow"&&(ge.textContent=Zo),nn=l(e),H=s(e,"H2",{class:!0});var Bn=h(H);Y=s(Bn,"A",{id:!0,class:!0,href:!0});var Us=h(Y);Rt=s(Us,"SPAN",{});var Is=h(Rt);f(_e.$$.fragment,Is),Is.forEach(t),Us.forEach(t),so=l(Bn),ct=s(Bn,"SPAN",{"data-svelte-h":!0}),c(ct)!=="svelte-qeekjg"&&(ct.textContent=Po),Bn.forEach(t),on=l(e),ve=s(e,"P",{"data-svelte-h":!0}),c(ve)!=="svelte-unnu27"&&(ve.textContent=qo),sn=l(e),Me=s(e,"UL",{"data-svelte-h":!0}),c(Me)!=="svelte-hqpplt"&&(Me.innerHTML=Bo),an=l(e),be=s(e,"P",{"data-svelte-h":!0}),c(be)!=="svelte-1w3a9um"&&(be.innerHTML=Ao),rn=l(e),ye=s(e,"P",{"data-svelte-h":!0}),c(ye)!=="svelte-1ca853y"&&(ye.innerHTML=Go),ln=l(e),R=s(e,"H2",{class:!0});var An=h(R);D=s(An,"A",{id:!0,class:!0,href:!0});var Es=h(D);St=s(Es,"SPAN",{});var Ws=h(St);f(we.$$.fragment,Ws),Ws.forEach(t),Es.forEach(t),ao=l(An),pt=s(An,"SPAN",{"data-svelte-h":!0}),c(pt)!=="svelte-1lj9d54"&&(pt.textContent=Vo),An.forEach(t),dn=l(e),Te=s(e,"P",{"data-svelte-h":!0}),c(Te)!=="svelte-14253l8"&&(Te.innerHTML=Xo),cn=l(e),S=s(e,"H2",{class:!0});var Gn=h(S);O=s(Gn,"A",{id:!0,class:!0,href:!0});var Hs=h(O);Nt=s(Hs,"SPAN",{});var Rs=h(Nt);f(ke.$$.fragment,Rs),Rs.forEach(t),Hs.forEach(t),ro=l(Gn),ht=s(Gn,"SPAN",{"data-svelte-h":!0}),c(ht)!=="svelte-jwh4bg"&&(ht.textContent=Qo),Gn.forEach(t),pn=l(e),$e=s(e,"P",{"data-svelte-h":!0}),c($e)!=="svelte-u5jvf7"&&($e.innerHTML=Yo),hn=l(e),Ce=s(e,"P",{"data-svelte-h":!0}),c(Ce)!=="svelte-a5tlwb"&&(Ce.textContent=Do),mn=l(e),f(xe.$$.fragment,e),un=l(e),ze=s(e,"P",{"data-svelte-h":!0}),c(ze)!=="svelte-1jktxis"&&(ze.innerHTML=Oo),fn=l(e),Fe=s(e,"TABLE",{"data-svelte-h":!0}),c(Fe)!=="svelte-azzqtn"&&(Fe.innerHTML=Ko),gn=l(e),Je=s(e,"P",{"data-svelte-h":!0}),c(Je)!=="svelte-192zt76"&&(Je.innerHTML=es),_n=l(e),f(Le.$$.fragment,e),vn=l(e),je=s(e,"P",{"data-svelte-h":!0}),c(je)!=="svelte-1svz3xz"&&(je.innerHTML=ts),Mn=l(e),f(Ue.$$.fragment,e),bn=l(e),N=s(e,"H2",{class:!0});var Vn=h(N);K=s(Vn,"A",{id:!0,class:!0,href:!0});var Ss=h(K);Zt=s(Ss,"SPAN",{});var Ns=h(Zt);f(Ie.$$.fragment,Ns),Ns.forEach(t),Ss.forEach(t),io=l(Vn),mt=s(Vn,"SPAN",{"data-svelte-h":!0}),c(mt)!=="svelte-1rtnqt2"&&(mt.textContent=ns),Vn.forEach(t),yn=l(e),Ee=s(e,"P",{"data-svelte-h":!0}),c(Ee)!=="svelte-o3pzzu"&&(Ee.textContent=os),wn=l(e),f(We.$$.fragment,e),Tn=l(e),He=s(e,"P",{"data-svelte-h":!0}),c(He)!=="svelte-qk7tod"&&(He.innerHTML=ss),kn=l(e),Re=s(e,"P",{"data-svelte-h":!0}),c(Re)!=="svelte-14hchid"&&(Re.textContent=as),$n=l(e),f(Se.$$.fragment,e),Cn=l(e),Z=s(e,"H3",{class:!0});var Xn=h(Z);ee=s(Xn,"A",{id:!0,class:!0,href:!0});var Zs=h(ee);Pt=s(Zs,"SPAN",{});var Ps=h(Pt);f(Ne.$$.fragment,Ps),Ps.forEach(t),Zs.forEach(t),lo=l(Xn),ut=s(Xn,"SPAN",{"data-svelte-h":!0}),c(ut)!=="svelte-prj9do"&&(ut.textContent=rs),Xn.forEach(t),xn=l(e),Ze=s(e,"P",{"data-svelte-h":!0}),c(Ze)!=="svelte-lhkvj8"&&(Ze.innerHTML=is),zn=l(e),te=s(e,"DIV",{style:!0,"data-svelte-h":!0}),c(te)!=="svelte-18u0t8d"&&(te.innerHTML=ls),Fn=l(e),P=s(e,"H3",{class:!0});var Qn=h(P);ne=s(Qn,"A",{id:!0,class:!0,href:!0});var qs=h(ne);qt=s(qs,"SPAN",{});var Bs=h(qt);f(Pe.$$.fragment,Bs),Bs.forEach(t),qs.forEach(t),co=l(Qn),ft=s(Qn,"SPAN",{"data-svelte-h":!0}),c(ft)!=="svelte-e2u8i1"&&(ft.textContent=ds),Qn.forEach(t),Jn=l(e),qe=s(e,"P",{"data-svelte-h":!0}),c(qe)!=="svelte-10i6fhp"&&(qe.innerHTML=cs),Ln=l(e),Be=s(e,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-1bvsrfr"&&(Be.innerHTML=ps),jn=l(e),q=s(e,"H2",{class:!0});var Yn=h(q);oe=s(Yn,"A",{id:!0,class:!0,href:!0});var As=h(oe);Bt=s(As,"SPAN",{});var Gs=h(Bt);f(Ae.$$.fragment,Gs),Gs.forEach(t),As.forEach(t),po=l(Yn),gt=s(Yn,"SPAN",{"data-svelte-h":!0}),c(gt)!=="svelte-1kv1gwh"&&(gt.textContent=hs),Yn.forEach(t),Un=l(e),Ge=s(e,"P",{"data-svelte-h":!0}),c(Ge)!=="svelte-15xllx1"&&(Ge.textContent=ms),In=l(e),B=s(e,"H2",{class:!0});var Dn=h(B);se=s(Dn,"A",{id:!0,class:!0,href:!0});var Vs=h(se);At=s(Vs,"SPAN",{});var Xs=h(At);f(Ve.$$.fragment,Xs),Xs.forEach(t),Vs.forEach(t),ho=l(Dn),_t=s(Dn,"SPAN",{"data-svelte-h":!0}),c(_t)!=="svelte-1q417dh"&&(_t.textContent=us),Dn.forEach(t),En=l(e),k=s(e,"DIV",{class:!0});var U=h(k);f(Xe.$$.fragment,U),mo=l(U),vt=s(U,"P",{"data-svelte-h":!0}),c(vt)!=="svelte-uk9oej"&&(vt.innerHTML=fs),uo=l(U),Mt=s(U,"P",{"data-svelte-h":!0}),c(Mt)!=="svelte-28p57e"&&(Mt.innerHTML=gs),fo=l(U),bt=s(U,"P",{"data-svelte-h":!0}),c(bt)!=="svelte-10kqkkl"&&(bt.innerHTML=_s),go=l(U),f(ae.$$.fragment,U),U.forEach(t),Wn=l(e),A=s(e,"H2",{class:!0});var On=h(A);re=s(On,"A",{id:!0,class:!0,href:!0});var Qs=h(re);Gt=s(Qs,"SPAN",{});var Ys=h(Gt);f(Qe.$$.fragment,Ys),Ys.forEach(t),Qs.forEach(t),_o=l(On),yt=s(On,"SPAN",{"data-svelte-h":!0}),c(yt)!=="svelte-1ehu5im"&&(yt.textContent=vs),On.forEach(t),Hn=l(e),$=s(e,"DIV",{class:!0});var I=h($);f(Ye.$$.fragment,I),vo=l(I),wt=s(I,"P",{"data-svelte-h":!0}),c(wt)!=="svelte-1kt1qjo"&&(wt.innerHTML=Ms),Mo=l(I),Tt=s(I,"P",{"data-svelte-h":!0}),c(Tt)!=="svelte-hswkmf"&&(Tt.innerHTML=bs),bo=l(I),kt=s(I,"P",{"data-svelte-h":!0}),c(kt)!=="svelte-1oenqzd"&&(kt.innerHTML=ys),yo=l(I),L=s(I,"DIV",{class:!0});var Et=h(L);f(De.$$.fragment,Et),wo=l(Et),$t=s(Et,"P",{"data-svelte-h":!0}),c($t)!=="svelte-11urvgz"&&($t.innerHTML=ws),To=l(Et),f(ie.$$.fragment,Et),Et.forEach(t),I.forEach(t),Rn=l(e),G=s(e,"H2",{class:!0});var Kn=h(G);le=s(Kn,"A",{id:!0,class:!0,href:!0});var Ds=h(le);Vt=s(Ds,"SPAN",{});var Os=h(Vt);f(Oe.$$.fragment,Os),Os.forEach(t),Ds.forEach(t),ko=l(Kn),Ct=s(Kn,"SPAN",{"data-svelte-h":!0}),c(Ct)!=="svelte-kduhq6"&&(Ct.textContent=Ts),Kn.forEach(t),Sn=l(e),V=s(e,"DIV",{class:!0});var eo=h(V);f(Ke.$$.fragment,eo),$o=l(eo),J=s(eo,"DIV",{class:!0});var me=h(J);f(et.$$.fragment,me),Co=l(me),xt=s(me,"P",{"data-svelte-h":!0}),c(xt)!=="svelte-1jueov"&&(xt.innerHTML=ks),xo=l(me),f(de.$$.fragment,me),zo=l(me),f(ce.$$.fragment,me),me.forEach(t),eo.forEach(t),Nn=l(e),X=s(e,"H2",{class:!0});var to=h(X);pe=s(to,"A",{id:!0,class:!0,href:!0});var Ks=h(pe);Xt=s(Ks,"SPAN",{});var ea=h(Xt);f(tt.$$.fragment,ea),ea.forEach(t),Ks.forEach(t),Fo=l(to),zt=s(to,"SPAN",{"data-svelte-h":!0}),c(zt)!=="svelte-ckwosb"&&(zt.textContent=$s),to.forEach(t),Zn=l(e),T=s(e,"DIV",{class:!0});var x=h(T);f(nt.$$.fragment,x),Jo=l(x),Ft=s(x,"P",{"data-svelte-h":!0}),c(Ft)!=="svelte-1r7clz4"&&(Ft.textContent=Cs),Lo=l(x),Jt=s(x,"P",{"data-svelte-h":!0}),c(Jt)!=="svelte-s7n96g"&&(Jt.innerHTML=xs),jo=l(x),Lt=s(x,"P",{"data-svelte-h":!0}),c(Lt)!=="svelte-10ugs3m"&&(Lt.innerHTML=zs),Uo=l(x),jt=s(x,"P",{"data-svelte-h":!0}),c(jt)!=="svelte-hmtw9k"&&(jt.innerHTML=Fs),Io=l(x),Ut=s(x,"P",{"data-svelte-h":!0}),c(Ut)!=="svelte-hswkmf"&&(Ut.innerHTML=Js),Eo=l(x),j=s(x,"DIV",{class:!0});var Wt=h(j);f(ot.$$.fragment,Wt),Wo=l(Wt),It=s(Wt,"P",{"data-svelte-h":!0}),c(It)!=="svelte-w3skah"&&(It.innerHTML=Ls),Ho=l(Wt),f(he.$$.fragment,Wt),Wt.forEach(t),x.forEach(t),Pn=l(e),Qt=s(e,"P",{}),h(Qt).forEach(t),this.h()},h(){d(p,"name","hf:doc:metadata"),d(p,"content",JSON.stringify(ua)),d(b,"id","mistral"),d(b,"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"),d(b,"href","#mistral"),d(C,"class","relative group"),d(Q,"id","overview"),d(Q,"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"),d(Q,"href","#overview"),d(W,"class","relative group"),d(Y,"id","model-details"),d(Y,"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"),d(Y,"href","#model-details"),d(H,"class","relative group"),d(D,"id","license"),d(D,"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"),d(D,"href","#license"),d(R,"class","relative group"),d(O,"id","usage"),d(O,"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"),d(O,"href","#usage"),d(S,"class","relative group"),d(K,"id","combining-mistral-and-flash-attention-2"),d(K,"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"),d(K,"href","#combining-mistral-and-flash-attention-2"),d(N,"class","relative group"),d(ee,"id","expected-speedups"),d(ee,"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"),d(ee,"href","#expected-speedups"),d(Z,"class","relative group"),ia(te,"text-align","center"),d(ne,"id","sliding-window-attention"),d(ne,"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"),d(ne,"href","#sliding-window-attention"),d(P,"class","relative group"),d(oe,"id","the-mistral-team"),d(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"),d(oe,"href","#the-mistral-team"),d(q,"class","relative group"),d(se,"id","transformers.MistralConfig"),d(se,"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"),d(se,"href","#transformers.MistralConfig"),d(B,"class","relative group"),d(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(re,"id","transformers.MistralModel"),d(re,"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"),d(re,"href","#transformers.MistralModel"),d(A,"class","relative group"),d(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(le,"id","transformers.MistralForCausalLM"),d(le,"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"),d(le,"href","#transformers.MistralForCausalLM"),d(G,"class","relative group"),d(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(pe,"id","transformers.MistralForSequenceClassification"),d(pe,"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"),d(pe,"href","#transformers.MistralForSequenceClassification"),d(X,"class","relative group"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,n){a(document.head,p),r(e,y,n),r(e,m,n),r(e,w,n),r(e,C,n),a(C,b),a(b,E),g(ue,E,null),a(C,no),a(C,lt),r(e,en,n),r(e,W,n),a(W,Q),a(Q,Ht),g(fe,Ht,null),a(W,oo),a(W,dt),r(e,tn,n),r(e,ge,n),r(e,nn,n),r(e,H,n),a(H,Y),a(Y,Rt),g(_e,Rt,null),a(H,so),a(H,ct),r(e,on,n),r(e,ve,n),r(e,sn,n),r(e,Me,n),r(e,an,n),r(e,be,n),r(e,rn,n),r(e,ye,n),r(e,ln,n),r(e,R,n),a(R,D),a(D,St),g(we,St,null),a(R,ao),a(R,pt),r(e,dn,n),r(e,Te,n),r(e,cn,n),r(e,S,n),a(S,O),a(O,Nt),g(ke,Nt,null),a(S,ro),a(S,ht),r(e,pn,n),r(e,$e,n),r(e,hn,n),r(e,Ce,n),r(e,mn,n),g(xe,e,n),r(e,un,n),r(e,ze,n),r(e,fn,n),r(e,Fe,n),r(e,gn,n),r(e,Je,n),r(e,_n,n),g(Le,e,n),r(e,vn,n),r(e,je,n),r(e,Mn,n),g(Ue,e,n),r(e,bn,n),r(e,N,n),a(N,K),a(K,Zt),g(Ie,Zt,null),a(N,io),a(N,mt),r(e,yn,n),r(e,Ee,n),r(e,wn,n),g(We,e,n),r(e,Tn,n),r(e,He,n),r(e,kn,n),r(e,Re,n),r(e,$n,n),g(Se,e,n),r(e,Cn,n),r(e,Z,n),a(Z,ee),a(ee,Pt),g(Ne,Pt,null),a(Z,lo),a(Z,ut),r(e,xn,n),r(e,Ze,n),r(e,zn,n),r(e,te,n),r(e,Fn,n),r(e,P,n),a(P,ne),a(ne,qt),g(Pe,qt,null),a(P,co),a(P,ft),r(e,Jn,n),r(e,qe,n),r(e,Ln,n),r(e,Be,n),r(e,jn,n),r(e,q,n),a(q,oe),a(oe,Bt),g(Ae,Bt,null),a(q,po),a(q,gt),r(e,Un,n),r(e,Ge,n),r(e,In,n),r(e,B,n),a(B,se),a(se,At),g(Ve,At,null),a(B,ho),a(B,_t),r(e,En,n),r(e,k,n),g(Xe,k,null),a(k,mo),a(k,vt),a(k,uo),a(k,Mt),a(k,fo),a(k,bt),a(k,go),g(ae,k,null),r(e,Wn,n),r(e,A,n),a(A,re),a(re,Gt),g(Qe,Gt,null),a(A,_o),a(A,yt),r(e,Hn,n),r(e,$,n),g(Ye,$,null),a($,vo),a($,wt),a($,Mo),a($,Tt),a($,bo),a($,kt),a($,yo),a($,L),g(De,L,null),a(L,wo),a(L,$t),a(L,To),g(ie,L,null),r(e,Rn,n),r(e,G,n),a(G,le),a(le,Vt),g(Oe,Vt,null),a(G,ko),a(G,Ct),r(e,Sn,n),r(e,V,n),g(Ke,V,null),a(V,$o),a(V,J),g(et,J,null),a(J,Co),a(J,xt),a(J,xo),g(de,J,null),a(J,zo),g(ce,J,null),r(e,Nn,n),r(e,X,n),a(X,pe),a(pe,Xt),g(tt,Xt,null),a(X,Fo),a(X,zt),r(e,Zn,n),r(e,T,n),g(nt,T,null),a(T,Jo),a(T,Ft),a(T,Lo),a(T,Jt),a(T,jo),a(T,Lt),a(T,Uo),a(T,jt),a(T,Io),a(T,Ut),a(T,Eo),a(T,j),g(ot,j,null),a(j,Wo),a(j,It),a(j,Ho),g(he,j,null),r(e,Pn,n),r(e,Qt,n),qn=!0},p(e,[n]){const st={};n&2&&(st.$$scope={dirty:n,ctx:e}),ae.$set(st);const Yt={};n&2&&(Yt.$$scope={dirty:n,ctx:e}),ie.$set(Yt);const Dt={};n&2&&(Dt.$$scope={dirty:n,ctx:e}),de.$set(Dt);const at={};n&2&&(at.$$scope={dirty:n,ctx:e}),ce.$set(at);const Ot={};n&2&&(Ot.$$scope={dirty:n,ctx:e}),he.$set(Ot)},i(e){qn||(_(ue.$$.fragment,e),_(fe.$$.fragment,e),_(_e.$$.fragment,e),_(we.$$.fragment,e),_(ke.$$.fragment,e),_(xe.$$.fragment,e),_(Le.$$.fragment,e),_(Ue.$$.fragment,e),_(Ie.$$.fragment,e),_(We.$$.fragment,e),_(Se.$$.fragment,e),_(Ne.$$.fragment,e),_(Pe.$$.fragment,e),_(Ae.$$.fragment,e),_(Ve.$$.fragment,e),_(Xe.$$.fragment,e),_(ae.$$.fragment,e),_(Qe.$$.fragment,e),_(Ye.$$.fragment,e),_(De.$$.fragment,e),_(ie.$$.fragment,e),_(Oe.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(de.$$.fragment,e),_(ce.$$.fragment,e),_(tt.$$.fragment,e),_(nt.$$.fragment,e),_(ot.$$.fragment,e),_(he.$$.fragment,e),qn=!0)},o(e){v(ue.$$.fragment,e),v(fe.$$.fragment,e),v(_e.$$.fragment,e),v(we.$$.fragment,e),v(ke.$$.fragment,e),v(xe.$$.fragment,e),v(Le.$$.fragment,e),v(Ue.$$.fragment,e),v(Ie.$$.fragment,e),v(We.$$.fragment,e),v(Se.$$.fragment,e),v(Ne.$$.fragment,e),v(Pe.$$.fragment,e),v(Ae.$$.fragment,e),v(Ve.$$.fragment,e),v(Xe.$$.fragment,e),v(ae.$$.fragment,e),v(Qe.$$.fragment,e),v(Ye.$$.fragment,e),v(De.$$.fragment,e),v(ie.$$.fragment,e),v(Oe.$$.fragment,e),v(Ke.$$.fragment,e),v(et.$$.fragment,e),v(de.$$.fragment,e),v(ce.$$.fragment,e),v(tt.$$.fragment,e),v(nt.$$.fragment,e),v(ot.$$.fragment,e),v(he.$$.fragment,e),qn=!1},d(e){e&&(t(y),t(m),t(w),t(C),t(en),t(W),t(tn),t(ge),t(nn),t(H),t(on),t(ve),t(sn),t(Me),t(an),t(be),t(rn),t(ye),t(ln),t(R),t(dn),t(Te),t(cn),t(S),t(pn),t($e),t(hn),t(Ce),t(mn),t(un),t(ze),t(fn),t(Fe),t(gn),t(Je),t(_n),t(vn),t(je),t(Mn),t(bn),t(N),t(yn),t(Ee),t(wn),t(Tn),t(He),t(kn),t(Re),t($n),t(Cn),t(Z),t(xn),t(Ze),t(zn),t(te),t(Fn),t(P),t(Jn),t(qe),t(Ln),t(Be),t(jn),t(q),t(Un),t(Ge),t(In),t(B),t(En),t(k),t(Wn),t(A),t(Hn),t($),t(Rn),t(G),t(Sn),t(V),t(Nn),t(X),t(Zn),t(T),t(Pn),t(Qt)),t(p),M(ue),M(fe),M(_e),M(we),M(ke),M(xe,e),M(Le,e),M(Ue,e),M(Ie),M(We,e),M(Se,e),M(Ne),M(Pe),M(Ae),M(Ve),M(Xe),M(ae),M(Qe),M(Ye),M(De),M(ie),M(Oe),M(Ke),M(et),M(de),M(ce),M(tt),M(nt),M(ot),M(he)}}}const ua={local:"mistral",sections:[{local:"overview",title:"Overview"},{local:"model-details",title:"Model Details"},{local:"license",title:"License"},{local:"usage",title:"Usage"},{local:"combining-mistral-and-flash-attention-2",sections:[{local:"expected-speedups",title:"Expected speedups"},{local:"sliding-window-attention",title:"Sliding window Attention"}],title:"Combining Mistral and Flash Attention 2"},{local:"the-mistral-team",title:"The Mistral Team"},{local:"transformers.MistralConfig",title:"MistralConfig"},{local:"transformers.MistralModel",title:"MistralModel"},{local:"transformers.MistralForCausalLM",title:"MistralForCausalLM"},{local:"transformers.MistralForSequenceClassification",title:"MistralForSequenceClassification"}],title:"Mistral"};function fa(F){return oa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ta extends sa{constructor(p){super(),aa(this,p,fa,ma,na,{})}}export{Ta as component};
