
    rhz                     8   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZ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mZ d dlZd dlmZmZ d dlmZmZmZ d dlmZ d d	lmZmZ d d
l m!Z!m"Z"  ejF                         dk7  rd dl$Z$ e!       rd dl%m&Z& d dl'm(Z( d dl)m*Z*  e"       rd dl+Z+d dlm,Z,mZm-Z-mZ  e.ej^                  ej`                  z         Z1 e.ej^                  ejd                  z   ej`                  z   dz         Z3ddiddiddiddiddiddiddidZ4dZ5ddjm                  e4jo                                dZ8 G d d      Z9e G d  d!             Z:d"e
fd#Z; G d$ d%e      Z<e=d&k(  r. e:       Z>d'e>_?        d(e>_?         e<e>      Z@e@j                          yy))    N)ArgumentParser	Namespace)	dataclassfield)Thread)AsyncIteratorOptional)AsyncInferenceClientChatCompletionStreamOutput)AutoTokenizerGenerationConfigPreTrainedTokenizer)BaseTransformersCLICommand)ServeArgumentsServeCommand)is_rich_availableis_torch_availableWindows)Console)Live)Markdown)AutoModelForCausalLMr   BitsAndBytesConfigr   z .!\"#$%&'()*+,\-/:<=>?@[]^_`{|}~textz5There is a Llama in my lawn, how can I get rid of it?zyWrite a Python function that integrates any Python function f(x) numerically over an arbitrary interval [x_start, x_end].z4How many helicopters can a human eat in one sitting?z4Count to 10 but skip every number ending with an 'e'zWhy aren't birds real?z2Why is it important to eat socks after meditating?z$Which number is larger, 9.9 or 9.11?)llamacode
helicopternumbersbirdssocksnumbers2a  

**TRANSFORMERS CHAT INTERFACE**

Chat interface to try out a model. Besides chatting with the model, here are some basic commands:
- **!help**: shows all available commands (set generation settings, save chat, etc.)
- **!status**: shows the current status of the model and generation settings
- **!clear**: clears the current conversation and starts a new one
- **!exit**: closes the interface
am  

**TRANSFORMERS CHAT INTERFACE HELP**

Full command list:
- **!help**: shows this help message
- **!clear**: clears the current conversation and starts a new one
- **!status**: shows the current status of the model and generation settings
- **!example {NAME}**: loads example named `{NAME}` from the config and uses it as the user input.
Available example names: `z`, `a%  `
- **!set {ARG_1}={VALUE_1} {ARG_2}={VALUE_2}** ...: changes the system prompt or generation settings (multiple
settings are separated by a space). Accepts the same flags and format as the `generate_flags` CLI argument.
If you're a new user, check this basic flag guide: https://huggingface.co/docs/transformers/llm_tutorial#common-options
- **!save {SAVE_NAME} (optional)**: saves the current chat and settings to file by default to
`./chat_history/{MODEL_NAME}/chat_{DATETIME}.yaml` or `{SAVE_NAME}` if provided
- **!exit**: closes the interface
c                       e Zd Zddee   dee   fdZdee   deee	f   fdZ
defdZd	 Zd
efdZd
edefdZddefdZdededefdZy)RichInterfaceN
model_name	user_namec                 f    t               | _        |d| _        n|| _        |d| _        y || _        y )N	assistantuser)r   _consoler$   r%   )selfr$   r%   s      m/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/transformers/commands/chat.py__init__zRichInterface.__init__r   s3    	)DO(DO#DN&DN    streamreturnc                   K   | j                   j                  d| j                   d       t        | j                   d      5 }d}| d {   2 3 d {   }|j                  d   j
                  j                  }|j                  }|s;t        j                  dd|      }||z  }g }|j                         D ]G  }|j                  |       |j                  d	      r|j                  d
       7|j                  d       I t        dj                  |      j                         d      }	|j!                  |	d       7 7 6 	 d d d        n# 1 sw Y   nxY w| j                   j                          fS w)Nz[bold blue]<z>:   )consolerefresh_per_second r   z<(/*)(\w*)>z\<\1\2\>z```
