
    bi                         d dl Z d dlmZmZ d dlmZmZ d dlmZ d dl	m
Z
  G d dee j                        Ze G d d	e             Zy)
    N)	dataclassfield)OptionalUnion)PromptLearningConfig)PeftTypec                       e Zd ZdZdZy)PromptTuningInitTEXTRANDOMN)__name__
__module____qualname__r   r        [/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/peft/tuners/prompt_tuning/config.pyr
   r
      s    DFr   r
   c                        e Zd ZU dZ eej                  ddi      Zeee	f   e
d<    edddi      Zee	   e
d<    eddd	i      Zee	   e
d
<    edddi      Zee   e
d<    fdZ xZS )PromptTuningConfiga  
    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.
        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                 b   t         |           t        j                  | _        | j
                  t        j                  k(  r@| j                  s4t        dt        j                  j                   d| j                   d      | j
                  t        j                  k(  r@| j                  4t        dt        j                  j                   d| j                   d      | j                  rE| j
                  t        j                  k7  r't        dt        j                  j                   d      y y )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   z PromptTuningConfig.__post_init__G   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   __doc__r   r
   r   r   r   str__annotations__r   r   r   r   dictr   __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>r1      sD     ( " , sDII 
 :- : :r   