o
    h                     @   s  d 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 ddl	m
Z
 ddlmZmZmZmZ ddlZddlmZmZmZ ddlmZ dd	lmZ d
dlmZ eeZdd eD ZG dd deZG dd deZ G dd deZ!deeee"e#f   dee" de"fddZ$G dd deZ%G dd deZ&G dd deZ'G dd  d eZ(dee"e"f fd!d"Z)G d#d$ d$eZ*G d%d& d&eZ+G d'd( d(eZ,G d)d* d*eZ-G d+d, d,eZ.G d-d. d.eZ/G d/d0 d0eZ0G d1d2 d2eZ1dS )3a  Contains commands to interact with jobs on the Hugging Face Hub.

Usage:
    # run a job
    hf jobs run <image> <command>

    # List running or completed jobs
    hf jobs ps [-a] [-f key=value] [--format TEMPLATE]

    # Stream logs from a job
    hf jobs logs <job-id>

    # Inspect detailed information about a job
    hf jobs inspect <job-id>

    # Cancel a running job
    hf jobs cancel <job-id>
    N)	Namespace_SubParsersActionasdict)Path)DictListOptionalUnion)HfApiSpaceHardware	get_token)logging)load_dotenv   )BaseHuggingfaceCLICommandc                 C   s   g | ]
}|j d kr|j qS )z	zero-a10g)value).0item r   N/var/www/html/ai/venv/lib/python3.10/site-packages/huggingface_hub/cli/jobs.py
<listcomp>4       r   c                   @      e Zd ZedefddZdS )JobsCommandsparserc                    sx   | j ddd  jdd} j fddd t| t| t| t| t| t	| t
| d S )NjobszRun and manage Jobs on the Hub.helpz$huggingface.co jobs related commandsc                          S N
print_helpargsjobs_parserr   r   <lambda>>       z2JobsCommands.register_subcommand.<locals>.<lambda>func)
add_parseradd_subparsersset_defaultsInspectCommandregister_subcommandLogsCommand	PsCommand
RunCommandCancelCommand	UvCommandScheduledJobsCommands)r   jobs_subparsersr   r%   r   r/   8   s   





z JobsCommands.register_subcommandN__name__
__module____qualname__staticmethodr   r/   r   r   r   r   r   7       r   c                   @   >   e Zd ZededdfddZdeddfddZdd	d
ZdS )r2   r   returnNc                 C   s   | j ddd}|jdtdd |jddd	d
d |jddd	dd |jdtdd |jdtdd |jdtddt dd |jdtdd |jddddd |jdtdd |jdtd d |jd!d"d#d$ |jtd% d S )&Nrunz	Run a Jobr   imageThe Docker image to use.typer   -e--envappend/Set environment variables. E.g. --env ENV=valueactionr   -s	--secretsvSet secret environment variables. E.g. --secrets SECRET=value or `--secrets HF_TOKEN` to pass your Hugging Face token.
--env-file(Read in a file of environment variables.--secrets-file/Read in a file of secret environment variables.--flavorTFlavor for the hardware, as in HF Spaces. Defaults to `cpu-basic`. Possible values: , .	--timeoutVMax duration: int/float with s (seconds, default), m (minutes), h (hours) or d (days).-d--detach
store_truez3Run the Job in the background and print the Job ID.--namespaceVThe namespace where the Job will be created. Defaults to the current user's namespace.--tokenIA User Access Token generated from https://huggingface.co/settings/tokenscommand...The command to run.nargsr   r)   )r+   add_argumentstrjoinSUGGESTED_FLAVORSr-   r2   r   
run_parserr   r   r   r/   K   sN   	zRunCommand.register_subcommandr$   c                 C   s   |j | _ |j| _i | _|jr | jtt|j tj	
 d |jp$g D ]}| jt|tj	
 d q%i | _t }|jrM| jtt|j |d |jpQg D ]}| jt||d qR|j| _|j| _|j| _|j| _|j| _d S Nenviron)r@   r^   envenv_fileupdater   r   	read_textosrk   copysecrets_get_extended_environsecrets_fileflavortimeoutdetach	namespacetokenselfr$   	env_valueextended_environsecretr   r   r   __init__x   s$   $zRunCommand.__init__c              	   C   s|   t | jd}|j| j| j| j| j| j| j| j	d}t
