+
    PjO                         ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHtHt ] P                  ! 4       t ! R R	]P"                  4      tR# )
    N)nn)pad_for_conv1d)DummyQuantizer)ProjectedTransformer)ConvDownsample1dConvTrUpsample1d)SEANetDecoderSEANetEncoderc                      a a ] tR t^t oV3R lV 3R llt]V3R lR l4       tV3R lR ltV3R lR ltV3R	 lR
 lt	V3R lR lt
V3R lR ltRtVtV ;t# )	MimiModelc                x   < V ^8  d   QhRS[ RS[RS[RS[RS[RS[RS[RS[R	,          R
S[R	,          RS[RS[/# )   encoderdecoder	quantizer
frame_rateencoder_frame_ratesample_ratechannels	inner_dimN	outer_dimencoder_transformerdecoder_transformer)r
   r	   r   floatintr   )format__classdict__s   "o/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/pocket_tts/models/mimi.py__annotate__MimiModel.__annotate__   s     . .. . "	.
 . ". . . :. :. 2. 2.    c                <  < \         SV `  4        Wn        W n        Wn        Wn        W0n        W@n        W`n        Wpn	        WPn
        VP                  p\        V\        4      '       g   Q R V R\        V4       R24       hWn        WT8w  d   V P                  V P                  8  g   Q R4       hV P                  V P                  ,          pV\        V4      8X  g   Q RV 24       h\        \        V4      WR7      V n        \#        \        V4      WR7      V n        R# R# )zDimension should be int, got z	 of type .zCannot upsample with conv.z(Only integer strides are supported, got )	dimensionout_dimension)r$   in_dimensionN)super__init__r   r   r   r   r   r   r   r   r   r$   
isinstancer   typer   
downsampler   upsample)selfr   r   r   r   r   r   r   r   r   r   r   r$   downsample_stride	__class__s   &&&&&&&&&&&&  r   r(   MimiModel.__init__   s    	#6 #6 "$& "4 %%	)S)) 	
+I;iY?PPQR	
) #+**T__<Z>ZZ< $ 7 7$// I$,=(>> :;L:MN>
 /%&)DO -%&)DM ,r!   c                    < V ^8  d   QhRS[ /# )r   return)r   )r   r   s   "r   r   r    A   s     7 7C 7r!   c                N    \        V P                  V P                  ,          4      # N)r   r   r   )r-   s   &r   
frame_sizeMimiModel.frame_size@   s    4##doo566r!   c                4   < V ^8  d   QhRS[ P                  /# r   xtorchTensor)r   r   s   "r   r   r    D   s     4 4u|| 4r!   c                    VP                   w   r#V P                  pV P                  pWE8X  d   V# V P                  VR R7      # )Nmodel_state)shaper   r   r+   )r-   r9   _lengthr   new_frame_rates   &&    r   _to_framerateMimiModel._to_framerateD   sA    ww1,,
'Hqd33r!   c                N   < V ^8  d   QhRS[ P                  RS[ P                  /# r   r9   r2   r:   )r   r   s   "r   r   r    M   s#     , ,u|| ,ELL ,r!   c                    VP                   w   r4V P                  pV P                  pWV8X  d   V# V P                  W4      # r4   )r@   r   r   r,   )r-   r9   
mimi_staterA   rB   r   rC   s   &&&    r   _to_encoder_framerateMimiModel._to_encoder_framerateM   s=    ww1,,
'H}}Q++r!   c                4   < V ^8  d   QhRS[ P                  /# r8   r:   )r   r   s   "r   r   r    V   s     $ $ $r!   c                    \        4       hr4   )NotImplementedError)r-   r9   s   &&r   forwardMimiModel.forwardV   s    !##r!   c                N   < V ^8  d   QhRS[ P                  RS[ P                  /# )r   latentr2   r:   )r   r   s   "r   r   r    Y   s#       ell r!   c                p    V P                  W4      pV P                  W24      w  pV P                  W24      pV# r4   )rJ   r   r   )r-   rR   rI   embouts   &&&  r   decode_from_latentMimiModel.decode_from_latentY   s7    ((<))#:ll3+
r!   c                N   < V ^8  d   QhRS[ P                  RS[ P                  /# rG   r:   )r   r   s   "r   r   r    `   s#      %,, 5<< r!   c                    VP                  4       ^8X  g   Q RVP                   24       hV P                  p\        WV4      pV P	                  VRR7      pV P                  VRR7      w  pV P                  V4      pV# )zProjects a batch of waveforms to unquantized latent space.

Args:
    x (torch.Tensor): Float tensor of shape [B, C, T].

Returns:
    Unquantized embeddings.
zXCompressionModel._encode_to_unquantized_latent expects audio of shape [B, C, T] but got Nr>   )dimr@   r5   r   r   r   rD   )r-   r9   r5   rT   s   &&  r   encode_to_latentMimiModel.encode_to_latent`   s     uuw!| 	
fghgngnfop	
| __

 1*5ll1$l/))#4)@  %
r!   )r   r   r   r$   r+   r   r   r   r   r   r   r,   )__name__
__module____qualname____firstlineno__r(   propertyr5   rD   rJ   rO   rV   r[   __static_attributes____classdictcell____classcell__)r/   r   s   @@r   r   r      s[     . .` 7 74 4, ,$ $   r!   r   )loggingr;   r   pocket_tts.modules.convr   "pocket_tts.modules.dummy_quantizerr   #pocket_tts.modules.mimi_transformerr   pocket_tts.modules.resampler   r   pocket_tts.modules.seanetr	   r
   	getLoggerloggerModuler    r!   r   <module>ro      s=       2 = D J B				h		 hr!   