class_docstr: Parameters for text generation.
  
  Args:
      do_sample (`bool`, *optional*):
          Activate logits sampling. Defaults to False.
      max_new_tokens (`int`, *optional*):
          Maximum number of generated tokens. Defaults to 20.
      repetition_penalty (`Optional[float]`, *optional*):
          The parameter for repetition penalty. A value of 1.0 means no penalty. See [this paper](https://arxiv.org/pdf/1909.05858.pdf)
          for more details. Defaults to None.
      return_full_text (`bool`, *optional*):
          Whether to prepend the prompt to the generated text. Defaults to False.
      stop (`List[str]`, *optional*):
          Stop generating tokens if a member of `stop_sequences` is generated. Defaults to an empty list.
      seed (`Optional[int]`, *optional*):
          Random sampling seed. Defaults to None.
      temperature (`Optional[float]`, *optional*):
          The value used to modulate the logits distribution. Defaults to None.
      top_k (`Optional[int]`, *optional*):
          The number of highest probability vocabulary tokens to keep for top-k-filtering. Defaults to None.
      top_p (`Optional[float]`, *optional*):
          If set to a value less than 1, only the smallest set of most probable tokens with probabilities that add up
          to `top_p` or higher are kept for generation. Defaults to None.
      truncate (`Optional[int]`, *optional*):
          Truncate input tokens to the given size. Defaults to None.
      typical_p (`Optional[float]`, *optional*):
          Typical Decoding mass. See [Typical Decoding for Natural Language Generation](https://arxiv.org/abs/2202.00666)
          for more information. Defaults to None.
      best_of (`Optional[int]`, *optional*):
          Generate `best_of` sequences and return the one with the highest token logprobs. Defaults to None.
      watermark (`bool`, *optional*):
          Watermarking with [A Watermark for Large Language Models](https://arxiv.org/abs/2301.10226). Defaults to False.
      details (`bool`, *optional*):
          Get generation details. Defaults to False.
      decoder_input_details (`bool`, *optional*):
          Get decoder input token logprobs and ids. Defaults to False.
class_docstr_tok: ["Parameters","for","text","generation",".","Args",":","do_sample","(","`","bool","`",",","*","optional","*",")",":","Activate","logits","sampling",".","Defaults","to","False",".","max_new_tokens","(","`","int","`",",","*","optional","*",")",":","Maximum","number","of","generated","tokens",".","Defaults","to","20.","repetition_penalty","(","`","Optional","[","float","]","`",",","*","optional","*",")",":","The","parameter","for","repetition","penalty",".","A","value","of","1.0","means","no","penalty",".","See","[","this","paper","]","(","https",":","\/\/arxiv.org\/pdf\/1909.05858.pdf",")","for","more","details",".","Defaults","to","None",".","return_full_text","(","`","bool","`",",","*","optional","*",")",":","Whether","to","prepend","the","prompt","to","the","generated","text",".","Defaults","to","False",".","stop","(","`","List","[","str","]","`",",","*","optional","*",")",":","Stop","generating","tokens","if","a","member","of","`","stop_sequences","`","is","generated",".","Defaults","to","an","empty","list",".","seed","(","`","Optional","[","int","]","`",",","*","optional","*",")",":","Random","sampling","seed",".","Defaults","to","None",".","temperature","(","`","Optional","[","float","]","`",",","*","optional","*",")",":","The","value","used","to","modulate","the","logits","distribution",".","Defaults","to","None",".","top_k","(","`","Optional","[","int","]","`",",","*","optional","*",")",":","The","number","of","highest","probability","vocabulary","tokens","to","keep","for","top-k-filtering",".","Defaults","to","None",".","top_p","(","`","Optional","[","float","]","`",",","*","optional","*",")",":","If","set","to","a","value","less","than","1",",","only","the","smallest","set","of","most","probable","tokens","with","probabilities","that","add","up","to","`","top_p","`","or","higher","are","kept","for","generation",".","Defaults","to","None",".","truncate","(","`","Optional","[","int","]","`",",","*","optional","*",")",":","Truncate","input","tokens","to","the","given","size",".","Defaults","to","None",".","typical_p","(","`","Optional","[","float","]","`",",","*","optional","*",")",":","Typical","Decoding","mass",".","See","[","Typical","Decoding","for","Natural","Language","Generation","]","(","https",":","\/\/arxiv.org\/abs\/2202.00666",")","for","more","information",".","Defaults","to","None",".","best_of","(","`","Optional","[","int","]","`",",","*","optional","*",")",":","Generate","`","best_of","`","sequences","and","return","the","one","with","the","highest","token","logprobs",".","Defaults","to","None",".","watermark","(","`","bool","`",",","*","optional","*",")",":","Watermarking","with","[","A","Watermark","for","Large","Language","Models","]","(","https",":","\/\/arxiv.org\/abs\/2301.10226",")",".","Defaults","to","False",".","details","(","`","bool","`",",","*","optional","*",")",":","Get","generation","details",".","Defaults","to","False",".","decoder_input_details","(","`","bool","`",",","*","optional","*",")",":","Get","decoder","input","token","logprobs","and","ids",".","Defaults","to","False","."]
code: def valid_top_p(cls, v):
      if v is not None and (v <= 0 or v >= 1.0):
          raise ValueError("`top_p` must be > 0.0 and < 1.0")
      return v
  
imports: import warnings
  from dataclasses import field
  from enum import Enum
  from typing import List, NoReturn, Optional
  from requests import HTTPError
  from ..utils import is_pydantic_available
label_desc: Use image node_id 6 for calling the TextGenerationParameters obj's underlying member method code with example usage: obj.valid_top_p(cls, v) and returns: v