o
    iv                     @   s6  d Z ddlZddlmZmZ ddlZddlmZ ddlm	Z	m
Z
 ddlmZmZmZmZmZmZmZ eeZejddddddddf	d	ed
eeejddf dedededeeee  ejddf deeee  ejddf dedeee ejddf deeejddf deeejddf ddfddZdS )z7Contains command to upload a large folder with the CLI.    N)	AnnotatedOptional)logging)ANSIdisable_progress_bars   )
PrivateOpt	RepoIdArgRepoTypeRepoTypeOptRevisionOptTokenOpt
get_hf_apiFrepo_id
local_pathz#Local path to the folder to upload.)help	repo_typerevisionprivateincludez'Glob patterns to match files to upload.excludez.Glob patterns to exclude from files to upload.tokennum_workersz:Number of workers to use to hash, upload and commit files.	no_reportz)Whether to disable regular status report.no_barsz!Whether to disable progress bars.returnc                 C   sh   t j|stjdddttd| d |
rt  t	|d}|j
| ||j||||||	 d	 dS )	zDUpload a large folder to the Hub. Recommended for resumable uploads.z+Large upload is only supported for folders.r   )
param_hinta  You are about to upload a large folder to the Hub using `hf upload-large-folder`. This is a new feature so feedback is very welcome!

A few things to keep in mind:
  - Repository limits still apply: https://huggingface.co/docs/hub/repositories-recommendations
  - Do not start several processes in parallel.
  - You can interrupt and resume the process at any time. The script will pick up where it left off except for partially uploaded files that would have to be entirely reuploaded.
  - Do not upload the same folder to several repositories. If you need to do so, you must delete the `./.cache/huggingface/` folder first.

Some temporary metadata will be stored under `a  /.cache/huggingface`.
  - You must not modify those files manually.
  - You must not delete the `./.cache/huggingface/` folder while a process is running.
  - You can delete the `./.cache/huggingface/` folder to reinitialize the upload state when process is not running. Files will have to be hashed and preuploaded again, except for already committed files.

If the process output is too verbose, you can disable the progress bars with `--no-bars`. You can also entirely disable the status report with `--no-report`.

For more details, run `hf upload-large-folder --help` or check the documentation at https://huggingface.co/docs/huggingface_hub/guides/upload#upload-a-large-folder.)r   )	r   folder_pathr   r   r   allow_patternsignore_patternsr   print_reportN)ospathisdirtyperBadParameterprintr   yellowr   r   upload_large_foldervalue)r   r   r   r   r   r   r   r   r   r   r   api r+   m/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/huggingface_hub/cli/upload_large_folder.pyr(      s.   ,


r(   )__doc__r!   typingr   r   r$   huggingface_hubr   huggingface_hub.utilsr   r   
_cli_utilsr   r	   r
   r   r   r   r   
get_logger__name__loggermodelstrArgumentlistOptionintboolr(   r+   r+   r+   r,   <module>   s   $
	


$*