

'''simple docstring'''


# 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.auto import AutoModelForSeqaSeqLM, AutoTokenizer
from .base import PipelineTool



class 					lowercase						(  a_ ):
							_lowerCamelCase		:      int=   "philschmid/bart-large-cnn-samsum"
							_lowerCamelCase		:      str=   (
							    "This is a tool that summarizes an English text. It takes an input `text` containing the text to summarize, "
							    "and returns a summary of the text."
							)
							_lowerCamelCase		:      List[Any]=   "summarizer"
							_lowerCamelCase		:      Dict=   AutoTokenizer
							_lowerCamelCase		:      List[str]=   AutoModelForSeqaSeqLM

							_lowerCamelCase		:      int=   ["text"]
							_lowerCamelCase		:      List[str]=   ["text"]


							def 						_snake_case							(			self    ,			_snake_case)							->				Optional[int]:
								return self.pre_processor(_snake_case    ,			return_tensors='pt'    ,			truncation=_snake_case)


							def 						_snake_case							(			self    ,			_snake_case)							->				int:
								return self.model.generate(**_snake_case)[0]





							def 						_snake_case							(			self    ,			_snake_case)							->				Optional[Any]:
								return self.pre_processor.decode(_snake_case    ,			skip_special_tokens=_snake_case    ,			clean_up_tokenization_spaces=_snake_case)









'''simple docstring'''


import qiskit







def 						SCREAMING_SNAKE_CASE(  UpperCamelCase   ,UpperCamelCase  )    ->    qiskit.result.counts.Counts:
	UpperCAmelCase_		:      Tuple       	=					qiskit.Aer.get_backend('aer_simulator'  )

	UpperCAmelCase_		:      List[str]       	=					qiskit.QuantumCircuit(4   ,2  )
	# encode inputs in qubits 0 and 1
	if bita == 1:
		qc_ha.x(0  )
	if bita == 1:
		qc_ha.x(1  )
	qc_ha.barrier()

	# use cnots to write XOR of the inputs on qubit2
	qc_ha.cx(0   ,2  )
	qc_ha.cx(1   ,2  )

	# use ccx / toffoli gate to write AND of the inputs on qubit3
	qc_ha.ccx(0   ,1   ,3  )
	qc_ha.barrier()

	# extract outputs
	qc_ha.measure(2   ,0  )  # extract XOR value
	qc_ha.measure(3   ,1  )  # extract AND value

	# Execute the circuit on the qasm simulator
	UpperCAmelCase_		:      List[str]       	=					qiskit.execute(UpperCamelCase   ,UpperCamelCase   ,shots=1_0_0_0  )

	# Return the histogram data of the results of the experiment
	return job.result().get_counts(UpperCamelCase  )


if __name__ == "__main__":
						lowerCAmelCase__										= half_adder(1, 1)
						print(F'Half Adder Output Qubit Counts: {counts}')






