langchain.llms.nlpcloud.NLPCloud¶
class langchain.llms.nlpcloud.NLPCloud[source]¶
Bases: LLM
NLPCloud large language models.
To use, you should have the nlpcloud python package installed, and the
environment variable NLPCLOUD_API_KEY set with your API key.
Example
from langchain.llms import NLPCloud
nlpcloud = NLPCloud(model="finetuned-gpt-neox-20b")
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param bad_words: List[str] = []¶
List of tokens not allowed to be generated.
param cache: Optional[bool] = None¶
param callback_manager: Optional[BaseCallbackManager] = None¶
param callbacks: Callbacks = None¶
param gpu: bool = True¶
Whether to use a GPU or not
param lang: str = 'en'¶
Language to use (multilingual addon)
param length_no_input: bool = True¶
Whether min_length and max_length should include the length of the input.
param max_length: int = 256¶
The maximum number of tokens to generate in the completion.
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param model_name: str = 'finetuned-gpt-neox-20b'¶
Model name to use.
param nlpcloud_api_key: Optional[str] = None¶
param num_beams: int = 1¶
Number of beams for beam search.
param num_return_sequences: int = 1¶
How many completions to generate for each prompt.
param remove_end_sequence: bool = True¶
Whether or not to remove the end sequence token.