Replies: 1 comment 3 replies
-
A simplified/higher level wrapper around llama.dll is basically the entire point of this project! For example here's all of the code required to load a set of model weights and to generate a response to a prompt (taken from this example). // Load model
var parameters = new ModelParams("the/path/to/your/model.gguf");
using var model = LLamaWeights.LoadFromFile(parameters);
// Create "executor"
var ex = new StatelessExecutor(model, parameters);
// Setup some parameters for exactly how you want to use the model
var inferenceParams = new InferenceParams() { Temperature = 0.6f, MaxTokens = 50 };
// What's the input
var input = "cats are cute because";
// Generate the output
await foreach (var text in ex.InferAsync(input, inferenceParams))
{
Console.Write(text);
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Llama.dll that can be downloaded from llama.cpp repo is suitable mostly for programming languages that have abilities to work with rather difficult (for novice coder) concepts like pointers, structures etc. Does anybody know any simplified implementation of llama.dll? For example, it would be wonderful if it will be possible to work with this dll in such way:
CONSOLE
Dim LLama_DLL as Integer
Load "llama.dll" as LLama_DLL
Call function Load_Local_Gguf ("Llama-2-7b-q8.0.gguf") from LLama_DLL
Call function Set_Context_Size_For_Loaded_Gguf (4096) from LLama_DLL
Dim Answer$ As String
Dim Question$ As String
Label #Begin
Input Question$
Answer$ = Call function SentPromptToLoadedGguf (Question$) from LLama_DLL
Print Answer$
Goto #Begin
Beta Was this translation helpful? Give feedback.
All reactions