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

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