z  
zgithub-dark)
code_themeT)refresh)r)   printr$   r   choicesdeltacontentidresub
splitlinesappend
startswithr   joinstripupdate)
r*   r.   liver   tokenoutputs
request_idlineslinemarkdowns
             r+   stream_outputzRichInterface.stream_output}   sT    l4??*;2>?$--A> '	4$D%+| %4 %4e--*0088"XX
 &&gF  OO- -DLL&u- T*V,- $BGGEN$8$8$:}U Hd3K  , %4|'	4 '	4 '	4R 	ZsO   AE:EEEEEEC*EEE	E:E%E:c                     | j                   j                  d| j                   d      }| j                   j                          |S )z!Gets user input from the console.[bold red]<z>:
)r)   inputr%   r8   )r*   rO   s     r+   rO   zRichInterface.input   s9    ##k$..1A$FGr-   c                 8    | j                   j                          y)zClears the console.N)r)   clearr*   s    r+   rQ   zRichInterface.clear   s    r-   r   c                     | j                   j                  d| j                   d|        | j                   j                          y)z%Prints a user message to the console.rN   z>:[/ bold red]
N)r)   r8   r%   )r*   r   s     r+   print_user_messagez RichInterface.print_user_message   s7    k$..)99I$PQr-   colorc                 z    | j                   j                  d| d|        | j                   j                          y)z,Prints text in a given color to the console.z[bold ]Nr)   r8   )r*   r   rU   s      r+   print_colorzRichInterface.print_color   s1    fUG1TF34r-   minimalc                     | j                   j                  t        |rt        nt                     | j                   j                          y)z'Prints the help message to the console.N)r)   r8   r   HELP_STRING_MINIMALHELP_STRING)r*   rZ   s     r+   
print_helpzRichInterface.print_help   s.    HG%8UVr-   generation_configmodel_kwargsc                     | j                   j                  d| d       |r| j                   j                  d|        | j                   j                  d|        | j                   j                          y)zFPrints the status of the model and generation settings to the console.z[bold blue]Model: r5   z[bold blue]Model kwargs: z[bold blue]NrX   )r*   r$   r_   r`   s       r+   print_statuszRichInterface.print_status   sf    0B?@MM";L> JKk*;)<=>r-   )NN)F)__name__
__module____qualname__r	   strr,   r   r   tupleintrL   rO   rQ   rT   rY   boolr^   r   dictrb    r-   r+   r#   r#   q   s    	'8C= 	'HSM 	'- -8R*S - X]^acf^fXg - ^s s 
 C 
$ 
s ?O _c r-   r#   c                      e Zd ZU dZ 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
<    edddi      Zeed<    edddi      Zee   ed<    edddi      Zeed<    edddi      Zee   ed<    edddi      Zeed<    edddi      Zeed<    eddg dd      Zee   ed<    eddd i      Zeed!<    eddd"i      Zee   ed#<    eddd$i      Zeed%<    eddd&i      Zeed'<    ed(d)d*d(gd      Zeed+<    eddd,i      Zeed-<    ed.dd/i      Zeed0<    ed1dd2i      Zeed3<   y)4ChatArgumentsz
    Arguments for the chat CLI.

    See the metadata arg for each argument's description -- the medatata will be printed with
    `transformers chat --help`
    Nhelpz_Name of the pre-trained model. The positional argument will take precedence if both are passed.)defaultmetadatamodel_name_or_pathzKUsername to display in chat interface. Defaults to the current user's name.r(   zSystem prompt.system_promptz./chat_history/zFolder to save chat history.save_folderz"Path to a yaml file with examples.examples_pathFz7Whether to show runtime warnings in the chat interface.verbosezPath to a local generation config file or to a HuggingFace repo containing a `generation_config.json` file. Other generation settings passed as CLI arguments will be applied on top of this generation config.r_   mainzLSpecific model version to use (can be a branch name, tag name or commit id).model_revisioncpuzDevice to use for inference.deviceautozOverride the default `torch.dtype` and load the model under this dtype. If `'auto'` is passed, the dtype will be automatically derived from the model's weights.)rz   bfloat16float16float32)rn   r9   torch_dtypez2Whether to trust remote code when loading a model.trust_remote_codezWhich attention implementation to use; you can run --attn_implementation=flash_attention_2, in which case you must install this manually by running `pip install flash-attn --no-build-isolation`.attn_implementationzIWhether to use 8 bit precision for the base model - works only with LoRA.load_in_8bitzIWhether to use 4 bit precision for the base model - works only with LoRA.load_in_4bitnf4zQuantization type.fp4bnb_4bit_quant_typez#Whether to use nested quantization.use_bnb_nested_quant	localhostz%Interface the server will listen to..host@  zPort the server will listen to.port)rc   rd   re   __doc__r   rq   r	   rf   __annotations__r(   rr   rs   rt   ru   ri   r_   rw   ry   r~   r   r   r   r   r   r   r   r   rh   rk   r-   r+   rm   rm      s,    ).u
)   ghD(3-  $)IY@Z#[M8C=[%6&JhAijKj#(Im@n#oM8C=o%6;t2uvGTv (-1
	(x} 	  hiNC  9W0XYFCY!&PA
"K#  $)] ^t  */ r
*#  efL$  efL$   %UFZhmotgu=vww!&uHm?n!o$o kV=d4efD#fdf6W-XYD#Yr-   rm   argsc                     t        |       S )z;
    Factory function used to chat with a local model.
    )ChatCommand)r   s    r+   chat_command_factoryr     s     tr-   c                      e Zd Zedefd       Zd Zedefd       Zed"de	de
e   defd	       Zed"d
e
e   dee   fd       Zdee   defdZde	dedeeef   fdZededede
e   de
e   deeee   f   f
d       Zede	de
d   fd       Zde	dedef   fdZdede	dedeeeeef   f   dededee   deee   eef   fdZd  Zd! Zy)#r   parserc                     t         f}| j                  d|      }|j                  d      }|j                  dt        dd       |j                  dt        dd	d
       |j                  t               y)z
        Register this command to argparse so it's available for the transformer-cli

        Args:
            parser: Root parser to register command-specific arguments
        chat)dataclass_typeszPositional argumentsmodel_name_or_path_or_addressNz7Name of the pre-trained model or address to connect to.)typero   rn   generate_flagsa  Flags to pass to `generate`, using a space as a separator between flags. Accepts booleans, numbers, and lists of integers, more advanced parameterization should be set through --generation-config. Example: `transformers chat <model_repo> max_new_tokens=100 do_sample=False eos_token_id=[1,2]`. If you're a new user, check this basic flag guide: https://huggingface.co/docs/transformers/llm_tutorial#common-options*)r   ro   rn   nargs)func)rm   
add_parseradd_argument_groupadd_argumentrf   set_defaultsr   )r   r   chat_parsergroups       r+   register_subcommandzChatCommand.register_subcommand#  s     )*'''P../EF+J	 	 	
 	W  	 	
 	  &: ;r-   c                 z   |j                   |j                   }|j                  d      s"|j                  d      s|j                  d      rpd| _        |j                  dk7  s|j                  dk7  rt        d      |j                   j                  dd      \  |_        |_        |j                  #t        d	      d
| _        |j                   |_        t               s!t               s| j                  rt        d      t               st        d      t               s| j                  rt        d      || _        y )Nhttphttpsr   Fr   uu   Looks like you’ve set both a server address and a custom host/port. Please pick just one way to specify the server.:   z\When connecting to a server, please specify a model name with the --model_name_or_path flag.TzYou need to install rich to use the chat interface. Additionally, you have not specified a remote endpoint and are therefore spawning a backend. Torch is required for this: (`pip install rich torch`)zHYou need to install rich to use the chat interface. (`pip install rich`)zYou have not specified a remote endpoint and are therefore spawning a backend. Torch is required for this: (`pip install rich torch`))r   rA   spawn_backendr   r   
ValueErrorrsplitrq   r   r   ImportErrorr   )r*   r   names      r+   r,   zChatCommand.__init__D  s+   --955Dv&$//'*BdooVaFb%*"99+tyyD/@$J 
 (,'I'I'P'PQTVW'X$	49**2$v  &*"*.*L*L' ",>,@TEWEWx  #$hii#%$*<*<7 
 	r-   r/   c                      t        j                         dk(  rt        j                         S t	        j
                  t        j                               j                  S )z)Returns the username of the current user.r   )platformsystemosgetloginpwdgetpwuidgetuidpw_namerk   r-   r+   get_usernamezChatCommand.get_usernamek  s:     ??	);;= <<		,444r-   Nr   filenamec                    i }t        |      |d<   | |d<   |j                  }|Gt        j                  d      }|j                   d| d}t
        j                  j                  ||      }t        j                  t
        j                  j                  |      d       t        |d	      5 }t        j                  ||d
       ddd       t
        j                  j                  |      S # 1 sw Y   (xY w)z!Saves the chat history to a file.settingschat_historyNz%Y-%m-%d_%H-%M-%Sz/chat_.jsonT)exist_okwr1   )indent)varsrs   timestrftimer   r   pathrB   makedirsdirnameopenjsondumpabspath)r   r   r   output_dictfoldertime_strfs          r+   	save_chatzChatCommand.save_chats  s     "&t*J&*N#!!}}%89H<<=VH:USHww||FH5H
BGGOOH-=(C  	0AIIk1Q/	0wwx((	0 	0s   +C++C4rr   c                     | g }|S d| dg}|S )zClears the chat history.r   roler;   rk   )rr   r   s     r+   clear_chat_historyzChatCommand.clear_chat_history  s*      D  &-@ADr-   r   c           	         t        |      dk(  ri S |D ci c]/  }d|j                  d      d   z   dz   |j                  d      d   1 }}|j                         D ci c]*  \  }}||j                         dv r|j                         n|, }}}|j                         D ci c]  \  }}||dk(  rdn| }}}dt        d	t
        fd
}|j                         D ci c]  \  }}| ||      sd| dn| }}}dj                  |j                         D cg c]  \  }}| d|  c}}      }d|z   dz   }|j                  dd      }|j                  dd      }|j                  dd      }|j                  dd      }|j                  dd      }|j                  dd      }	 t        j                  |      }|S c c}w c c}}w c c}}w c c}}w c c}}w # t        j                  $ r t        d      w xY w)zUParses the generate flags from the user input into a dictionary of `generate` kwargs.r   "=r   )truefalseNonenullsr/   c                 p    | j                  d      r| dd  } | j                  ddd      j                         S )N-r   .r4   )rA   replaceisdigit)r   s    r+   	is_numberz3ChatCommand.parse_generate_flags.<locals>.is_number  s5    ||C abE99S"a(0022r-   z, z: {}z"null"z"true"r   z"false"r   z"[[z]"rW   r   zFailed to convert `generate_flags` into a valid JSON object.
`generate_flags` = {generate_flags}
Converted JSON string = {generate_flags_string})lensplititemslowerrf   ri   rB   r   r   loadsJSONDecodeErrorr   )	r*   r   flaggenerate_flags_as_dictkvr   generate_flags_stringprocessed_generate_flagss	            r+   parse_generate_flagsz ChatCommand.parse_generate_flags  s@   ~!#I
 bp!pY]#

3(:":S"@$**S/RSBT"T!p!p
 OeNjNjNl"
FJaAAGGI)::qwwyA"
 "
 OeNjNjNl!mda!qF{V"A!m!m	3 	3 	3 VlUqUqUs!tTQPQ!Yq\q1Xq"H!t!t
 !%		CYC_C_Ca*b41aaS1#;*b c !$&; ;c A !6 = =h O 5 = =h O 5 = =i Q 5 = =dC H 5 = =dC H !6 = =c3 G	'+zz2G'H$ ('Y "q"
 "n "u
 +c" ## 	D 	s)   4F>/G#G	GG
'G G:model_generation_configc                    |j                   d|j                   v rit        j                  j                  |j                         }t        j                  j	                  |j                         }t        j                  ||      }nJt        j                  |j                         }n*t        j                  |      } |j                  di ddd | j                  |j                        } |j                  di |}||fS )zj
        Returns a GenerationConfig object holding the generation parameters for the CLI command.
        r   T   )	do_samplemax_new_tokensrk   )r_   r   r   r   basenamer   from_pretrainedcopydeepcopyrD   r   r   )r*   r   r   r   r   r_   parsed_generate_flagsr`   s           r+   get_generation_parameterizationz+ChatCommand.get_generation_parameterization  s     !!-$000''//$*@*@A77++D,B,BC$4$D$DWh$W!$4$D$DTE[E[$\!
 !%.E F$$$RTS'QR !% 9 9$:M:M N/(//H2GH !,..r-   	tokenizerr_   
