


'''simple docstring'''
import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin






class 					__lowerCAmelCase   (   __SCREAMING_SNAKE_CASE						):

						"""simple docstring"""






						_UpperCAmelCase		:       Optional[Any]   						="""Speech2TextFeatureExtractor"""
						_UpperCAmelCase		:       int   						="""Speech2TextTokenizer"""






						def __init__(  self							:      int ,  lowerCAmelCase							:      str ,  lowerCAmelCase							:      Optional[Any]	):
													super().__init__(_A ,  _A	)
													A_			    =		self.feature_extractor
													A_			    =		False






						def __call__(  self							:      List[Any] ,  *lowerCAmelCase							:      List[Any] ,  **lowerCAmelCase							:      Optional[Any]	):







													if self._in_target_context_manager:
																				return self.current_processor(*_A ,  **_A	)

													if "raw_speech" in kwargs:
																				warnings.warn("Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead."	)
																				A_			    =		kwargs.pop("raw_speech"	)
													else:
																				A_			    =		kwargs.pop("audio" ,  _A	)
													A_			    =		kwargs.pop("sampling_rate" ,  _A	)
													A_			    =		kwargs.pop("text" ,  _A	)
													if len(_A	) > 0:
																				A_			    =		args[0]
																				A_			    =		args[1:]

													if audio is None and text is None:
																				raise ValueError("You need to specify either an `audio` or `text` input to process."	)

													if audio is not None:
																				A_			    =		self.feature_extractor(_A ,  *_A ,  sampling_rate=_A ,  **_A	)
													if text is not None:
																				A_			    =		self.tokenizer(_A ,  **_A	)

													if text is None:
																				return inputs
													elif audio is None:
																				return encodings
													else:
																				A_			    =		encodings["""input_ids"""]
																				return inputs






						def 				_UpperCAmelCase       (  self							:      List[str] ,  *lowerCAmelCase							:      int ,  **lowerCAmelCase							:      Any	):
													return self.tokenizer.batch_decode(*_A ,  **_A	)






						def 				_UpperCAmelCase       (  self							:      int ,  *lowerCAmelCase							:      Optional[int] ,  **lowerCAmelCase							:      Any	):
													return self.tokenizer.decode(*_A ,  **_A	)






						@contextmanager
						def 				_UpperCAmelCase       (  self							:      Any	):
													warnings.warn(
													    "`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your "
													    "labels by using the argument `text` of the regular `__call__` method (either in the same call as "
													    "your audio inputs, or in a separate call."	)
													A_			    =		True
													A_			    =		self.tokenizer
													yield
													A_			    =		self.feature_extractor
													A_			    =		False












"""simple docstring"""


import os

def      UpperCamelCase							():
						UpperCamelCase				:		Union[str, Any]				   =			os.path.join(os.path.dirname(SCREAMING_SNAKE_CASE     )							,     """num.txt"""     )
						with open(SCREAMING_SNAKE_CASE     ) as file_hand:
												return str(sum(int(SCREAMING_SNAKE_CASE     ) for line in file_hand     )     )[:10]


if __name__ == "__main__":
		print(solution())



