
    HJj                     r    d dl Z d dlmZ d dlmZ dZdZe G d d             Z G d d	      Zd
 Z	 e	       Z
y)    N)	dataclass)Pathi  i]  c                   6    e Zd ZU dZedz  ed<   dZedz  ed<   y)EspeakConfigNlib_path	data_path)__name__
__module____qualname__r   str__annotations__r        \/Users/ahmed/devFolder/claude-voice/.venv/lib/python3.12/site-packages/kokoro_onnx/config.pyr   r   	   s    HcDj IsTz r   r   c                   0    e Zd Z	 ddedededz  fdZd Zy)KoKoroConfigN
model_pathvoices_pathespeak_configc                 .    || _         || _        || _        y N)r   r   r   )selfr   r   r   s       r   __init__zKoKoroConfig.__init__   s     %&*r   c                    t        | j                        j                         s$d| j                   }|dz  }|dz  }t        |      t        | j                        j                         sd| j                   }|dz  }t        |      y )NzVoices file not found at z>
You can download the voices file using the following command:zd
wget https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/voices-v1.0.binzModel file not found at zZ
You can download the model file from https://github.com/thewh1teagle/kokoro-onnx/releases)r   r   existsFileNotFoundErrorr   )r   	error_msgs     r   validatezKoKoroConfig.validate   s    D$$%,,.3D4D4D3EFIQI   A  AI#I..DOO$++-24??2CDIvvI#I.. .r   r   )r	   r
   r   r   r   r   r   r   r   r   r   r      s2    
 .2	++ + $d*	+/r   r   c                      t        t        t              j                  dz  d      5 } t	        j
                  |       }|d   cd d d        S # 1 sw Y   y xY w)Nzconfig.jsonzutf-8)encodingvocab)openr   __file__parentjsonload)fpconfigs     r   	get_vocabr)   )   s>    	d8n##m3g	F"2g 
G	F	Fs   AA)r%   dataclassesr   pathlibr   MAX_PHONEME_LENGTHSAMPLE_RATEr   r   r)   DEFAULT_VOCABr   r   r   <module>r/      sJ     !   ! ! !
/ /4 r   