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 793 B

1234567891011121314151617181920212223242526272829303132
  1. using LLama;
  2. using LLama.Examples;
  3. using LLama.Types;
  4. int choice = 0;
  5. if(choice == 0)
  6. {
  7. ChatSession chat = new(@"<Your model file path>", @"<Your prompt file path>", 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(@"<Your src model file path>",
  24. @"<Your dst model file path>", "q4_1");
  25. }
  26. else if (choice == 4) // quantization
  27. {
  28. GetEmbeddings em = new GetEmbeddings(@"<Your model file path>");
  29. em.Run("Hello, what is python?");
  30. }

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