
    6pj                       % S r SSKJr  SSKrSSKJr  SSKJrJrJ	r	J
r
JrJr  SSKJr  SSKJr  SSKJr  SS	KJr  \(       a  S
SKJr  \" 5       rSS/rSqS\S'   \R8                  " 5       rSS jr                 S                                 SS jjr             S                         SS jjrg)u   Snapshot download — shim preserving the legacy positional-arg signature.

Delegates to ``modelscope_hub.compat`` while keeping ``revision``, ``cache_dir``
and friends accessible as positional arguments for backward compatibility.
    )annotationsN)Path)TYPE_CHECKINGDictListOptionalTypeUnion)dataset_snapshot_download)snapshot_download)find_reusable_legacy_repo_dir)
get_logger   )ProgressCallbackr   r   Optional[bool]_legacy_cache_capabilityc                     [         b  g[           [         b
   SSS5        g SSKJn   [	        U S5      q [         (       d  [        R                  S5        SSS5        g! [
         a    Sq  N7f = f! , (       d  f       g= f)zWarn once when the installed modelscope-hub cannot auto-detect a
pre-1.38 (legacy) cache layout, so downloads don't silently skip an
existing local cache and re-fetch into the new layout.
Nr   DownloadManager_find_legacy_repo_dirFzThe installed modelscope-hub lacks legacy cache auto-detection (added in modelscope-hub>=0.1.7). An existing pre-1.38 cache will not be reused; files will be downloaded into the new cache layout. Upgrade with: pip install -U 'modelscope-hub>=0.1.8'.)r   _legacy_cache_lockmodelscope_hub._downloadr   hasattr	Exceptionloggerwarningr   s    \/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/modelscope/hub/snapshot_download.py+_warn_if_legacy_cache_detection_unavailabler   "   s{      +	#/ 
		-@'./F(H$ ('NN:; 
	  	-',$	- 
	s-   	A/A A/A,)A/+A,,A//
A=c                "   [        5         U=(       d    U nU=(       d    SnUb  [        U5      OSnUc  Ub  [        UUUS9n[        S0 SU _SU_SU_SU_SU_S	U_S
U	_SU
_SUb  UOS_SU_SU_SU_SU_SU_SUb  [	        U5      OS_SU_SU_6$ )a3  Download a complete repo snapshot.

Preserves the legacy positional-argument signature for backward
compatibility while delegating to ``modelscope_hub.compat``.
``progress_callbacks`` is a list of :class:`ProgressCallback` subclasses
(not instances), each instantiated per file to report download progress.
modelN	repo_type	cache_dirmodel_idrevisionr#   	local_dirallow_file_patternignore_file_patternallow_patternsignore_patternsmax_workers   cookiesrepo_idr"   tokenendpointlocal_files_onlyF
user_agentprogress_callbacks )r   strr   _compat_snapshot_downloadbool)r$   r%   r#   r2   r1   r-   r(   r'   r&   r)   r*   r+   r.   r"   r3   r/   r0   effective_ideffective_typecache_dir_strs                       r   r   r   <   s   4 01&hL)'N&/&;C	NM\51NmM	$    	
 . 0 & ( $/#:K       ' ./-2!" #$ .%     c                    [        5         U =(       d    U
nUb  [        U5      OSnUc  Ub  [        USUS9n[        UUUUUUUUUb  UOSU	UUS9$ )zCDownload a dataset repo snapshot (legacy positional-arg signature).Ndatasetr!   r,   )
dataset_idr%   r#   r&   r'   r(   r)   r*   r+   r-   r/   r0   )r   r5   r   !_compat_dataset_snapshot_download)r>   r%   r#   r&   r'   r(   r)   r*   r+   r-   r.   r/   r0   r8   r:   s                  r   r   r   s   sy      01(L&/&;C	NM\51IH	,-/%'#.#:K r;   )returnNone)NNNNFNNNNNNNNNNNN)"r$   Optional[str]r%   rB   r#   Union[str, Path, None]r2   zOptional[Union[Dict, str]]r1   r   r(   Optional[Union[str, List[str]]]r'   rD   r&   rB   r)   Optional[Union[List[str], str]]r*   rE   r+   Optional[int]r.   rB   r"   rB   r3   z&Optional[List[Type[ProgressCallback]]]r/   rB   r0   rB   r@   r5   )NNNNNNNNNNNNN)r>   rB   r%   rB   r#   rC   r&   rB   r'   rD   r(   rD   r)   rE   r*   rE   r+   rF   r.   rB   r/   rB   r0   rB   r@   r5   )__doc__
__future__r   	threadingpathlibr   typingr   r   r   r   r	   r
   'modelscope_hub.compat.snapshot_downloadr   r?   r   r6   modelscope.hub.utils.utilsr   modelscope.utils.loggerr   callbackr   r   __all__r   __annotations__Lockr   r   r4   r;   r   <module>rS      s  
 #   C CC3 E .*	 ;
< ,0 . /^^% ;6 #"(,-1',;?:>#6:7;!%!#AE"#444 &4 +	4
 %4 94 84 4 44 54 4 4 4 ?4  !4" #4$ 	%4p !%"(,#:>;?6:7;!%!"### &# 	#
 8# 9# 4# 5# # # # # 	#r;   