Skip to main content

model

superduperdb.ext.llamacpp.model

Source code

download_uri​

download_uri(uri,
save_path)
ParameterDescription
uriURI to download
save_pathplace to save

Download file.

LlamaCpp​

LlamaCpp(self,
identifier: str,
db: dataclasses.InitVar[typing.Optional[ForwardRef('Datalayer')]] = None,
uuid: str = <factory>,
*,
artifacts: 'dc.InitVar[t.Optional[t.Dict]]' = None,
signature: str = 'singleton',
datatype: 'EncoderArg' = None,
output_schema: 't.Optional[Schema]' = None,
flatten: 'bool' = False,
model_update_kwargs: 't.Dict' = <factory>,
predict_kwargs: 't.Dict' = <factory>,
compute_kwargs: 't.Dict' = <factory>,
validation: 't.Optional[Validation]' = None,
metric_values: 't.Dict' = <factory>,
prompt: str = '{input}',
prompt_func: Optional[Callable] = None,
max_batch_size: Optional[int] = 4,
model_name_or_path: str = 'facebook/opt-125m',
model_kwargs: Dict = <factory>,
download_dir: str = '.llama_cpp') -> None
ParameterDescription
identifierIdentifier of the leaf.
dbDatalayer instance.
uuidUUID of the leaf.
artifactsA dictionary of artifacts paths and DataType objects
signatureModel signature.
datatypeDataType instance.
output_schemaOutput schema (mapping of encoders).
flattenFlatten the model outputs.
model_update_kwargsThe kwargs to use for model update.
predict_kwargsAdditional arguments to use at prediction time.
compute_kwargsKwargs used for compute backend job submit. Example (Ray backend): compute_kwargs = dict(resources=...).
validationThe validation Dataset instances to use.
metric_valuesThe metrics to evaluate on.
promptThe template to use for the prompt.
prompt_funcThe function to use for the prompt.
max_batch_sizeThe maximum batch size to use for batch generation.
model_name_or_pathpath or name of model
model_kwargsdictionary of init-kwargs
download_dirlocal caching directory

Llama.cpp connector.

LlamaCppEmbedding​

LlamaCppEmbedding(self,
identifier: str,
db: dataclasses.InitVar[typing.Optional[ForwardRef('Datalayer')]] = None,
uuid: str = <factory>,
*,
artifacts: 'dc.InitVar[t.Optional[t.Dict]]' = None,
signature: str = 'singleton',
datatype: 'EncoderArg' = None,
output_schema: 't.Optional[Schema]' = None,
flatten: 'bool' = False,
model_update_kwargs: 't.Dict' = <factory>,
predict_kwargs: 't.Dict' = <factory>,
compute_kwargs: 't.Dict' = <factory>,
validation: 't.Optional[Validation]' = None,
metric_values: 't.Dict' = <factory>,
prompt: str = '{input}',
prompt_func: Optional[Callable] = None,
max_batch_size: Optional[int] = 4,
model_name_or_path: str = 'facebook/opt-125m',
model_kwargs: Dict = <factory>,
download_dir: str = '.llama_cpp') -> None
ParameterDescription
identifierIdentifier of the leaf.
dbDatalayer instance.
uuidUUID of the leaf.
artifactsA dictionary of artifacts paths and DataType objects
signatureModel signature.
datatypeDataType instance.
output_schemaOutput schema (mapping of encoders).
flattenFlatten the model outputs.
model_update_kwargsThe kwargs to use for model update.
predict_kwargsAdditional arguments to use at prediction time.
compute_kwargsKwargs used for compute backend job submit. Example (Ray backend): compute_kwargs = dict(resources=...).
validationThe validation Dataset instances to use.
metric_valuesThe metrics to evaluate on.
promptThe template to use for the prompt.
prompt_funcThe function to use for the prompt.
max_batch_sizeThe maximum batch size to use for batch generation.
model_name_or_pathpath or name of model
model_kwargsdictionary of init-kwargs
download_dirlocal caching directory

Llama.cpp connector for embeddings.