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.

Program.cs 794 B

2 years ago
123456789101112131415161718192021222324252627
  1. using LLama;
  2. using LLama.Examples;
  3. using LLama.Types;
  4. int choice = 3;
  5. if(choice == 0)
  6. {
  7. ChatSession chat = new(@"C:\Users\haipi\Source\repos\ggml-model-q4_0.bin", @"C:\Users\haipi\Source\repos\SciSharp\LLamaSharp\LLama.Examples\Assets\chat-with-bob.txt", new string[] { "User:" });
  8. chat.Run();
  9. }
  10. else if(choice == 1)
  11. {
  12. ChatWithLLamaModel chat = new(@"<Your model file path>", "<Your prompt file path>", new string[] { "User:" });
  13. chat.Run();
  14. }
  15. else if(choice == 2)
  16. {
  17. ChatWithLLamaModelV1 chat = new(@"<Your model file path>");
  18. chat.Run();
  19. }
  20. else if (choice == 3) // quantization
  21. {
  22. Quantize q = new Quantize();
  23. q.Run(@"D:\development\llama\weights\LLaMA\7B\ggml-model-f16.bin",
  24. @"D:\development\llama\weights\LLaMA\7B\ggml-model-q4_1.bin", "q4_1");
  25. }

C#/.NET上易用的LLM高性能推理框架,支持LLaMA和LLaVA系列模型。