
    oi                         S SK r S SKJrJr  S SKJrJr  S SKJr  S SK	J
r
   " S S\\ R                  5      r\ " S S	\5      5       rg)
    N)	dataclassfield)OptionalUnion)PromptLearningConfig)PeftTypec                        \ rS rSrSrSrSrSrg)PromptTuningInit   TEXTSAMPLE_VOCABRANDOM N)__name__
__module____qualname____firstlineno__r   r   r   __static_attributes__r       Z/home/james-whalen/.local/lib/python3.13/site-packages/peft/tuners/prompt_tuning/config.pyr
   r
      s    D!LFr   r
   c                      ^  \ rS rSr% Sr\" \R                  SS0S9r\	\\
4   \S'   \" SSS0S9r\\
   \S	'   \" SSS
0S9r\\
   \S'   \" SSS0S9r\\   \S'   U 4S jrSrU =r$ )PromptTuningConfig   a  
This is the configuration class to store the configuration of a [`PromptEmbedding`].

Args:
    prompt_tuning_init (Union[[`PromptTuningInit`], `str`]):
        The initialization of the prompt embedding. `TEXT` will initialize with your text. `SAMPLE_VOCAB` will
        initialize with randomly sampled tokens from the model's vocabulary. `RANDOM` will initialize with randomly
        sampled continuous, soft tokens (warning: sampled soft tokens may fall outside of embedding manifold)
    prompt_tuning_init_text (`str`, *optional*):
        The text to initialize the prompt embedding. Only used if `prompt_tuning_init` is `TEXT`.
    tokenizer_name_or_path (`str`, *optional*):
        The name or path of the tokenizer. Only used if `prompt_tuning_init` is `TEXT`.
    tokenizer_kwargs (`dict`, *optional*):
        The keyword arguments to pass to `AutoTokenizer.from_pretrained`. Only used if `prompt_tuning_init` is
        `TEXT`.
helpz.How to initialize the prompt tuning parameters)defaultmetadataprompt_tuning_initNz[The text to use for prompt tuning initialization. Only used if prompt_tuning_init is `TEXT`prompt_tuning_init_textz`The tokenizer to use for prompt tuning initialization. Only used if prompt_tuning_init is `TEXT`tokenizer_name_or_pathzkThe keyword arguments to pass to `AutoTokenizer.from_pretrained`. Only used if prompt_tuning_init is `TEXT`tokenizer_kwargsc                 ~  > [         TU ]  5         [        R                  U l        U R
                  [        R                  :X  aE  U R                  (       d4  [        S[        R                  R                   SU R                   S35      eU R
                  [        R                  :X  aA  U R                  c4  [        S[        R                  R                   SU R                   S35      eU R                  (       aF  U R
                  [        R                  :w  a'  [        S[        R                  R                   S35      eg g )NzWhen prompt_tuning_init='z#', tokenizer_name_or_path can't be .z$', prompt_tuning_init_text can't be z;tokenizer_kwargs only valid when using prompt_tuning_init='z'.)super__post_init__r   PROMPT_TUNING	peft_typer   r
   r   r   
ValueErrorvaluer   r    )self	__class__s    r   r$    PromptTuningConfig.__post_init__K   s#   !//##'7'<'<<dFaFa+,<,A,A,G,G+H I3373N3N2OqR  ##'7'<'<<$B^B^Bf+,<,A,A,G,G+H I4484P4P3QQRT    d&=&=AQAVAV&VMN^NcNcNiNiMjjlm  'W r   )r&   )r   r   r   r   __doc__r   r
   r   r   r   str__annotations__r   r   r   r    dictr$   r   __classcell__)r*   s   @r   r   r      s    " 8= ''JK8.34  .3q
.Xc]  -2v
-HSM  (-
(htn  r   r   )enumdataclassesr   r   typingr   r   peft.configr   
peft.utilsr   r-   Enumr
   r   r   r   r   <module>r7      sD     ( " , sDII  =- = =r   