This class is the parameters parser for class Llama2Device. More...
Inheritance diagram for Llama2Device_ParamsParser:Classes | |
| struct | parser_version_type |
Public Member Functions | |
| Llama2Device_ParamsParser () | |
| ~Llama2Device_ParamsParser () override=default | |
| bool | parseParams (const yarp::os::Searchable &config) override |
| Parse the DeviceDriver parameters. | |
| std::string | getDeviceClassName () const override |
| Get the name of the DeviceDriver class. | |
| std::string | getDeviceName () const override |
| Get the name of the device (i.e. | |
| std::string | getDocumentationOfDeviceParams () const override |
| Get the documentation of the DeviceDriver's parameters. | |
| std::vector< std::string > | getListOfParams () const override |
| Return a list of all params used by the device. | |
| bool | getParamValue (const std::string ¶mName, std::string ¶mValue) const override |
| Return the value (represented as a string) of the requested parameter. | |
| std::string | getConfiguration () const override |
| Return the configuration of the device. | |
Public Member Functions inherited from yarp::dev::IDeviceDriverParams | |
| virtual | ~IDeviceDriverParams () |
Public Attributes | |
| const std::string | m_device_classname = {"Llama2Device"} |
| const std::string | m_device_name = {"yarp_llama2Device"} |
| bool | m_parser_is_strict = false |
| const parser_version_type | m_parser_version = {} |
| std::string | m_provided_configuration |
| const std::string | m_model_context_defaultValue = {""} |
| const std::string | m_model_name_defaultValue = {""} |
| const std::string | m_npredict_defaultValue = {"128"} |
| const std::string | m_ngl_defaultValue = {"50"} |
| const std::string | m_offload_gpu_defaultValue = {"true"} |
| const std::string | m_context_defaultValue = {"4096"} |
| const std::string | m_prompt_file_defaultValue = {""} |
| const std::string | m_prompt_context_defaultValue = {""} |
| std::string | m_model_context = {} |
| std::string | m_model_name = {} |
| int | m_npredict = {128} |
| int | m_ngl = {50} |
| bool | m_offload_gpu = {true} |
| int | m_context = {4096} |
| std::string | m_prompt_file = {} |
| std::string | m_prompt_context = {} |
This class is the parameters parser for class Llama2Device.
These are the used parameters:
| Group name | Parameter name | Type | Units | Default Value | Required | Description | Notes |
|---|---|---|---|---|---|---|---|
| - | model_context | string | - | - | 0 | context of Llama2 model | Here are additional notes |
| - | model_name | string | - | - | 1 | name of Llama2 model | Here are additional notes |
| - | npredict | int | - | 128 | 0 | number of tokens generated by the model | Here are additional notes |
| - | ngl | int | - | 50 | 0 | number of layers to offload to the gpu | Here are additional notes |
| - | offload_gpu | bool | - | true | 0 | bool value to offload computations to gpu (default = true) | Here are additional notes |
| - | context | int | - | 4096 | 0 | context size (use ctx_size = 0 to load context size from the model) | Here are additional notes |
| - | prompt_file | string | - | - | 0 | The file containing the prompt for the LLM | - |
| - | prompt_context | string | - | - | 0 | The yarp context from which the prompt file should be loaded | - |
The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):
Definition at line 48 of file Llama2Device_ParamsParser.h.
| Llama2Device_ParamsParser::Llama2Device_ParamsParser | ( | ) |
Definition at line 23 of file Llama2Device_ParamsParser.cpp.
|
overridedefault |
|
overridevirtual |
Return the configuration of the device.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 93 of file Llama2Device_ParamsParser.cpp.
|
inlineoverridevirtual |
Get the name of the DeviceDriver class.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 86 of file Llama2Device_ParamsParser.h.
|
inlineoverridevirtual |
Get the name of the device (i.e.
the plugin name).
Implements yarp::dev::IDeviceDriverParams.
Definition at line 87 of file Llama2Device_ParamsParser.h.
|
overridevirtual |
Get the documentation of the DeviceDriver's parameters.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 256 of file Llama2Device_ParamsParser.cpp.
|
overridevirtual |
Return a list of all params used by the device.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 28 of file Llama2Device_ParamsParser.cpp.
|
overridevirtual |
Return the value (represented as a string) of the requested parameter.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 43 of file Llama2Device_ParamsParser.cpp.
|
overridevirtual |
Parse the DeviceDriver parameters.
Implements yarp::dev::IDeviceDriverParams.
Definition at line 103 of file Llama2Device_ParamsParser.cpp.
| int Llama2Device_ParamsParser::m_context = {4096} |
Definition at line 81 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_context_defaultValue = {"4096"} |
Definition at line 72 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_device_classname = {"Llama2Device"} |
Definition at line 55 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_device_name = {"yarp_llama2Device"} |
Definition at line 56 of file Llama2Device_ParamsParser.h.
| std::string Llama2Device_ParamsParser::m_model_context = {} |
Definition at line 76 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_model_context_defaultValue = {""} |
Definition at line 67 of file Llama2Device_ParamsParser.h.
| std::string Llama2Device_ParamsParser::m_model_name = {} |
Definition at line 77 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_model_name_defaultValue = {""} |
Definition at line 68 of file Llama2Device_ParamsParser.h.
| int Llama2Device_ParamsParser::m_ngl = {50} |
Definition at line 79 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_ngl_defaultValue = {"50"} |
Definition at line 70 of file Llama2Device_ParamsParser.h.
| int Llama2Device_ParamsParser::m_npredict = {128} |
Definition at line 78 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_npredict_defaultValue = {"128"} |
Definition at line 69 of file Llama2Device_ParamsParser.h.
| bool Llama2Device_ParamsParser::m_offload_gpu = {true} |
Definition at line 80 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_offload_gpu_defaultValue = {"true"} |
Definition at line 71 of file Llama2Device_ParamsParser.h.
| bool Llama2Device_ParamsParser::m_parser_is_strict = false |
Definition at line 57 of file Llama2Device_ParamsParser.h.
| const parser_version_type Llama2Device_ParamsParser::m_parser_version = {} |
Definition at line 63 of file Llama2Device_ParamsParser.h.
| std::string Llama2Device_ParamsParser::m_prompt_context = {} |
Definition at line 83 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_prompt_context_defaultValue = {""} |
Definition at line 74 of file Llama2Device_ParamsParser.h.
| std::string Llama2Device_ParamsParser::m_prompt_file = {} |
Definition at line 82 of file Llama2Device_ParamsParser.h.
| const std::string Llama2Device_ParamsParser::m_prompt_file_defaultValue = {""} |
Definition at line 73 of file Llama2Device_ParamsParser.h.
| std::string Llama2Device_ParamsParser::m_provided_configuration |
Definition at line 65 of file Llama2Device_ParamsParser.h.