class_docstr: A custom LLM class that integrates LLMs running on the ColossalCloud Platform
class_docstr_tok: ["A","custom","LLM","class","that","integrates","LLMs","running","on","the","ColossalCloud","Platform"]
docstr: Args:
      gen_config: config for generation,
          max_new_tokens: 50 by default
          top_k: (1, vocab_size) 
          top_p: (0, 1) if not None
          temperature: (0, inf) if not None 
          repetition_penalty: (1, inf) if not None
docstr_tok: ["Args",":","gen_config",":","config","for","generation",",","max_new_tokens",":","50","by","default","top_k",":","(","1",",","vocab_size",")","top_p",":","(","0",",","1",")","if","not","None","temperature",":","(","0",",","inf",")","if","not","None","repetition_penalty",":","(","1",",","inf",")","if","not","None"]
code: def __init__(self, gen_config=None, **kwargs):
      """
      Args:
          gen_config: config for generation,
              max_new_tokens: 50 by default
              top_k: (1, vocab_size)
              top_p: (0, 1) if not None
              temperature: (0, inf) if not None
              repetition_penalty: (1, inf) if not None
      """
      super(ColossalCloudLLM, self).__init__(**kwargs)
      if gen_config is None:
          self.gen_config = {"max_new_tokens": 50}
      else:
          assert (
              "max_new_tokens" in gen_config
          ), "max_new_tokens is a compulsory key in the gen config"
          self.gen_config = gen_config
  
file_path: colossalai/applications/ColossalQA/colossalqa/local/colossalcloud_llm.py
imports: import json
  from typing import Any, List, Mapping, Optional
  import requests
  from langchain.llms.base import LLM
  from langchain.utils import get_from_dict_or_env
label_desc: Use image node_id 1 to create a new ColossalCloudLLM object from inherited base classes: LLM with example: obj = ColossalCloudLLM(gen_config)