d|j  t
d|j  | jr.d S |j|jdD ]}t
| q5d S )Nry   )r@   r^   rl   rr   ru   rv   rx   Job started with ID: 	View at: job_id)r   ry   run_jobr@   r^   rl   rr   ru   rv   rx   printidurlrw   fetch_job_logsr{   apijoblogr   r   r   r?      s"   

zRunCommand.runr>   N	r8   r9   r:   r;   r   r/   r   r   r?   r   r   r   r   r2   J   s
    ,r2   c                   @   r=   )r0   r   r>   Nc                 C   N   | j ddd}|jdtdd |jdtdd |jd	td
d |jtd d S )NlogszFetch the logs of a Jobr   r   Job IDrB   rZ   QThe namespace where the job is running. Defaults to the current user's namespace.r\   r]   r)   )r+   rc   rd   r-   r0   rg   r   r   r   r/         zLogsCommand.register_subcommandr$   c                 C      |j | _ |j| _|j| _d S r    r   rx   ry   r{   r$   r   r   r   r         zLogsCommand.__init__c                 C   s0   t | jd}|j| j| jdD ]}t| qd S Nr   r   rx   )r   ry   r   r   rx   r   )r{   r   r   r   r   r   r?      s   
zLogsCommand.runr   r   r   r   r   r   r0      
    r0   rowsheadersr>   c           	      C   s&  dd t g | |R  D }tt jt|d }t|t| |krW|t|}||  d  < t|t| |krM|t| t| ||  ||< t|t| |ks$dt| j| }g }|	|j|  |	|jdd |D   | D ]}dd t ||D }|	|j|  qyd
