
    PiY                     L   d dl mZmZmZ d dlmZ ddlmZ ddlm	Z	 ddl
mZmZmZ  G d de          Z G d	 d
e          Z G d dee          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d d e          Z G d! d"e          Z G d# d$e          Z G d% d&e          Z G d' d(e          Z  G d) d*e          Z!d+S ),    )AnyOptionalUnion)HfFileSystem   )config)	CastError)TrackedIterableFromGeneratortracked_listtracked_strc                       e Zd ZdZdS )DatasetsErrorz*Base class for exceptions in this library.N__name__
__module____qualname____doc__     g/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/datasets/exceptions.pyr   r      s        4444r   r   c                       e Zd ZdZdS )DefunctDatasetErrorzThe dataset has been defunct.Nr   r   r   r   r   r      s        ''''r   r   c                       e Zd ZdZdS )FileNotFoundDatasetsErrorz)FileNotFoundError raised by this library.Nr   r   r   r   r   r              3333r   r   c                       e Zd ZdZdS )DataFilesNotFoundErrorz No (supported) data files found.Nr   r   r   r   r   r      s        ****r   r   c                       e Zd ZdZdS )DatasetNotFoundErrorzDataset not found.

    Raised when trying to access:
    - a missing dataset, or
    - a private/gated dataset and the user is not authenticated.
    Nr   r   r   r   r   r      s           r   r   c                       e Zd ZdS )DatasetBuildErrorNr   r   r   r   r   r   r!   r!   %           Dr   r!   c                       e Zd ZdS )ManualDownloadErrorNr"   r   r   r   r%   r%   )   r#   r   r%   c                       e Zd ZdS )FileFormatErrorNr"   r   r   r   r'   r'   -   r#   r   r'   c                       e Zd ZdS )DatasetGenerationErrorNr"   r   r   r   r)   r)   1   r#   r   r)   c                   f    e Zd Zedededeeef         dee	e
ef                  dd f
d            ZdS )DatasetGenerationCastError
cast_errorbuilder_name
gen_kwargstokenreturnc                    d|                                  }g }|                                D ]d}t          |t          t          t
          f          s&t          |t          t
          f          r1|j        *|j        }t          |t          t
          f          r|j        *t          |t                    r|                                }t          |t                    r|	                    d          r|t          t          j        |                              |          }d|                                z   }d|j        z   |v r+|                    d|j        z   dd          d|j         dz   }|                    t          |                     f|r|d	| d
d                    |           z  }d}	 | d|z   |	z             S )NzC

All the data files must have the same columns, but at some point zhf://)endpointr/   @ r   z (at revision )z

This happened while the z, dataset builder was generating data using

z, z

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)z.An error occurred while generating the dataset)detailsvalues
isinstancer   r   r
   	last_item
get_originstr
startswithr   r   HF_ENDPOINTresolve_path	unresolverevisionreplaceappendjoin)
clsr,   r-   r.   r/   explanation_messageformatted_tracked_gen_kwargs	gen_kwargresolved_pathhelp_messages
             r   from_cast_errorz*DatasetGenerationCastError.from_cast_error6   s&    kT^TfTfThThjj 	 35$#**,, 	@ 	@Ii+|Ea)bcc 9|5Q&RSS0XaXkXw%/	 9|5Q&RSS0XaXkXw )[11 3%0022	)S)) i.B.B7.K.K  ,f6HPU V V V c cdm n n#m&=&=&?&??	//9<<!))#0F*FANND=+ADDDE  )//I????' 	h  $h,  $h  $h  C  H  H  Ie  f  f  $h  $h  h csCFYY\hhiiir   N)r   r   r   classmethodr	   r;   dictr   r   r   boolrJ   r   r   r   r+   r+   5   s         j j  j cN	 j
 dCi() j 
& j  j  j [ j  j  jr   r+   c                       e Zd ZdZdS )ChecksumVerificationErrorz@Error raised during checksums verifications of downloaded files.Nr   r   r   r   rO   rO   Z   s        JJJJr   rO   c                       e Zd ZdZdS )UnexpectedDownloadedFileErrorz(Some downloaded files were not expected.Nr   r   r   r   rQ   rQ   ^   s        2222r   rQ   c                       e Zd ZdZdS ) ExpectedMoreDownloadedFilesErrorz7Some files were supposed to be downloaded but were not.Nr   r   r   r   rS   rS   b           AAAAr   rS   c                       e Zd ZdZdS )NonMatchingChecksumErrorz?The downloaded file checksum don't match the expected checksum.Nr   r   r   r   rV   rV   f   s        IIIIr   rV   c                       e Zd ZdZdS )SplitsVerificationErrorz)Error raised during splits verifications.Nr   r   r   r   rX   rX   j   r   r   rX   c                       e Zd ZdZdS )UnexpectedSplitsErrorz6The expected splits of the downloaded file is missing.Nr   r   r   r   rZ   rZ   n   s        @@@@r   rZ   c                       e Zd ZdZdS )ExpectedMoreSplitsErrorz!Some recorded splits are missing.Nr   r   r   r   r\   r\   r   s        ++++r   r\   c                       e Zd ZdZdS )NonMatchingSplitsSizesErrorz7The splits sizes don't match the expected splits sizes.Nr   r   r   r   r^   r^   v   rT   r   r^   N)"typingr   r   r   huggingface_hubr   r4   r   tabler	   utils.trackr
   r   r   	Exceptionr   r   FileNotFoundErrorr   r   r   r!   r%   r'   r)   r+   rO   rQ   rS   rV   rX   rZ   r\   r^   r   r   r   <module>re      s   ( ' ' ' ' ' ' ' ' ' ( ( ( ( ( (             P P P P P P P P P P5 5 5 5 5I 5 5 5( ( ( ( (- ( ( (4 4 4 4 4/@ 4 4 4+ + + + +6 + + +    4   	 	 	 	 	 	 	 		 	 	 	 	+ 	 	 		 	 	 	 	' 	 	 		 	 	 	 	. 	 	 	"j "j "j "j "j!7 "j "j "jJK K K K K K K K3 3 3 3 3$= 3 3 3B B B B B'@ B B BJ J J J J8 J J J4 4 4 4 4m 4 4 4A A A A A3 A A A, , , , ,5 , , ,B B B B B"9 B B B B Br   