Buckets:
| import{s as ot,n as rt,o as at}from"../chunks/scheduler.78382b47.js";import{S as it,i as st,e as i,s as o,c as m,h as ft,a as s,d as n,b as r,f as v,g as d,j as _,k as $,l as t,m as p,n as g,t as c,o as u,p as h}from"../chunks/index.6dd35eb6.js";import{C as pt,H as ke,E as lt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d25d6883.js";import{D as T}from"../chunks/Docstring.a245c00c.js";function mt(qe){let x,se,ae,fe,N,pe,O,le,E,Ge='<code>PeftConfigMixin</code> is the base configuration class for storing the adapter configuration of a <a href="/docs/peft/pr_3207/en/package_reference/peft_model#peft.PeftModel">PeftModel</a>, and <a href="/docs/peft/pr_3207/en/package_reference/config#peft.PromptLearningConfig">PromptLearningConfig</a> is the base configuration class for soft prompt methods (p-tuning, prefix tuning, and prompt tuning). These base classes contain methods for saving and loading model configurations from the Hub, specifying the PEFT method to use, type of task to perform, and model configurations like number of layers and number of attention heads.',me,D,de,f,H,we,K,Ke=`This is the base configuration class for PEFT adapter models. It contains all the methods that are common to all | |
| PEFT adapter models. This class inherits from <a href="https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.utils.PushToHubMixin" rel="nofollow">PushToHubMixin</a> which contains the methods to | |
| push your model to the Hub. The method <code>save_pretrained</code> will save the configuration of your adapter model in a | |
| directory. The method <code>from_pretrained</code> will load the configuration of your adapter model from a directory.`,Me,b,j,Le,W,We="Check kwargs before initializing the config instance.",Ne,B,Be="Subclasses can override this method to add specific checks.",Oe,k,I,Ee,J,Je="Loads a configuration file from a json file.",De,y,V,He,Q,Qe="This method loads the configuration of your adapter model from a set of kwargs.",je,X,Xe=`The appropriate configuration type is determined by the <code>peft_type</code> argument. If <code>peft_type</code> is not provided, | |
| the calling class type is instantiated.`,Ie,w,z,Ve,Y,Ye="This method loads the configuration of your adapter model from a directory.",ze,M,U,Ue,Z,Ze="This method saves the configuration of your adapter model in a directory.",Fe,L,F,Se,ee,et="Returns the configuration for your adapter model as a dictionary.",ge,S,ce,P,A,Ae,te,tt='This is the base configuration class to store the configuration of a <a href="/docs/peft/pr_3207/en/package_reference/peft_model#peft.PeftModel">PeftModel</a>.',ue,R,he,C,q,Re,ne,nt=`This is the base configuration class to store the configuration of <code>PrefixTuning</code>, <a href="/docs/peft/pr_3207/en/package_reference/p_tuning#peft.PromptEncoder">PromptEncoder</a>, or | |
| <code>PromptTuning</code>.`,_e,G,ve,ie,$e;return N=new pt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),O=new ke({props:{title:"Configuration",local:"configuration",headingTag:"h1"}}),D=new ke({props:{title:"PeftConfigMixin",local:"peft.config.PeftConfigMixin",headingTag:"h2"}}),H=new T({props:{name:"class peft.config.PeftConfigMixin",anchor:"peft.config.PeftConfigMixin",parameters:[{name:"task_type",val:": Optional[TaskType] = None"},{name:"peft_type",val:": Optional[PeftType] = None"},{name:"auto_mapping",val:": Optional[dict] = None"},{name:"peft_version",val:": Optional[str] = None"}],parametersDescription:[{anchor:"peft.config.PeftConfigMixin.peft_type",description:"<strong>peft_type</strong> (Union[<code>~peft.utils.config.PeftType</code>, <code>str</code>]) — The type of Peft method to use.",name:"peft_type"}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L77"}}),j=new T({props:{name:"check_kwargs",anchor:"peft.config.PeftConfigMixin.check_kwargs",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L328"}}),I=new T({props:{name:"from_json_file",anchor:"peft.config.PeftConfigMixin.from_json_file",parameters:[{name:"path_json_file",val:": str"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"peft.config.PeftConfigMixin.from_json_file.path_json_file",description:`<strong>path_json_file</strong> (<code>str</code>) — | |
| The path to the json file.`,name:"path_json_file"}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L266"}}),V=new T({props:{name:"from_peft_type",anchor:"peft.config.PeftConfigMixin.from_peft_type",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"peft.config.PeftConfigMixin.from_peft_type.kwargs",description:`<strong>kwargs</strong> (configuration keyword arguments) — | |
| Keyword arguments passed along to the configuration initialization.`,name:"kwargs"}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L165"}}),z=new T({props:{name:"from_pretrained",anchor:"peft.config.PeftConfigMixin.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:": str"},{name:"subfolder",val:": Optional[str] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"peft.config.PeftConfigMixin.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code>) — | |
| The directory or the Hub repository id where the configuration is saved.`,name:"pretrained_model_name_or_path"},{anchor:"peft.config.PeftConfigMixin.from_pretrained.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) — | |
| Additional keyword arguments passed along to the child class initialization.`,name:"kwargs"}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L230"}}),U=new T({props:{name:"save_pretrained",anchor:"peft.config.PeftConfigMixin.save_pretrained",parameters:[{name:"save_directory",val:": str"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"peft.config.PeftConfigMixin.save_pretrained.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) — | |
| The directory where the configuration will be saved.`,name:"save_directory"},{anchor:"peft.config.PeftConfigMixin.save_pretrained.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) — | |
| Additional keyword arguments passed along to the <a href="https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.utils.PushToHubMixin.push_to_hub" rel="nofollow">push_to_hub</a> | |
| method.`,name:"kwargs"}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L132"}}),F=new T({props:{name:"to_dict",anchor:"peft.config.PeftConfigMixin.to_dict",parameters:[],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L126"}}),S=new ke({props:{title:"PeftConfig",local:"peft.PeftConfig",headingTag:"h2"}}),A=new T({props:{name:"class peft.PeftConfig",anchor:"peft.PeftConfig",parameters:[{name:"task_type",val:": Optional[Union[str, TaskType]] = None"},{name:"peft_type",val:": Optional[Union[str, PeftType]] = None"},{name:"auto_mapping",val:": Optional[dict] = None"},{name:"peft_version",val:": Optional[str] = None"},{name:"base_model_name_or_path",val:": Optional[str] = None"},{name:"revision",val:": Optional[str] = None"},{name:"inference_mode",val:": bool = False"}],parametersDescription:[{anchor:"peft.PeftConfig.peft_type",description:"<strong>peft_type</strong> (Union[<code>~peft.utils.config.PeftType</code>, <code>str</code>]) — The type of Peft method to use.",name:"peft_type"},{anchor:"peft.PeftConfig.task_type",description:"<strong>task_type</strong> (Union[<code>~peft.utils.config.TaskType</code>, <code>str</code>]) — The type of task to perform.",name:"task_type"},{anchor:"peft.PeftConfig.inference_mode",description:"<strong>inference_mode</strong> (<code>bool</code>, defaults to <code>False</code>) — Whether to use the Peft model in inference mode.",name:"inference_mode"}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L351"}}),R=new ke({props:{title:"PromptLearningConfig",local:"peft.PromptLearningConfig",headingTag:"h2"}}),q=new T({props:{name:"class peft.PromptLearningConfig",anchor:"peft.PromptLearningConfig",parameters:[{name:"task_type",val:": Optional[Union[str, TaskType]] = None"},{name:"peft_type",val:": Optional[Union[str, PeftType]] = None"},{name:"auto_mapping",val:": Optional[dict] = None"},{name:"peft_version",val:": Optional[str] = None"},{name:"base_model_name_or_path",val:": Optional[str] = None"},{name:"revision",val:": Optional[str] = None"},{name:"inference_mode",val:": bool = False"},{name:"num_virtual_tokens",val:": int = None"},{name:"token_dim",val:": int = None"},{name:"num_transformer_submodules",val:": Optional[int] = None"},{name:"num_attention_heads",val:": Optional[int] = None"},{name:"num_layers",val:": Optional[int] = None"},{name:"modules_to_save",val:": Optional[list[str]] = None"}],parametersDescription:[{anchor:"peft.PromptLearningConfig.num_virtual_tokens",description:"<strong>num_virtual_tokens</strong> (<code>int</code>) — The number of virtual tokens to use.",name:"num_virtual_tokens"},{anchor:"peft.PromptLearningConfig.token_dim",description:"<strong>token_dim</strong> (<code>int</code>) — The hidden embedding dimension of the base transformer model.",name:"token_dim"},{anchor:"peft.PromptLearningConfig.num_transformer_submodules",description:"<strong>num_transformer_submodules</strong> (<code>int</code>) — The number of transformer submodules in the base transformer model.",name:"num_transformer_submodules"},{anchor:"peft.PromptLearningConfig.num_attention_heads",description:"<strong>num_attention_heads</strong> (<code>int</code>) — The number of attention heads in the base transformer model.",name:"num_attention_heads"},{anchor:"peft.PromptLearningConfig.num_layers",description:"<strong>num_layers</strong> (<code>int</code>) — The number of layers in the base transformer model.",name:"num_layers"}],source:"https://github.com/huggingface/peft/blob/vr_3207/src/peft/config.py#L371"}}),G=new lt({props:{source:"https://github.com/huggingface/peft/blob/main/docs/source/package_reference/config.md"}}),{c(){x=i("meta"),se=o(),ae=i("p"),fe=o(),m(N.$$.fragment),pe=o(),m(O.$$.fragment),le=o(),E=i("p"),E.innerHTML=Ge,me=o(),m(D.$$.fragment),de=o(),f=i("div"),m(H.$$.fragment),we=o(),K=i("p"),K.innerHTML=Ke,Me=o(),b=i("div"),m(j.$$.fragment),Le=o(),W=i("p"),W.textContent=We,Ne=o(),B=i("p"),B.textContent=Be,Oe=o(),k=i("div"),m(I.$$.fragment),Ee=o(),J=i("p"),J.textContent=Je,De=o(),y=i("div"),m(V.$$.fragment),He=o(),Q=i("p"),Q.textContent=Qe,je=o(),X=i("p"),X.innerHTML=Xe,Ie=o(),w=i("div"),m(z.$$.fragment),Ve=o(),Y=i("p"),Y.textContent=Ye,ze=o(),M=i("div"),m(U.$$.fragment),Ue=o(),Z=i("p"),Z.textContent=Ze,Fe=o(),L=i("div"),m(F.$$.fragment),Se=o(),ee=i("p"),ee.textContent=et,ge=o(),m(S.$$.fragment),ce=o(),P=i("div"),m(A.$$.fragment),Ae=o(),te=i("p"),te.innerHTML=tt,ue=o(),m(R.$$.fragment),he=o(),C=i("div"),m(q.$$.fragment),Re=o(),ne=i("p"),ne.innerHTML=nt,_e=o(),m(G.$$.fragment),ve=o(),ie=i("p"),this.h()},l(e){const a=ft("svelte-u9bgzb",document.head);x=s(a,"META",{name:!0,content:!0}),a.forEach(n),se=r(e),ae=s(e,"P",{}),v(ae).forEach(n),fe=r(e),d(N.$$.fragment,e),pe=r(e),d(O.$$.fragment,e),le=r(e),E=s(e,"P",{"data-svelte-h":!0}),_(E)!=="svelte-1mfyrk5"&&(E.innerHTML=Ge),me=r(e),d(D.$$.fragment,e),de=r(e),f=s(e,"DIV",{class:!0});var l=v(f);d(H.$$.fragment,l),we=r(l),K=s(l,"P",{"data-svelte-h":!0}),_(K)!=="svelte-1mh9vl"&&(K.innerHTML=Ke),Me=r(l),b=s(l,"DIV",{class:!0});var oe=v(b);d(j.$$.fragment,oe),Le=r(oe),W=s(oe,"P",{"data-svelte-h":!0}),_(W)!=="svelte-152jn6x"&&(W.textContent=We),Ne=r(oe),B=s(oe,"P",{"data-svelte-h":!0}),_(B)!=="svelte-l7fpaa"&&(B.textContent=Be),oe.forEach(n),Oe=r(l),k=s(l,"DIV",{class:!0});var be=v(k);d(I.$$.fragment,be),Ee=r(be),J=s(be,"P",{"data-svelte-h":!0}),_(J)!=="svelte-zcd40r"&&(J.textContent=Je),be.forEach(n),De=r(l),y=s(l,"DIV",{class:!0});var re=v(y);d(V.$$.fragment,re),He=r(re),Q=s(re,"P",{"data-svelte-h":!0}),_(Q)!=="svelte-29oatc"&&(Q.textContent=Qe),je=r(re),X=s(re,"P",{"data-svelte-h":!0}),_(X)!=="svelte-lain5s"&&(X.innerHTML=Xe),re.forEach(n),Ie=r(l),w=s(l,"DIV",{class:!0});var ye=v(w);d(z.$$.fragment,ye),Ve=r(ye),Y=s(ye,"P",{"data-svelte-h":!0}),_(Y)!=="svelte-z7yz95"&&(Y.textContent=Ye),ye.forEach(n),ze=r(l),M=s(l,"DIV",{class:!0});var xe=v(M);d(U.$$.fragment,xe),Ue=r(xe),Z=s(xe,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-fhg9sv"&&(Z.textContent=Ze),xe.forEach(n),Fe=r(l),L=s(l,"DIV",{class:!0});var Pe=v(L);d(F.$$.fragment,Pe),Se=r(Pe),ee=s(Pe,"P",{"data-svelte-h":!0}),_(ee)!=="svelte-1rharm3"&&(ee.textContent=et),Pe.forEach(n),l.forEach(n),ge=r(e),d(S.$$.fragment,e),ce=r(e),P=s(e,"DIV",{class:!0});var Ce=v(P);d(A.$$.fragment,Ce),Ae=r(Ce),te=s(Ce,"P",{"data-svelte-h":!0}),_(te)!=="svelte-w01os9"&&(te.innerHTML=tt),Ce.forEach(n),ue=r(e),d(R.$$.fragment,e),he=r(e),C=s(e,"DIV",{class:!0});var Te=v(C);d(q.$$.fragment,Te),Re=r(Te),ne=s(Te,"P",{"data-svelte-h":!0}),_(ne)!=="svelte-10pf1h8"&&(ne.innerHTML=nt),Te.forEach(n),_e=r(e),d(G.$$.fragment,e),ve=r(e),ie=s(e,"P",{}),v(ie).forEach(n),this.h()},h(){$(x,"name","hf:doc:metadata"),$(x,"content",dt),$(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(f,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,a){t(document.head,x),p(e,se,a),p(e,ae,a),p(e,fe,a),g(N,e,a),p(e,pe,a),g(O,e,a),p(e,le,a),p(e,E,a),p(e,me,a),g(D,e,a),p(e,de,a),p(e,f,a),g(H,f,null),t(f,we),t(f,K),t(f,Me),t(f,b),g(j,b,null),t(b,Le),t(b,W),t(b,Ne),t(b,B),t(f,Oe),t(f,k),g(I,k,null),t(k,Ee),t(k,J),t(f,De),t(f,y),g(V,y,null),t(y,He),t(y,Q),t(y,je),t(y,X),t(f,Ie),t(f,w),g(z,w,null),t(w,Ve),t(w,Y),t(f,ze),t(f,M),g(U,M,null),t(M,Ue),t(M,Z),t(f,Fe),t(f,L),g(F,L,null),t(L,Se),t(L,ee),p(e,ge,a),g(S,e,a),p(e,ce,a),p(e,P,a),g(A,P,null),t(P,Ae),t(P,te),p(e,ue,a),g(R,e,a),p(e,he,a),p(e,C,a),g(q,C,null),t(C,Re),t(C,ne),p(e,_e,a),g(G,e,a),p(e,ve,a),p(e,ie,a),$e=!0},p:rt,i(e){$e||(c(N.$$.fragment,e),c(O.$$.fragment,e),c(D.$$.fragment,e),c(H.$$.fragment,e),c(j.$$.fragment,e),c(I.$$.fragment,e),c(V.$$.fragment,e),c(z.$$.fragment,e),c(U.$$.fragment,e),c(F.$$.fragment,e),c(S.$$.fragment,e),c(A.$$.fragment,e),c(R.$$.fragment,e),c(q.$$.fragment,e),c(G.$$.fragment,e),$e=!0)},o(e){u(N.$$.fragment,e),u(O.$$.fragment,e),u(D.$$.fragment,e),u(H.$$.fragment,e),u(j.$$.fragment,e),u(I.$$.fragment,e),u(V.$$.fragment,e),u(z.$$.fragment,e),u(U.$$.fragment,e),u(F.$$.fragment,e),u(S.$$.fragment,e),u(A.$$.fragment,e),u(R.$$.fragment,e),u(q.$$.fragment,e),u(G.$$.fragment,e),$e=!1},d(e){e&&(n(se),n(ae),n(fe),n(pe),n(le),n(E),n(me),n(de),n(f),n(ge),n(ce),n(P),n(ue),n(he),n(C),n(_e),n(ve),n(ie)),n(x),h(N,e),h(O,e),h(D,e),h(H),h(j),h(I),h(V),h(z),h(U),h(F),h(S,e),h(A),h(R,e),h(q),h(G,e)}}}const dt='{"title":"Configuration","local":"configuration","sections":[{"title":"PeftConfigMixin","local":"peft.config.PeftConfigMixin","sections":[],"depth":2},{"title":"PeftConfig","local":"peft.PeftConfig","sections":[],"depth":2},{"title":"PromptLearningConfig","local":"peft.PromptLearningConfig","sections":[],"depth":2}],"depth":1}';function gt(qe){return at(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vt extends it{constructor(x){super(),st(this,x,gt,mt,ot,{})}}export{vt as component}; | |
Xet Storage Details
- Size:
- 16.2 kB
- Xet hash:
- 36df76aba5b686cdbbe51ff47587d2ce6dfcf9ea7d4e663df3cb96a9a7b2543a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.