Files
INTUIA/Programa final/spacy/cli/__pycache__/_util.cpython-312.pyc
T

98 lines
14 KiB
Plaintext
Raw Normal View History

2026-03-15 13:27:50 +00:00
Ë
=û g¤+ã
ó¬ddlZddlZddlZddlZddlmZddlmZddlm Z ddl
m Z m Z m
Z
mZmZmZmZmZmZddlZddlZddlmZddlmZddlmZmZmZdd lmZdd
l m!Z!dd l"m#Z#m$Z$dd l%m&Z'd
dl(m)Z)d
dl*m+Z+d
dl,m-Z-d
dl.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6dZ7dZ8dZ9dZ:dZ;dZ<de9dZ=dZ>dZ?dZ@ejZBej†ZDee;e<¬«Z&ede?d¬ «ZFed!e>d¬ «ZGed"e@d¬ «ZHe&j“e'd#e=d¬ «e&j“eG«e&j“eF«e&j“eH«dFd%„ZJe/jfd&eeLd'eeLd$e
eLe ffd(„ZMdGd&eeLd*eNd$e
eLe ffd+„ZOd,e d$e fd-„ZPe dHdd.ddd/œd0eeeLe fd1eeLd2eLd3eeNd4eNf
d5„«ZQd6eee eLfd$dfd7„ZR dId8eLd$eeSeSffd9„ZTedJd,eLd:e+d)d$eeLfd;„«ZUed,eLd:e+dd$eeSfd<„«ZUdGd,eLd:eNd$eeeLeeSffd=„ZUdHd>eSd$dfd?„ZVdHd@e dAeeLd$ee fdB„ZWdKdCeeSeXfdDeSd$eLfdE„ZYy)LéN)ÚInterpolationError)Úcontextmanager)ÚPath) Ú
TYPE_CHECKINGÚAnyÚDictÚIterableÚListÚOptionalÚTupleÚUnionÚoverload)Ú NoSuchOption)Úsplit_arg_string)ÚConfigÚConfigValidationErrorÚ require_gpu)Úgpu_is_available)Ú get_command)ÚPrinterÚmsg)Úappé)Úabout)ÚLiteral)Úvalidate)ÚENV_VARSÚSimpleFrozenDictÚ import_fileÚis_compatible_versionÚloggerÚ make_tempdirÚregistryÚ run_commandz.tar.gzz-py3-none-any.whlz project.ymlzpython -m spacyÚspacyz=spaCy Command-line Interface
DOCS: https://spacy.io/api/cli
z¿Command-line interface for spaCy projects and templates.
You'd typically start by cloning a project template to a local directory and
fetching its assets like datasets etc. See the project's z for the
available commands.
z²Suite of helpful commands for debugging and profiling. Includes
commands to check and validate your config files, training and evaluation data,
and custom model implementations.
z$Commands for benchmarking pipelines.z8Commands for initializing configs and pipeline packages.)ÚnameÚhelpÚ benchmarkT)r&r'Úno_args_is_helpÚdebugÚinitÚprojectÚreturncóxtjj«tt«}|t
¬«y)N)Ú prog_name)r#ÚcliÚget_allrrÚCOMMAND)Úcommands úPC:\Users\garci\AppData\Roaming\Python\Python312\site-packages\spacy/cli/_util.pyÚ setup_clir5Rs$ä ‡LÑÔäœ#Ó€GÙ ”gÖóÚargsÚenv_varcó<|r tjj|d«nd}tt |««}t|d¬«}|r*|Dcgc] }||vsŒ|Œ }}t j d|«|rt j dt|««i|¥|¥Scc}w)Generate a dictionary of config overrides based on the extra arguments
provided on the CLI, e.g. --training.batch_size to override
"training.batch_size". Arguments without a "." are considered invalid,
since the config only allows top-level sections to exist.
env_vars (Optional[str]): Optional environment variable to read from.
RETURNS (Dict[str, Any]): The parsed dict, keyed by nested config setting.
ÚT)Úis_clizConfig overrides from CLI: %sz'Config overrides from env variables: %s)ÚosÚenvironÚgetÚ_parse_overridesrr!r*Úlist)r7r8Ú
env_stringÚ
env_overridesÚ
cli_overridesÚkeyss r4Úparse_config_overridesrFZsñ18” ¨Ô,¸R€JÜ$Ô%5°jÓ%AÓB€MÜ$ T°$Ô7€MÙÙC™=a¨A°]Ò,B’˜=ˆÐ Ð4°dÔÜ ÐÀ]Ó@SÔ -ˆ -˜ -ùò Ds Á BÁBFr;cóài}|ré|jd«}d|d}|jd«r¤|}|jdd«}d|vr'|r t|«t j
|dd¬ «d
|vr(|j
d
d«\}}|jd d «}n*|r|djd«rd
}n|jd«}t|«||<nt j
|dd¬ «|rŒé|S)NrzInvalid config override 'ú'z--r:ú.z#: can't override top-level sectionsé©Úexitsútruez: name should start with --)ÚpopÚ
startswithÚreplacerrÚfailÚsplitÚ_parse_override)r7r;ÚresultÚoptÚerrÚorig_optÚvalues r4r?r?pØ
€FÙ
Øh‰hq‹kˆØ)¨#¨¨aÐ0ˆØ >‰>˜ ؈—++˜d 'ˆ˜#‰~ÙÜ& —HH ˜uÐ$GÐHÐPQÕc‰zØ ŸY™Y s¨AÓ.
—kk # sÓ+‘á˜t A™w×1°$Ô" ŸH™H QK)¨%Ó0ˆF3ŠKä H‰H˜Õ Bò+ ð, €Mr6r[cób tj|«S#t$rt|«cYSwxYw©N)ÚsrslyÚ
json_loadsÚ
ValueErrorÚstr)r[s r4rVrVs1ð Ü×Ñ Ó&øÜ òÜ5‹zÒðús .­.r:)ÚtitleÚdescÚ show_configÚ hint_fillÚ file_pathrbrcrdrec #óvK dy#t$rû}||n |j}|jr |s
|jn|jd|}|j|d||¬«}t j
|«t
|jj««|rQd|jvrC|t|«dk7r|nd}t jdd ¬
«t
td |d |d
«tjd«Yd}~yd}~wt$r"}t j
d|d¬«Yd}~yd}~wwxYw­w)a‰Helper to show custom config validation errors on the CLI.
file_path (str / Path): Optional file path of config file, used in hints.
title (str): Override title of custom formatted error.
desc (str): Override description of custom formatted error.
show_config (bool): Whether to output the config the error refers to.
hint_fill (bool): Show hint about filling config.
Nz
r:)rbrcrdzvalue_error.missingrNz
config.cfgz|If your config contains missing values, you can run the 'init fill-config' command to fill in all the defaults, if possible:T)Úspacedz init fill-config ú z
rJzConfig validation errorrK)rrbrcÚ
from_errorrrTÚprintÚtextÚstripÚ error_typesrar2ÚsysÚexitr)rfrbrcrdreÚerYÚ config_paths r4Úshow_validation_errorrssèø€ð"
øÜ òØÐ*‘°·±ˆØ 6Š6Ù&*a—ffX°1·6±6°(¸$¸t¸fÐ0Eˆl‰l˜1 B¨T¸{ˆlÓÜ ŒÜ
ˆch‰hn‰nÓÔÙ Ð.°#·/±/ÑÐ(¬S°«^¸sÒ-Bñà
ô
H‰HðQàõ
ô
”W ¨}¸A¸k¸]È#Ð   ûÜ ò Ð*¨A°Q×7ûð8üs=D9 ˆD9‰ D6C1DÄD9Ä D6ÄD1Ä,D9Ä1D6Ä6D9Ú code_pathcóè|?t|«j«stjd|d¬« t d|«yy#t
$r%}tjd||d¬«Yd}~yd}~wwxYw)zHelper to import Python file provided in training commands / commands
using the config. This makes custom registered functions available.
NzPath to Python code not foundrJrKÚ python_codezCouldn't load Python code: )rÚexistsrrTrÚ Exception)rtrqs r4Ú import_coderyÃsoðÐÜI× H‰HÐ4°iÀqÕ  LÜ ˜
  øô