|S )	z
    Inspired by:

    - stackoverflow.com/a/8356620/593036
    - stackoverflow.com/questions/9535954/printing-lists-as-tabular-data
    c                 S   s   g | ]}t d d |D qS )c                 s   s    | ]	}t t|V  qd S r    lenrd   )r   xr   r   r   	<genexpr>   s    z'_tabulate.<locals>.<listcomp>.<genexpr>)max)r   colr   r   r   r          z_tabulate.<locals>.<listcomp>      z{{:{}}} c                 S   s   g | ]}d | qS )-r   )r   wr   r   r   r          c                 S   s@   g | ]\}}t t||krt|d |d  d nt|qS )N   r_   r   )r   r   	col_widthr   r   r   r      s    .
)zipr   rp   get_terminal_sizecolumnsr   sumindexformatrF   re   )	r   r   
col_widthsterminal_widthcol_to_minimize
row_formatlinesrowrow_format_argsr   r   r   	_tabulate   s$    
r   c                   @   `   e Zd ZededdfddZdeddfddZdd	d
Zde	e
e
f defddZdd ZdS )r1   r   r>   Nc                 C   t   | j ddd}|jddddd |jd	td
d |jdtdd |jdddg dd |jdtdd |jtd d S )Npsz	List Jobsr   -a--allrY   z*Show all Jobs (default shows just running)rH   rZ   UThe namespace from where it lists the jobs. Defaults to the current user's namespace.rB   r\   r]   -f--filterrF   >Filter output based on conditions provided (format: key=value)rI   defaultr   --format%Format output using a custom templater)   )r+   rc   rd   r-   r1   rg   r   r   r   r/      <   zPsCommand.register_subcommandr$   c                 C   n   |j | _ |j| _|j| _|j| _i | _|jD ]}d|v r,|dd\}}|| j| < qtd| d qd S N=r   z)Warning: Ignoring invalid filter format 'z'. Use key=value format.	allrx   ry   r   filtersfiltersplitlowerr   r{   r$   fkeyr   r   r   r   r         
zPsCommand.__init__c              
   C   s  zt | jd}|j| jd}g d}g }|D ]M}|jr|jjnd}| js)|dvr)q|j}|jp0d}|j	p5g }	|	r=d
|	nd}
|jrH|jdnd}||| |
d	}| |sYq||||
||g q|sd
}| jr{dd
dd | j D  }td|  W dS | || W dS  tjy } ztd|  W Y d}~dS d}~w tttfy } ztd|  W Y d}~dS d}~w ty } ztdt|j d|  W Y d}~dS d}~ww )z
        Fetch and display job information for the current user.
        Uses Docker-style filtering with -f/--filter flag and key=value pairs.
        r   rx   )zJOB IDIMAGE/SPACECOMMANDCREATEDSTATUSUNKNOWN)RUNNINGUPDATINGN/A %Y-%m-%d %H:%M:%S)r   r@   statusr^     matching filters: rS   c                 S      g | ]\}}| d | qS r   r   r   kvr   r   r   r   D  r   z!PsCommand.run.<locals>.<listcomp>zNo jobs foundNzError fetching jobs data: zError processing jobs data: Unexpected error - : )r   ry   	list_jobsrx   r   stager   r   docker_imager^   re   
created_atstrftimer   _matches_filtersrF   r   itemsr   _print_outputrequestsRequestExceptionKeyError
ValueError	TypeError	ExceptionrC   r8   )r{   r   r   table_headersr   r   r   r   image_or_spacer^   command_strr   job_propertiesfilters_msger   r   r   r?     sN   


 (zPsCommand.runr   c                 C      | j  D ]<\}}||vr dS d|v sd|v r4|dddd}td| d|| tjs3 dS q| ||  vrA dS qdS )	z+Check if job matches all specified filters.F*?.*rT   ^$Tr   r   replaceresearch
IGNORECASEr   r{   r   r   patternregex_patternr   r   r   r   S     zPsCommand._matches_filtersc           	      C   x   | j r2| j }|D ]'}|}tg dD ]\}}d| d}||v r*||t|| }qt| qdS tt||d dS ),Print output according to the chosen format.)r   r@   r^   createdr   {{.}}r   Nr   	enumerater  rd   r   r   	r{   r   r   templater   lineifieldplaceholderr   r   r   r   f  s"   
	zPsCommand._print_outputr   r8   r9   r:   r;   r   r/   r   r   r?   r   rd   boolr   r   r   r   r   r   r1      s    "
Hr1   c                   @   r=   )r.   r   r>   Nc                 C   N   | j ddd}|jdtdd |jdtdd |jd	d
dd |jtd d S )Ninspectz0Display detailed information on one or more Jobsr   rZ   r   rB   r\   r]   job_idsr_   zThe jobs to inspectra   r)   )r+   rc   rd   r-   r.   rg   r   r   r   r/   }     z"InspectCommand.register_subcommandr$   c                 C   r   r    )rx   ry   r   r   r   r   r   r     r   zInspectCommand.__init__c                    D   t jd  fddjD }ttjdd |D dtd d S )Nr   c                       g | ]
} j |jd qS )r   )inspect_jobrx   )r   r   r   r{   r   r   r     r   z&InspectCommand.run.<locals>.<listcomp>c                 S      g | ]}t |qS r   r   )r   r   r   r   r   r     r      indentr   )r   ry   r   r   jsondumpsrd   )r{   r   r   r%  r   r?     s   "zInspectCommand.runr   r   r   r   r   r   r.   |  r   r.   c                   @   r=   )r3   r   r>   Nc                 C   r   )NcancelzCancel a Jobr   r   r   rB   rZ   r   r\   r]   r)   )r+   rc   rd   r-   r3   rg   r   r   r   r/     r   z!CancelCommand.register_subcommandr$   c                 C   r   r    r   r   r   r   r   r     r   zCancelCommand.__init__c                 C   "   t | jd}|j| j| jd d S r   )r   ry   
cancel_jobr   rx   r{   r   r   r   r   r?        zCancelCommand.runr   r   r   r   r   r   r3     r   r3   c                   @   8   e Zd ZdZedd ZdeddfddZdd	d
ZdS )r4   z.Run UV scripts on Hugging Face infrastructure.c                 C   sB  | j ddd}|jdddd}|j dd	d}|jd
dd |jdddg d |jdtdd |jddd |jdtddt dd |jddddd |jdddd d |jd!td"d |jd#td$d |jd%td&d |jd'd(d)d*d |jd+td,d |jd-td.d |jd/dd0d1d2 |jd3d4td5d |jtd6 d7S )8Register UV run subcommand.uvzERun UV scripts (Python with inline dependencies) on HF infrastructurer   
uv_commandUV commandsTdestr   requiredr?   8Run a UV script (local file or URL) on HF infrastructurescript$UV script to run (local file or URL)script_argsr_   Arguments for the scriptrb   r   r   --image.Use a custom Docker image with `uv` installed.rB   --repoCRepository name for the script (creates ephemeral if not specified)rQ   rR   rS   rT   rD   rE   rF   Environment variablesrH   rJ   rK   rL   rM   rN   rO   rP   rU    Max duration (e.g., 30s, 5m, 1h)rW   rX   rY   Run in backgroundrZ   r[   r\   HF token--with%Run with the given packages installedwith_rI   r   r7  -p--python5The Python interpreter to use for the run environmentr)   N)r+   r,   rc   rd   re   rf   r-   r4   r   	uv_parser
subparsersrh   r   r   r   r/     s^   	zUvCommand.register_subcommandr$   r>   Nc                 C   s
  |j | _ |j| _|j| _|j| _|j| _i | _|jr,| jt	t
|j tj d |jp0g D ]}| jt	|tj d q1i | _t }|jrY| jt	t
|j |d |jp]g D ]}| jt	||d q^|j| _|j| _|j| _|j| _|j| _|j| _dS z-Initialize the command with parsed arguments.rj   N)r:  r<  rI  dependenciespythonr@   rl   rm   rn   r   r   ro   rp   rk   rq   rr   rs   rt   ru   rv   rw   rx   ry   repo_reporz   r   r   r   r     s,   $zUvCommand.__init__c                 C   s   t t j t| jd}|j| j| j| j| j	| j
| j| j| j| j| j| jd}td|j  td|j  | jr<dS |j|jdD ]}t| qCdS )zExecute UV command.r   )r:  r<  rR  rS  r@   rl   rr   ru   rv   rx   rU  r   r   Nr   )r   set_verbosityINFOr   ry   
run_uv_jobr:  r<  rR  rS  r@   rl   rr   ru   rv   rx   rU  r   r   r   rw   r   r   r   r   r   r?     s,   
zUvCommand.runr   	r8   r9   r:   __doc__r;   r/   r   r   r?   r   r   r   r   r4     s    
9r4   c                  C   s$   t j } t  }d ur|| d< | S )NHF_TOKEN)rp   rk   rq   r   )r}   ry   r   r   r   rs   #  s   
rs   c                   @   r   )r5   r   c                    sx   | j ddd}|jdd |j fddd t  t  t  t  t  t	  t
  d S )N	scheduledz,Create and manage scheduled Jobs on the Hub.r   z.huggingface.co scheduled jobs related commandsc                    r   r    r!   r#   scheduled_jobs_subparsersr   r   r'   3  r(   z;ScheduledJobsCommands.register_subcommand.<locals>.<lambda>r)   )r+   r,   r-   ScheduledRunCommandr/   ScheduledPsCommandScheduledInspectCommandScheduledDeleteCommandScheduledSuspendCommandScheduledResumeCommandScheduledUvCommand)r   scheduled_jobs_parserr   r]  r   r/   +  s   





z)ScheduledJobsCommands.register_subcommandNr7   r   r   r   r   r5   *  r<   r5   c                   @   r=   )r_  r   r>   Nc                 C   s  | j ddd}|jdtdd |jdtdd |jd	d
dd d |jdd
dd d |jddddd |jddddd |jdtdd |jdtdd |jdtddt dd |jdtd d |jd!td"d |jd#td$d |jd%d&d'd( |jtd) d S )*Nr?   zSchedule a Jobr   scheduleWOne of annually, yearly, monthly, weekly, daily, hourly, or a CRON schedule expression.rB   r@   rA   	--suspendrY   !Suspend (pause) the scheduled JobrI   r   r   --concurrency8Allow multiple instances of this Job to run concurrentlyrD   rE   rF   rG   rH   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rZ   z`The namespace where the scheduled Job will be created. Defaults to the current user's namespace.r\   r]   r^   r_   r`   ra   r)   )r+   rc   rd   re   rf   r-   r_  rg   r   r   r   r/   @  sd   	z'ScheduledRunCommand.register_subcommandr$   c                 C   s   |j | _ |j| _|j| _|j| _|j| _i | _|jr,| jtt	|j
 tj d |jp0g D ]}| jt|tj d q1i | _t }|jrY| jtt	|j
 |d |jp]g D ]}| jt||d q^|j| _|j| _|j| _|j| _d S ri   )rg  r@   r^   suspendconcurrencyrl   rm   rn   r   r   ro   rp   rk   rq   rr   rs   rt   ru   rv   rx   ry   rz   r   r   r   r   x  s(   $zScheduledRunCommand.__init__c                 C   sR   t | jd}|j| j| j| j| j| j| j| j	| j
