langchain.llms.ctransformers.CTransformers¶
class langchain.llms.ctransformers.CTransformers[source]¶
Bases: LLM
C Transformers LLM models.
To use, you should have the ctransformers python package installed.
See https://github.com/marella/ctransformers
Example
from langchain.llms import CTransformers
llm = CTransformers(model="/path/to/ggml-gpt-2.bin", model_type="gpt2")
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 cache: Optional[bool] = None¶
param callback_manager: Optional[BaseCallbackManager] = None¶
param callbacks: Callbacks = None¶
param config: Optional[Dict[str, Any]] = None¶
The config parameters.
See https://github.com/marella/ctransformers#config
param lib: Optional[str] = None¶
The path to a shared library or one of avx2, avx, basic.
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param model: str [Required]¶
The path to a model file or directory or the name of a Hugging Face Hub
model repo.
param model_file: Optional[str] = None¶
The name of the model file in repo or directory.
param model_type: Optional[str] = None¶
The model type.
param tags: Optional[List[str]] = None¶
Tags to add to the run trace.
param verbose: bool [Optional]¶
Whether to print out response text.