
    LMh                     B   d dl Z d dlmZ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e         dee         defdZ	 	 	 dd
ddededee         dedeeee         ef                  dee         ddfdZdS )    N)OptionalUnion)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        P/var/www/html/test/jupyter/venv/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          |d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model)default
additional)	item_typer$   r   )r   r   r   r   is_versioned
ValueErrorr
   ownerr&   r   ImportErrorr   r   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typingr   r   	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 
  &+	  
3- TN	
 	   2 #'7;7`  %7` 7` 7`7`7` 3-7` 	7`
 eDIsN347` tn7` 
7` 7` 7` 7` 7` 7`r   