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.

LLamaTokenDataArray.cs 771 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Buffers;
  3. using System.Collections.Generic;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. namespace LLama.Native
  7. {
  8. [StructLayout(LayoutKind.Sequential)]
  9. internal struct LLamaTokenDataArray
  10. {
  11. public Memory<LLamaTokenData> data;
  12. public ulong size;
  13. [MarshalAs(UnmanagedType.I1)]
  14. public bool sorted;
  15. public LLamaTokenDataArray(LLamaTokenData[] data, ulong size, bool sorted)
  16. {
  17. this.data = data;
  18. this.size = size;
  19. this.sorted = sorted;
  20. }
  21. }
  22. [StructLayout(LayoutKind.Sequential)]
  23. internal struct LLamaTokenDataArrayNative
  24. {
  25. public IntPtr data;
  26. public ulong size;
  27. public bool sorted;
  28. }
  29. }

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