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.

QuantizeModel.cs 841 B

12345678910111213141516171819202122232425262728
  1. namespace LLama.Examples.NewVersion
  2. {
  3. public class QuantizeModel
  4. {
  5. public static Task Run()
  6. {
  7. Console.Write("Please input your original model path: ");
  8. var inputPath = Console.ReadLine();
  9. Console.Write("Please input your output model path: ");
  10. var outputPath = Console.ReadLine();
  11. Console.Write("Please input the quantize type (one of q4_0, q4_1, q5_0, q5_1, q8_0): ");
  12. var quantizeType = Console.ReadLine();
  13. if (LLamaQuantizer.Quantize(inputPath, outputPath, quantizeType))
  14. {
  15. Console.WriteLine("Quantization succeeded!");
  16. }
  17. else
  18. {
  19. Console.WriteLine("Quantization failed!");
  20. }
  21. return Task.CompletedTask;
  22. }
  23. }
  24. }