o
    h[	                     @   s4   d dl mZ ddlmZ dd ZG dd deZdS )	    )ArgumentParser   )BaseTransformersCLICommandc                 C   s   t | j| j| j| jS N)DownloadCommandmodel	cache_dirforcetrust_remote_code)args r   r/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/transformers/commands/download.pydownload_command_factory   s   r   c                   @   s@   e Zd ZedefddZdedededefdd	Zd
d Z	dS )r   parserc                 C   s\   |  d}|jdtd dd |jdddd |jd	dd
d |jdtdd |jtd d S )Ndownloadz--cache-dirz$Path to location to store the models)typedefaulthelpz--force
store_truez;Force the model to be download even if already in cache-dir)actionr   z--trust-remote-codezWhether or not to allow for custom models defined on the Hub in their own modeling files. Use only if you've reviewed the code as it will execute on your local machiner   zName of the model to download)r   r   )func)
add_parseradd_argumentstrset_defaultsr   )r   download_parserr   r   r   register_subcommand   s   
z#DownloadCommand.register_subcommandr   cacher	   r
   c                 C   s   || _ || _|| _|| _d S r   )_model_cache_force_trust_remote_code)selfr   r   r	   r
   r   r   r   __init__*   s   
zDownloadCommand.__init__c                 C   sH   ddl m}m} |j| j| j| j| jd |j| j| j| j| jd d S )N   )	AutoModelAutoTokenizer)r   force_downloadr
   )models.autor%   r&   from_pretrainedr   r   r    r!   )r"   r%   r&   r   r   r   run0   s   
zDownloadCommand.runN)
__name__
__module____qualname__staticmethodr   r   r   boolr#   r*   r   r   r   r   r      s
    r   N)argparser    r   r   r   r   r   r   r   <module>   s   