o
    8wi                     @   sZ   d dl Z d dlmZmZ d dlmZ d dlmZmZm	Z	 ddl
mZ eG dd dZdS )	    N)	dataclassfield)Path)AnyOptionalUnion   )configc                       s.  e Zd ZU dZdZeeeef  e	d< dZ
ee	d< dZee	d< dZee	d< dZee e	d< dZee e	d	< dZee	d
< dZee	d< dZee	d< dZee	d< dZee	d< dZee e	d< dZee	d< dZeeeef  e	d< eedZeeef e	d< dZee e	d< dZee	d< dddZ fddZ   Z!S )DownloadConfiga\	  Configuration for our cached path manager.

    Attributes:
        cache_dir (`str` or `Path`, *optional*):
            Specify a cache directory to save the file to (overwrite the
            default cache dir).
        force_download (`bool`, defaults to `False`):
            If `True`, re-download the file even if it's already cached in
            the cache dir.
        resume_download (`bool`, defaults to `False`):
            If `True`, resume the download if an incompletely received file is
            found.
        proxies (`dict`, *optional*):
        user_agent (`str`, *optional*):
            Optional string or dict that will be appended to the user-agent on remote
            requests.
        extract_compressed_file (`bool`, defaults to `False`):
            If `True` and the path point to a zip or tar file,
            extract the compressed file in a folder along the archive.
        force_extract (`bool`, defaults to `False`):
            If `True` when `extract_compressed_file` is `True` and the archive
            was already extracted, re-extract the archive and override the folder where it was extracted.
        delete_extracted (`bool`, defaults to `False`):
            Whether to delete (or keep) the extracted files.
        extract_on_the_fly (`bool`, defaults to `False`):
            If `True`, extract compressed files while they are being read.
        use_etag (`bool`, defaults to `True`):
            Whether to use the ETag HTTP response header to validate the cached files.
        num_proc (`int`, *optional*):
            The number of processes to launch to download the files in parallel.
        max_retries (`int`, default to `1`):
            The number of times to retry an HTTP request if it fails.
        token (`str` or `bool`, *optional*):
            Optional string or boolean to use as Bearer token
            for remote files on the Datasets Hub. If `True`, or not specified, will get token from `~/.huggingface`.
        storage_options (`dict`, *optional*):
            Key/value pairs to be passed on to the dataset file-system backend, if any.
        download_desc (`str`, *optional*):
            A description to be displayed alongside with the progress bar while downloading the files.
        disable_tqdm (`bool`, defaults to `False`):
            Whether to disable the individual files download progress bar
    N	cache_dirFforce_downloadresume_downloadlocal_files_onlyproxies
user_agentextract_compressed_fileforce_extractdelete_extractedextract_on_the_flyTuse_etagnum_proc   max_retriestoken)default_factorystorage_optionsdownload_descdisable_tqdmreturnc                 C   s    | j di dd | j D S )Nc                 S   s   i | ]
\}}|t |qS  )copydeepcopy).0kvr   r   ^/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/datasets/download/download_config.py
<dictcomp>I   s    z'DownloadConfig.copy.<locals>.<dictcomp>r   )	__class____dict__items)selfr   r   r%   r    H   s    zDownloadConfig.copyc                    sl   |dkr-t | dd d ur-d| jvr|tjd| jd< nt | jd dd d u r-|| jd d< t || d S )Nr   r   hf)r   endpoint)getattrr   r	   HF_ENDPOINTsuper__setattr__)r*   namevaluer'   r   r%   r0   K   s   
zDownloadConfig.__setattr__)r   r
   )"__name__
__module____qualname____doc__r   r   r   strr   __annotations__r   boolr   r   r   dictr   r   r   r   r   r   r   intr   r   r   r   r   r   r   r    r0   __classcell__r   r   r3   r%   r
   	   s*   
 +
r
   )r    dataclassesr   r   pathlibr   typingr   r   r    r	   r
   r   r   r   r%   <module>   s    