ò LÜ H‰HÐ2°9°+ÐÈ× Kûð Lúsµ AÁ A1Á A,Á,A1Úerrorcó tdd¬«}|jj«}|r|j d«sy|ddj«j d«}t
|d «t
|d
«fS#t|«xYw) aGet the version of git and raise an error if calling 'git --version' fails.
error (str): The error message to show.
RETURNS (Tuple[int, int]): The version as a (major, minor) tuple. Returns
(0, 0) if the version couldn't be determined.
z
git --versionT)Úcapturez git version)rré NrIrrJ)r$Ú RuntimeErrorÚstdoutrmrRrUÚint)rzÚretrÚversions r4Úget_git_versionrƒÐs†ð˜/°4Ô8ˆðZ‰Z×
Ñ
Ó
€FÙ ˜×*¨=ÔØRSˆk×ÑÓ!×Ó,€GÜ ˆwq‰z?œC ¨¡
+øð
˜!ús
A;Á;
BÚintifycóyr]©©r[r„s r4Ústring_to_listrˆãóàr6cóyr]r†r‡s r4rˆrˆèr‰r6có¤|sgS|jd«r|jd«r|dd}g}|jd«D}|j«}|jd«r|jd«r|dd}|jd«r|jd«r|dd}|j«}|r t |«}|j |«Œ|S)aSParse a comma-separated string to a list and account for various
formatting options. Mostly used to handle CLI arguments that take a list of
comma-separated values.