eos_tokenseos_token_idsc                    |j                   |j                  }n|j                   }g }|/|j                  | j                  |j	                  d                   |7|j                  |j	                  d      D cg c]  }t        |       c}       t        |      dk(  r|j                  |j                         ||fS c c}w )z:Retrieves the pad token ID and all possible EOS token IDs.,r   )pad_token_ideos_token_idextendconvert_tokens_to_idsr   rh   r   r@   )r   r_   r   r   r   all_eos_token_idstoken_ids          r+   parse_eos_tokenszChatCommand.parse_eos_tokens  s     ))1,99L,99L!$$Y%D%DZEUEUVYEZ%[\$$$MDWDWX[D\%]c(m%]^ !Q&$$%6%C%CD... &^s   9B?
model_argsr   c                     | j                   r:t        d| j                  | j                  | j                  | j                        }|S | j
                  rt        d      }|S d }|S )NT)r   bnb_4bit_compute_dtyper   bnb_4bit_use_double_quantbnb_4bit_quant_storage)r   )r   r   r~   r   r   r   )r  quantization_configs     r+   get_quantization_configz#ChatCommand.get_quantization_config  st    """4!'1'='=$.$B$B*4*I*I'1'='=# #" $$"4!# #" #'""r-   r   c                    t        j                  |j                  |j                  |j                        }|j
                  dv r|j
                  nt        t        |j
                        }| j                  |      }|j                  |j                  |d|d}t        j                  |j                  fd|j                  i|}t        |dd       |j                  |j                        }||fS )N)revisionr   )rz   Nrz   )r  r   r~   
