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.md 844 B

12345678910111213141516171819202122232425262728293031
  1. # Quantize model
  2. ```cs
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading;
  8. using System.Threading.Tasks;
  9. public class QuantizeModel
  10. {
  11. public static void Run()
  12. {
  13. Console.Write("Please input your original model path: ");
  14. var inputPath = Console.ReadLine();
  15. Console.Write("Please input your output model path: ");
  16. var outputPath = Console.ReadLine();
  17. Console.Write("Please input the quantize type (one of q4_0, q4_1, q5_0, q5_1, q8_0): ");
  18. var quantizeType = Console.ReadLine();
  19. if (LLamaQuantizer.Quantize(inputPath, outputPath, quantizeType))
  20. {
  21. Console.WriteLine("Quantization succeed!");
  22. }
  23. else
  24. {
  25. Console.WriteLine("Quantization failed!");
  26. }
  27. }
  28. }
  29. ```