You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

BatchedBench.cs 744 B

2 years ago
12345678910111213141516171819202122232425
  1. using LLama.Common;
  2. using LLama.Native;
  3. namespace LLama.Examples.NewVersion;
  4. public class BatchedBench
  5. {
  6. public static async Task Run()
  7. {
  8. Console.Write("Please input your model path: ");
  9. //todo:var modelPath = Console.ReadLine();
  10. var modelPath = @"C:\Users\Martin\Documents\Python\oobabooga_windows\text-generation-webui\models\llama-2-7b-chat.Q5_K_M.gguf";
  11. var parameters = new ModelParams(modelPath);
  12. using var model = LLamaWeights.LoadFromFile(parameters);
  13. parameters.ContextSize = (uint)model.ContextSize;
  14. using var context = model.CreateContext(parameters);
  15. var n_kv_max = 1024;
  16. using var batch = LLamaBatchSafeHandle.Create(n_kv_max, 0, 1);
  17. }
  18. }