device_mapr  r   hf_device_map)r   r   model_name_or_path_positionalrw   r   r~   getattrtorchr  r   r   tory   )r*   r   r   r~   r  r`   models          r+   load_model_and_tokenizerz$ChatCommand.load_model_and_tokenizer  s    !11..(("44
	 +/*:*:n*Ld&&RYZ_aeaqaqRr"::4@++#'#;#;& #6
 %44..
BFBXBX
\h
 5/408HHT[[)Eir-   
user_input	interfaceexamplesr`   r   c                    d}|dk(  r-| j                  |j                        }|j                          n/|dk(  r|j                          n|j	                  d      rnt        |j                               dk  rR|j                         }	t        |	      dk(  r|	d   }
nd}
| j                  |||
      }
|j                  d|
 d	d
       n|j	                  d      r|dd j                         }|j                         }|D ]   }d|vs|j                  d| dd        nA | j                  |      } |j                  di |} |j                  di | n	|j	                  d      rt        |j                               dk(  r|j                         d   }||v rD|j                          g }|j                  ||   d          |j                  d||   d   d       nd| dt        |j                                d}|j                  |d       nM|dk(  r|j!                  |j"                  ||       n)d}|j                  d| dd       |j                          ||||fS )z
        Handles all user commands except for `!exit`. May update the chat history (e.g. reset it) or the
        generation config (e.g. set a new flag).
        Tz!clearz!helpz!save   r   NzChat saved in !green)r   rU   z!setr1   r   z(Invalid flag format, missing `=` after `z;`. Please use the format `arg_1=value_1 arg_2=value_2 ...`.red!exampler   r(   r   zExample z* not found in list of available examples: r   z!status)r$   r_   r`   F'z/' is not a valid command. Showing help message.rk   )r   rr   rQ   r^   rA   r   r   r   rY   rC   r   rD   rT   r@   listkeysrb   rq   )r*   r  r   r  r  r_   r`   r   valid_commandsplit_inputr   new_generate_flagsr   parsed_new_generate_flagsnew_model_kwargsexample_nameexample_errors                    r+   handle_non_exit_user_commandsz)ChatCommand.handle_non_exit_user_commands.  s    !**4+=+=>DOO7"  """7+J4D4D4F0G!0K$**,K;1$&q>~~dD(;H!!z'C7!S""6* ",AB!5!5!7!3!9!9!;* 8d?))Ftf MA A $ *  8 -1,E,EFX,Y)#;#4#;#;#X>W#X ###7&67"":.3z7G7G7I3Ja3O%++-a0Lx'!,,Xl-CF-KLV8Nv8VWX |n,VW[\d\i\i\kWlVmmno  %%=%F9$""22"3) #  "M!!:,6e'fns!t  "]$5|CCr-   c                 J    t        j                  | j                                y N)asynciorun
_inner_runrR   s    r+   r/  zChatCommand.run  s    DOO%&r-   c                 <  K   | j                   rt        | j                  j                  | j                  j                  | j                  j
                  | j                  j                  | j                  j                  | j                  j                  | j                  j                  | j                  j                  | j                  j                  | j                  j                  d      }t        |      }t        |j                        }d|_        |j#                          | j                  j$                  dz   | j                  j&                  z   }| j                  j                  dk(  rdn| j                  j                  }t)        | d| j                  j                         }| j                  }|j*                  t,        }n3t/        |j*                        5 }	t1        j2                  |	      }d d d        |j4                  | j7                         }
