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.

llama.llamaquantizer.md 2.7 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # LLamaQuantizer
  2. Namespace: LLama
  3. The quantizer to quantize the model.
  4. ```csharp
  5. public static class LLamaQuantizer
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaQuantizer](./llama.llamaquantizer.md)
  8. ## Methods
  9. ### **Quantize(String, String, LLamaFtype, Int32, Boolean, Boolean)**
  10. Quantize the model.
  11. ```csharp
  12. public static bool Quantize(string srcFileName, string dstFilename, LLamaFtype ftype, int nthread, bool allowRequantize, bool quantizeOutputTensor)
  13. ```
  14. #### Parameters
  15. `srcFileName` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  16. The model file to be quantized.
  17. `dstFilename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  18. The path to save the quantized model.
  19. `ftype` [LLamaFtype](./llama.native.llamaftype.md)<br>
  20. The type of quantization.
  21. `nthread` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  22. Thread to be used during the quantization. By default it's the physical core number.
  23. `allowRequantize` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  24. `quantizeOutputTensor` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  25. #### Returns
  26. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  27. Whether the quantization is successful.
  28. #### Exceptions
  29. [ArgumentException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentexception)<br>
  30. ### **Quantize(String, String, String, Int32, Boolean, Boolean)**
  31. Quantize the model.
  32. ```csharp
  33. public static bool Quantize(string srcFileName, string dstFilename, string ftype, int nthread, bool allowRequantize, bool quantizeOutputTensor)
  34. ```
  35. #### Parameters
  36. `srcFileName` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  37. The model file to be quantized.
  38. `dstFilename` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  39. The path to save the quantized model.
  40. `ftype` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)<br>
  41. The type of quantization.
  42. `nthread` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  43. Thread to be used during the quantization. By default it's the physical core number.
  44. `allowRequantize` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  45. `quantizeOutputTensor` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  46. #### Returns
  47. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  48. Whether the quantization is successful.
  49. #### Exceptions
  50. [ArgumentException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentexception)<br>