Llama.cpp C++-to-Csharp wrapper from testedlines.com: C++ docs 1.0.1
Llama.cpp C++-to-Csharp wrapper is a minor extension to Llama.cpp tag b3490 codebase modified a bit by testedlines allowing it to be compiled for and called from Styled Lines Csharp unity asset store package.
|
Provides an interface for asynchronous inference operations on a model, such as GPT. More...
#include <lib.h>
Public Member Functions | |
AsyncLlamaInfrence () | |
Default constructor for the AsyncLlamaInfrence class. | |
void | ClearAllTasks () |
int | GenerateAsync (const std::string &prompt) |
Asynchronously generates output based on the provided prompt. | |
std::string | GetGenerationResults (int task_id) |
Retrieves the generated text associated with a task ID. | |
bool | GetSetupResults (int task_id) |
Retrieves the result of the setup operation associated with a task ID. | |
bool | IsGenerationReady (int task_id) |
int | SetupAsync (const LoggingContext *logging, const gpt_params &cfg_params) |
Asynchronously sets up the model with specified configuration LLama.cpp parameters. | |
~AsyncLlamaInfrence () | |
Destructor for the AsyncLlamaInfrence class. | |
Data Fields | |
LlamaAsyncImpl * | pImpl |
Pointer to the implementation class, used by the PImpl idiom. | |
Provides an interface for asynchronous inference operations on a model, such as GPT.
The AsyncLlamaInfrence class provides methods for asynchronously setting up the model with configuration parameters, generating predictions, and retrieving results. This class uses the PImpl (Pointer to Implementation) idiom to hide implementation details and manage asynchronous tasks safely.
AsyncLlamaInfrence::AsyncLlamaInfrence | ( | ) |
Default constructor for the AsyncLlamaInfrence class.
Initializes an instance of the AsyncLlamaInfrence class, setting up internal structures and preparing the environment for asynchronous operations. The implementation details are hidden within the PImpl structure, ensuring that the public interface remains clean and simple.
AsyncLlamaInfrence::~AsyncLlamaInfrence | ( | ) |
Destructor for the AsyncLlamaInfrence class.
Responsible for cleaning up resources used by the instance, including terminating any ongoing asynchronous tasks and releasing memory allocated for the implementation details. This ensures that no resources are leaked and that the application remains stable and efficient.
void AsyncLlamaInfrence::ClearAllTasks | ( | ) |
int AsyncLlamaInfrence::GenerateAsync | ( | const std::string & | prompt | ) |
Asynchronously generates output based on the provided prompt.
prompt | The input prompt to the model. |
std::string AsyncLlamaInfrence::GetGenerationResults | ( | int | task_id | ) |
Retrieves the generated text associated with a task ID.
task_id | The task ID of the generation operation. |
bool AsyncLlamaInfrence::GetSetupResults | ( | int | task_id | ) |
Retrieves the result of the setup operation associated with a task ID.
task_id | The task ID of the setup operation. |
bool AsyncLlamaInfrence::IsGenerationReady | ( | int | task_id | ) |
int AsyncLlamaInfrence::SetupAsync | ( | const LoggingContext * | logging, |
const gpt_params & | cfg_params ) |
Asynchronously sets up the model with specified configuration LLama.cpp parameters.
cfg_params | A reference to a gpt_params struct containing the setup parameters for the model. |
LlamaAsyncImpl* AsyncLlamaInfrence::pImpl |
Pointer to the implementation class, used by the PImpl idiom.