
import numpy as np

from transformers import Pipeline




def    __UpperCamelCase     (				lowerCAmelCase__							:				List[str]  ):
 __a :  List[str]						=  np.max(lowerCAmelCase__  ,   axis=-1  ,   keepdims=lowerCAmelCase__  )
 __a :  Any						=  np.exp(outputs - maxes  )
 return shifted_exp / shifted_exp.sum(axis=-1  ,   keepdims=lowerCAmelCase__  )



class 		UpperCamelCase__  (       __lowercase    ):
   def       lowerCAmelCase			(self :					Any					,				**snake_case_ :					Optional[Any]   ):
    __a :  Tuple						=  {}
    if "second_text" in kwargs:
     __a :  str						=  kwargs['''second_text''']
    return preprocess_kwargs, {}, {}
   def       lowerCAmelCase			(self :					Any					,				snake_case_ :					List[str]					,				snake_case_ :					List[Any]=None   ):
    return self.tokenizer(snake_case_					,				text_pair=snake_case_					,				return_tensors=self.framework   )
   def       lowerCAmelCase			(self :					Dict					,				snake_case_ :					Optional[int]   ):
    return self.model(**snake_case_   )







   def       lowerCAmelCase			(self :					Optional[int]					,				snake_case_ :					Union[str, Any]   ):
    __a :  List[str]						=  model_outputs.logits[0].numpy()
    __a :  Optional[Any]						=  softmax(snake_case_   )

    __a :  Optional[int]						=  np.argmax(snake_case_   )
    __a :  Optional[int]						=  self.model.config.idalabel[best_class]
    __a :  int						=  probabilities[best_class].item()
    __a :  Optional[Any]						=  logits.tolist()
    return {"label": label, "score": score, "logits": logits}


def    __UpperCamelCase     (				lowerCAmelCase__							:				str  ):
 if n_term == "":
  return []
 __a :  list						=  []
 for temp in range(int(lowerCAmelCase__  )  ):
  series.append(f"1/{temp + 1}" if series else '''1'''  )
 return series


if __name__ == "__main__":
      lowercase__       =input('Enter the last number (nth term) of the Harmonic Series')
      print('Formula of Harmonic Series => 1+1/2+1/3 ..... 1/n')
      print(harmonic_series(nth_term))