n|j4                  }
t9        j:                  |j$                        }| j=                  ||      \  }}t?        |j$                  |
	      }|jA                          | jC                  |jD                        }d }|jG                  d
       	 	 |jI                         }|jK                  d      ri|dk(  r	 |jM                          d {    y | jO                  ||||||      \  }}}}|r|jK                  d      s.	 |jM                          d {    |jQ                  d|d       |jS                  |d||jU                         |d      }|jW                  |       d {   \  }}|jQ                  d|d       	 |jM                          d {    # 1 sw Y   xY w7 7 7 G# tX        $ r Y |jM                          d {  7   y w xY w7 A# |jM                          d {  7   w xY ww)Nerror)ry   r~   r   r   r   r   r   r   r   r   	log_level)targetT@r   zhttp://localhostr   )r$   r%   )rZ   r  z!exit)r  r   r  r  r_   r`   r   r   r(   r   )rH   r_   r  )r.   
extra_bodyr'   )-r   r   r   ry   r~   r   r   r   r   r   r   r   r   r   r   r/  daemonstartrq   rw   r
   rt   DEFAULT_EXAMPLESr   yaml	safe_loadr(   r   r   r   r   r#   rQ   r   rr   r^   rO   rA   closer+  r@   chat_completionto_json_stringrL   KeyboardInterrupt)r*   
serve_argsserve_commandthreadr  r   clientr   r  r   r(   r   r_   r`   r  r   rH   r  r$  r.   model_outputs                        r+   r0  zChatCommand._inner_run  s    'yy'' II11"&))"="=$(II$A$A!YY33!YY33$(II$A$A%)YY%C%CYY^^YY^^!J )4M=#4#45F FMLLN		,,s2TYY5M5MM%)YY^^{%B!		%a		/?&@Ayy%'Hd(() -Q>>!,- 99$$&D99D"2"B"B4CZCZ"[*.*N*NtUl*m'<!T-D-DPTU	&&t'9'9:
 	T*)%&__.
 ((-!W,D lln$$A PTOqOq'1!%&/%-.?)5!% Pr PLm-> )
0E0Ej0Q * lln$$' KKJ GH//&0->-M-M-O!&  0  2;1H1H1P+P(j[\JK
 lln$$U '- -z %$ ,Q % lln$$ %flln$$s   GPO5B<P2&O P,O-P20O #P6O7P<AO 
OO 'P:O<;PO	PPO 	O9O> P1O42P8O99O> <P>PPPPr-  )rc   rd   re   staticmethodr   r   r,   rf   r   rm   r	   r   r"  rj   r   r   r   rg   r   r   rh   r  r  r   r  r#   r+  r/  r0  rk   r-   r+   r   r   "  s   <N < <@#N 5# 5 5 )m )x} )PS ) )$ (3- 4:  4(49 4( 4(l/!/<L/	%	&/8 /&/+/ SM/  }	/
 
sDI~	/ /6 #M #hG[>\ # #& ]  uE[]jEj?k  6PDPD PD !	PD
 sDcN*+PD ,PD PD 4jPD 
tDz+T1	2PDh'Z%r-   r   __main__z meta-llama/Llama-3.2-3b-Instructzhttp://localhost:8000)Br.  r   r   r   r   r=   stringr   argparser   r   dataclassesr   r   	threadingr   typingr   r	   r:  huggingface_hubr
   r   transformersr   r   r   transformers.commandsr   transformers.commands.servingr   r   transformers.utilsr   r   r   r   rich.consoler   	rich.liver   rich.markdownr   r  r   r   setascii_letters
whitespaceALLOWED_KEY_CHARSdigitsALLOWED_VALUE_CHARSr9  r\   rB   r#  r]   r#   rm   r   r   rc   r   r   r   r/  rk   r-   r+   <module>rZ     s       	  	   . (  *  L 
 = F D 8??	!$&  ,,v/@/@@A 
6==(6+<+<<?bb 
 MN) QRNO./JK?@  	 	 ";;'7'<'<'>?@ A&Z Zz IZ IZ IZXy }%, }%@ z?D)KD&)@D&tDHHJ r-   