






# 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   (						lowercase_	):







     '''simple docstring'''
     SCREAMING_SNAKE_CASE     =					"philschmid/bart-large-cnn-samsum"
     SCREAMING_SNAKE_CASE     =					(
         "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."
     )
     SCREAMING_SNAKE_CASE     =					"summarizer"
     SCREAMING_SNAKE_CASE     =					AutoTokenizer
     SCREAMING_SNAKE_CASE     =					AutoModelForSeqaSeqLM

     SCREAMING_SNAKE_CASE     =					["text"]
     SCREAMING_SNAKE_CASE     =					["text"]




     def 		lowerCAmelCase_  (					self							:      Dict			,						UpperCamelCase_							:      str					):


         """simple docstring"""



         return self.pre_processor(UpperCamelCase_			,						return_tensors="""pt"""			,						truncation=UpperCamelCase_					)




     def 		lowerCAmelCase_  (					self							:      int			,						UpperCamelCase_							:      Optional[Any]					):


         """simple docstring"""



         return self.model.generate(**UpperCamelCase_					)[0]





     def 		lowerCAmelCase_  (					self							:      List[str]			,						UpperCamelCase_							:      Dict					):


         """simple docstring"""



         return self.pre_processor.decode(UpperCamelCase_			,						skip_special_tokens=UpperCamelCase_			,						clean_up_tokenization_spaces=UpperCamelCase_					)












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__a   :							Any						= {
    "configuration_time_series_transformer": [
        "TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "TimeSeriesTransformerConfig",
    ],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __a   :							Dict						= [
      "TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
      "TimeSeriesTransformerForPrediction",
      "TimeSeriesTransformerModel",
      "TimeSeriesTransformerPreTrainedModel",
  ]


if TYPE_CHECKING:
  from .configuration_time_series_transformer import (
      TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
      TimeSeriesTransformerConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_time_series_transformer import (
        TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        TimeSeriesTransformerForPrediction,
        TimeSeriesTransformerModel,
        TimeSeriesTransformerPreTrainedModel,
    )

else:
  import sys

  __a   :							str						= _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




