






import socket

def    SCREAMING_SNAKE_CASE_							(							)		->			List[Any]:






	"""simple docstring"""



	UpperCamelCase     :Tuple          =	socket.socket(socket.AF_INET	,			socket.SOCK_STREAM					)
	UpperCamelCase     :Union[str, Any]          =	socket.gethostname()
	UpperCamelCase     :Optional[int]          =	1_2312

	sock.connect((host, port)					)
	sock.send(B"""Hello server!"""					)

	with open("""Received_file"""	,			"""wb"""					) as out_file:
		print("""File opened"""					)
		print("""Receiving data..."""					)
		while True:
			UpperCamelCase     :List[Any]          =	sock.recv(1024					)
			if not data:
				break
			out_file.write(__magic_name__					)

	print("""Successfully received the file"""					)
	sock.close()
	print("""Connection closed"""					)


if __name__ == "__main__":
	main()








# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ..models.whisper import WhisperForConditionalGeneration, WhisperProcessor
from .base import PipelineTool

class     _SCREAMING_SNAKE_CASE       (			_a      ):
	snake_case__							:     Any     	=  """openai/whisper-base"""
	snake_case__							:     Optional[int]     	=  (
	    """This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the """
	    """transcribed text."""
	)
	snake_case__							:     Any     	=  """transcriber"""
	snake_case__							:     Optional[int]     	=  WhisperProcessor
	snake_case__							:     str     	=  WhisperForConditionalGeneration

	snake_case__							:     Optional[Any]     	=  ["""audio"""]
	snake_case__							:     Any     	=  ["""text"""]





	def 						_A (		self				:					str ,  __lowerCamelCase				:					Dict	):
		return self.pre_processor(__lowerCamelCase ,  return_tensors="""pt"""	).input_features





	def 						_A (		self				:					Dict ,  __lowerCamelCase				:					List[Any]	):
		return self.model.generate(inputs=__lowerCamelCase	)





	def 						_A (		self				:					Any ,  __lowerCamelCase				:					Optional[Any]	):
		return self.pre_processor.batch_decode(__lowerCamelCase ,  skip_special_tokens=__lowerCamelCase	)[0]
