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.

LLamaTokenData.cs 688 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. using System.Text;
  5. namespace LLama.Native
  6. {
  7. [StructLayout(LayoutKind.Sequential)]
  8. public struct LLamaTokenData
  9. {
  10. /// <summary>
  11. /// token id
  12. /// </summary>
  13. public int id;
  14. /// <summary>
  15. /// log-odds of the token
  16. /// </summary>
  17. public float logit;
  18. /// <summary>
  19. /// probability of the token
  20. /// </summary>
  21. public float p;
  22. public LLamaTokenData(int id, float logit, float p)
  23. {
  24. this.id = id;
  25. this.logit = logit;
  26. this.p = p;
  27. }
  28. }
  29. }