
    Pi                        d dl Z d dlmZ d dlm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 d dlmZ  e j        e          Zg d	Z	 dd
ddededz  dedz  defdZ	 	 	 dd
ddedededz  dedee         ez  dz  dedz  ddfdZdS )    N)ApiBlobType)registry)normalize_patternsupload_files_and_directories)parse_model_handle)EXTRA_CONSOLE_BLOCK)create_model_if_missing create_model_instance_or_version)sign_with_sigstore)z.git/z*/.git/z.cache/z.huggingface/Fforce_downloadhandlepathr   returnc                    t          |           }t                              d|                                 di t                     t          j        |||          \  }}|S )aH  Download model files.

    Args:
        handle: (string) the model handle.
        path: (string) Optional path to a file within the model bundle.
        force_download: (bool) Optional flag to force download a model, even if it's cached.

    Returns:
        A string representing the path to the requested model files.
    zDownloading Model:  ...)extrar   )r   loggerinfoto_urlr   r   model_resolver)r   r   r   h_s        d/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/kagglehub/models.pymodel_downloadr      sb      	6""A
KK6ahhjj666>UAT>UKVVV%anMMMGD!K     sigstorelocal_model_dirlicense_nameversion_notesignore_patternsr   c                   t          |           }t                              d|                                 d           |                                rd}t          |          t          |j        |j                   	 |rt          ||          }n # t          $ r d}t          |          dw xY wt          |t          j        t          t          |                    }	t!          ||	|||           dS )	a%  Upload model files.

    Args:
        handle: (str) the model handle.
        local_model_dir: (str) path to a file in a local directory.
        license_name: (str) model license.
        version_notes: (str, optional) model versions.
        ignore_patterns (str or list[str], optional):
            Additional ignore patterns to DEFAULT_IGNORE_PATTERNS.
            Files matching any of the patterns are not uploaded.
            Patterns are standard wildcards that can be matched by
            https://docs.python.org/3/library/fnmatch.html.
            Use a pattern ending with "/" to ignore the whole dir,
            e.g., ".git/" is equivalent to ".git/*".
        sigstore: (bool, optional)
            Creates a trasparent ledger on sigstore. User must be an admin/editor of the model.
    zUploading Model r   z/The model handle should not include the versionzThe 'model_upload(...sign=True)' function requires the 'kagglehub[signing]' extras. Install them with 'pip install kagglehub[signing]'N)default
additional)	item_typer#   r   )r   r   r   r   is_versioned
ValueErrorr	   ownermodelr   ImportErrorr   r   MODELr   DEFAULT_IGNORE_PATTERNSr
   )
r   r    r!   r"   r#   r   r   is_versioned_exceptionimport_warning_messagetokenss
             r   model_uploadr2   (   s   6 	6""A
KK3188::333444~~ 1!R/000 AGQW---	< 	>)/1==H < < <A 	
 011t;< *#*3JWfggg  F %QmV^______s    B B0)N)Nr   N)logging&kagglesdk.blobs.types.blob_api_servicer   	kagglehubr   kagglehub.gcs_uploadr   r   kagglehub.handler   kagglehub.loggerr   kagglehub.models_helpersr	   r
   kagglehub.signingr   	getLogger__name__r   r.   strboolr   listr2    r   r   <module>rA      s    > > > > > >       Q Q Q Q Q Q Q Q / / / / / / 0 0 0 0 0 0 ^ ^ ^ ^ ^ ^ ^ ^ 0 0 0 0 0 0		8	$	$ KJJ 
  #(	  
* 4K	
 	   2  $.27` "7` 7` 7`7`7` *7` 	7`
 #Y_t+7` Tk7` 
7` 7` 7` 7` 7` 7`r   