| j| jd
}td|j  d S )Nr   )
r@   r^   rg  rn  ro  rl   rr   ru   rv   rx   Scheduled Job created with ID: )r   ry   create_scheduled_jobr@   r^   rg  rn  ro  rl   rr   ru   rv   rx   r   r   )r{   r   scheduled_jobr   r   r   r?     s   zScheduledRunCommand.runr   r   r   r   r   r   r_  ?  s
    7r_  c                   @   r   )r`  r   r>   Nc                 C   r   )Nr   zList scheduled Jobsr   r   r   rY   z1Show all scheduled Jobs (default hides suspended)rH   rZ   r   rB   r\   r]   r   r   rF   r   r   r   r   r)   )r+   rc   rd   r-   r`  rg   r   r   r   r/     r   z&ScheduledPsCommand.register_subcommandr$   c                 C   r   r   r   r   r   r   r   r     r   zScheduledPsCommand.__init__c              
   C   s  zt | jd}|j| jd}g d}g }|D ]\}|j}| js!|r!q|j}|j}|jj	p,d}	|jj
p2g }
|
r:d|
nd}|jjrH|jjjdnd}|jjrU|jjdnd}||	t||d}| |sfq||||	||||g q|sd}| jrd	d
dd | j D  }td|  W dS | || W dS  tjy } ztd|  W Y d}~dS d}~w tttfy } ztd|  W Y d}~dS d}~w ty } ztdt|j d|  W Y d}~dS d}~ww )z
        Fetch and display scheduked job information for the current user.
        Uses Docker-style filtering with -f/--filter flag and key=value pairs.
        r   r   )IDSCHEDULEr   r   zLAST RUNzNEXT RUNSUSPENDr   r   r   )r   r@   rn  r^   r   r   rS   c                 S   r   r   r   r   r   r   r   r   *  r   z*ScheduledPsCommand.run.<locals>.<listcomp>zNo scheduled jobs foundNz$Error fetching scheduled jobs data: z&Error processing scheduled jobs data: r   r   ) r   ry   list_scheduled_jobsrx   rn  r   r   rg  job_specr   r^   re   r   last_jobatr   next_job_run_atrd   r   rF   r   r   r   r   r   r   r   r   r   r   rC   r8   )r{   r   scheduled_jobsr   r   rr  rn  scheduled_job_idrg  r   r^   r   last_job_atrz  r   r   r   r   r   r   r?     sp   

 (zScheduledPsCommand.runr   c                 C   r   )	z5Check if scheduled job matches all specified filters.Fr   r  r  rT   r  r  Tr  r
  r   r   r   r   9  r  z#ScheduledPsCommand._matches_filtersc           	      C   r  )r  )r   rg  r@   r^   r}  rz  rn  r  r  r  Nr  r  r   r   r   r   L  s&   
z ScheduledPsCommand._print_outputr   r  r   r   r   r   r`    s    "
fr`  c                   @   r=   )ra  r   r>   Nc                 C   r  )Nr  z:Display detailed information on one or more scheduled Jobsr   rZ   SThe namespace where the scheduled job is. Defaults to the current user's namespace.rB   r\   r]   scheduled_job_idsr_   zThe scheduled jobs to inspectra   r)   )r+   rc   rd   r-   ra  rg   r   r   r   r/   e  r!  z+ScheduledInspectCommand.register_subcommandr$   c                 C   r   r    )rx   ry   r  r   r   r   r   r   s  r   z ScheduledInspectCommand.__init__c                    r"  )Nr   c                    r#  )r|  rx   )inspect_scheduled_jobrx   )r   r|  r%  r   r   r   z  s    z/ScheduledInspectCommand.run.<locals>.<listcomp>c                 S   r&  r   r   )r   rr  r   r   r   r   ~  r   r'  r(  )r   ry   r  r   r*  r+  rd   )r{   r{  r   r%  r   r?   x  s
   "zScheduledInspectCommand.runr   r   r   r   r   r   ra  d  r   ra  c                   @   r=   )rb  r   r>   Nc                 C   r   )NdeletezDelete a scheduled Jobr   r|  Scheduled Job IDrB   rZ   r~  r\   r]   r)   )r+   rc   rd   r-   rb  rg   r   r   r   r/     r   z*ScheduledDeleteCommand.register_subcommandr$   c                 C   r   r    r|  rx   ry   r   r   r   r   r     r   zScheduledDeleteCommand.__init__c                 C   r-  Nr   r  )r   ry   delete_scheduled_jobr|  rx   r/  r   r   r   r?     r0  zScheduledDeleteCommand.runr   r   r   r   r   r   rb    r   rb  c                   @   r=   )rc  r   r>   Nc                 C   r   )Nrn  zSuspend (pause) a scheduled Jobr   r|  r  rB   rZ   r~  r\   r]   r)   )r+   rc   rd   r-   rc  rg   r   r   r   r/     r   z+ScheduledSuspendCommand.register_subcommandr$   c                 C   r   r    r  r   r   r   r   r     r   z ScheduledSuspendCommand.__init__c                 C   r-  r  )r   ry   suspend_scheduled_jobr|  rx   r/  r   r   r   r?     r0  zScheduledSuspendCommand.runr   r   r   r   r   r   rc    r   rc  c                   @   r=   )rd  r   r>   Nc                 C   r   )Nresumez Resume (unpause) a scheduled Jobr   r|  r  rB   rZ   r~  r\   r]   r)   )r+   rc   rd   r-   rd  rg   r   r   r   r/     r   z*ScheduledResumeCommand.register_subcommandr$   c                 C   r   r    r  r   r   r   r   r     r   zScheduledResumeCommand.__init__c                 C   r-  r  )r   ry   resume_scheduled_jobr|  rx   r/  r   r   r   r?     r0  zScheduledResumeCommand.runr   r   r   r   r   r   rd    r   rd  c                   @   r1  )re  z3Schedule UV scripts on Hugging Face infrastructure.c                 C   sv  | j ddd}|jdddd}|j dd	d}|jd
tdd |jddd |jdddg d |jddddd |jddddd |jdtdd |jddd |jdtdd t d!d |jd"d#d$d%d& |jd'd(d$d)d& |jd*td+d |jd,td-d |jd.td/d |jd0d1dd2d& |jd3td4d |jd5td6d |jd7d$d8d9d: |jd;d<td=d |jtd> dS )?r2  r3  zJSchedule UV scripts (Python with inline dependencies) on HF infrastructurer   r4  r5  Tr6  r?   r9  rg  rh  rB   r:  r;  r<  r_   r=  r>  ri  rY   rj  Nrk  rl  rm  r?  r@  rA  rB  rQ   rR   rS   rT   rD   rE   rF   rC  rH   rJ   rK   rL   rM   rN   rO   rP   rU   rD  rW   rX   rE  rZ   r[   r\   rF  rG  rH  rI  rJ  rK  rL  rM  r)   )r+   r,   rc   rd   re   rf   r-   re  rN  r   r   r   r/     s   	z&ScheduledUvCommand.register_subcommandr$   r>   Nc                 C   s"  |j | _ |j| _|j| _|j| _|j| _|j| _|j| _|j| _i | _	|j
r8| j	tt|j
 tj d |j	p<g D ]}| j	t|tj d q=i | _t }|jre| jtt|j |d |jpig D ]}| jt||d qj|j| _|j| _|j| _|j| _|j| _|j| _dS rQ  )rg  r:  r<  rn  ro  rI  rR  rS  r@   rl   rm   rn   r   r   ro   rp   rk   rq   rr   rs   rt   ru   rv   rw   rx   ry   rT  rU  rz   r   r   r   r     s2   $zScheduledUvCommand.__init__c                 C   sn   t t j t| jd}|j| j| j| j| j	| j
| j| j| j| j| j| j| j| j| jd}td|j  dS )zSchedule UV command.r   )r:  r<  rg  rn  ro  rR  rS  r@   rl   rr   ru   rv   rx   rU  rp  N)r   rV  rW  r   ry   create_scheduled_uv_jobr:  r<  rg  rn  ro  rR  rS  r@   rl   rr   ru   rv   rx   rU  r   r   )r{   r   r   r   r   r   r?   6  s&   zScheduledUvCommand.runr   rY  r   r   r   r   re    s    
Jre  )2rZ  r*  rp   r  argparser   r   dataclassesr   pathlibr   typingr   r   r	   r
   r   huggingface_hubr   r   r   huggingface_hub.utilsr   huggingface_hub.utils._dotenvr   r   r   
get_loggerr8   loggerrf   r   r2   r0   rd   intr   r1   r.   r3   r4   rs   r5   r_  r`  ra  rb  rc  rd  re  r   r   r   r   <module>   sD   
Y* %ta E