Ë
    `›¾j-  ã                   ó–  — d dl Z d dlmZ d dlmZ d dlZd dlmZ ddlm	Z	 ddl
mZ dd	lmZmZmZmZmZmZmZ  ej(                  d
dddœ¬«       eddddd¬«       edd¬«       edddd¬«       edddd¬«       edddd¬«       edddd ¬«       edd!d"d#¬«      fd$ej*                  d%ed&ed'ee   d(ee   d)ee   d*ed+efd,„«       Zd-„ Zy).é    N)ÚPath)ÚOptional)Úmsgé   )Úpretrain)Úload_configé   )ÚArgÚOptÚappÚimport_codeÚparse_config_overridesÚ	setup_gpuÚshow_validation_errorr   T)Úallow_extra_argsÚignore_unknown_options)Úcontext_settings.zPath to config fileF)ÚhelpÚexistsÚdir_okayÚ
allow_dashz+Directory to write weights to on each epoch)r   z--codez-czNPath to Python file with additional code (registered functions) to be importedz--resume-pathz-rz;Path to pretrained weights from which to resume pretrainingz--epoch-resumez-erzuThe epoch to resume counting from when using --resume-path. Prevents unintended overwriting of existing weight files.éÿÿÿÿz--gpu-idz-gzGPU ID or -1 for CPUz--skip-lastz-LzSkip saving model-last.binÚctxÚconfig_pathÚ
output_dirÚ	code_pathÚresume_pathÚepoch_resumeÚuse_gpuÚ	skip_lastc           	      ó†  — t        | j                  «      }t        |«       t        ||||«       t	        |«       t        j                  d|› �«       t        |«      5  t        ||d¬«      }	ddd«       	j                  «       }
|
j                  d«      st        j                  dd¬«       |j                  «       s*|j                  d	¬
«       t        j                  d|› �«       |	j                  |dz  «       t        j                  d«       t!        |
||||d|¬«       t        j                  d«       y# 1 sw Y   ŒÌxY w)a  
    Pre-train the 'token-to-vector' (tok2vec) layer of pipeline components,
    using an approximate language-modelling objective. Two objective types
    are available, vector-based and character-based.

    In the vector-based objective, we load word vectors that have been trained
    using a word2vec-style distributional similarity algorithm, and train a
    component like a CNN, BiLSTM, etc to predict vectors which match the
    pretrained ones. The weights are saved to a directory after each epoch. You
    can then pass a path to one of these pretrained weights files to the
    'spacy train' command.

    This technique may be especially helpful if you have little labelled data.
    However, it's still quite experimental, so your mileage may vary.

    To load the weights back in during 'spacy train', you need to ensure
    all settings are the same between pretraining and training. Ideally,
    this is done by using the same config file for both commands.

    DOCS: https://spacy.io/api/cli#pretrain
    zLoading config from: F)Ú	overridesÚinterpolateNÚpretrainingz/The [pretraining] block in your config is emptyr	   ©ÚexitsT)ÚparentszCreated output directory: z
config.cfgz)Saved config file in the output directory)r   r   r   Úsilentr    zSuccessfully finished pretrain)r   Úargsr   Úverify_cli_argsr   r   Úinfor   r   r#   ÚgetÚfailr   ÚmkdirÚgoodÚto_diskr   )r   r   r   r   r   r   r   r    Úconfig_overridesÚ
raw_configÚconfigs              ú\/home/spazio/kingdom_calls/work5/transenv/lib/python3.12/site-packages/spacy/cli/pretrain.pyÚpretrain_clir5      s  € ôp .¨c¯h©hÓ7ÐÜ�	ÔÜ�K ¨[¸,ÔGÜˆgÔÜ‡H�HÐ$ [ MÐ2Ô3ä	˜{Ó	+ñ 
Ü ØÐ#3Àô
ˆ
÷
ð ×#Ñ#Ó%€FØ�:‰:�mÔ$ä�‰ÐBÈ!ÕLØ×ÑÔØ×Ñ ÐÔ&Ü�‰Ð-¨j¨\Ð:Ô;à×Ñ�z LÑ0Ô1Ü‡H�HÐ8Ô9äØØØØ!ØØØõô ‡H�HÐ-Õ.÷1
ð 
ús   ÁD7Ä7E c                 óJ  — | rt        | «      dk7  r(| j                  «       st        j                  d| d¬«       |j                  «       rM|j	                  «       D �cg c]  }|‘Œ c}r/|rt        j
                  dd«       nt        j
                  dd«       |�‡|j                  «       rt        j                  d	d
¬«       t        j                  dt        |«      «      }|s|st        j                  dd
¬«       y |s"|dk  rt        j                  d|› d�d
¬«       y y y y c c}w )Nú-zConfig file not foundr	   r%   zOutput directory is not empty.z}If you're resuming a run in this directory, the old weights for the consecutive epochs will be overwritten with the new ones.zOutput directory is not empty. zuIt is better to use an empty directory or refer to a new output path, then the new directory will be created for you.zI--resume-path should be a weights file, but {resume_path} is a directory.Tzmodel\d+\.binz]You have to use the --epoch-resume setting when using a renamed weight file for --resume-pathr   z=The argument --epoch-resume has to be greater or equal to 0. z is invalid)	Ústrr   r   r-   ÚiterdirÚwarnÚis_dirÚreÚsearch)r   r   r   r   ÚpÚ
model_names         r4   r*   r*   n   s  € Ùœ3˜{Ó+¨sÒ2¸;×;MÑ;MÔ;OÜ�‰Ð(¨+¸QÕ?Ø×ÑÔ¨:×+=Ñ+=Ó+?Ö@ a¢Ó@ÙÜ�H‰HØ0ðTõô �H‰HØ1ðBôð
 ÐØ×ÑÔô �H‰HØ[Øõô —Y‘YÐ/´°[Ó1AÓBˆ
Ù¡,Ü�H‰HØoØöñ  ¨qÒ 0Ü�H‰HØOÐP\È~Ð]hÐiØöð !1�ð ùò  As   Á	D )r<   Úpathlibr   Útypingr   ÚtyperÚwasabir   Útraining.pretrainr   Úutilr   Ú_utilr
   r   r   r   r   r   r   ÚcommandÚContextÚintÚboolr5   r*   © ó    r4   ú<module>rM      sK  ðÛ 	Ý Ý ã Ý å (Ý ÷÷ ñ ð €‡�ØØ*.È$ÑOôñ ØÐ'°¸uÐQUôñ ˜3Ð%RÔSÙ #ØØØØ]ô	!ñ #&ØØØØJô	#ñ #&ØØØð Eô	#ñ �r˜: tÐ2HÔIÙØˆ}˜dÐ)Eôñ5R/à	�‰ðR/ð ðR/ð ðR/ð ˜‰~ðR/ð ˜$‘ðR/ð& ˜3‘-ð'R/ð2 ð3R/ð4 ò5R/ó	ðR/ój"rL   