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.

LLamaContextTests.cs 868 B

1234567891011121314151617181920212223242526272829303132333435
  1. using LLama.Common;
  2. namespace LLama.Unittest
  3. {
  4. public class LLamaContextTests
  5. : IDisposable
  6. {
  7. private readonly LLamaWeights _weights;
  8. private readonly LLamaContext _context;
  9. public LLamaContextTests()
  10. {
  11. var @params = new ModelParams(Constants.ModelPath)
  12. {
  13. ContextSize = 768,
  14. };
  15. _weights = LLamaWeights.LoadFromFile(@params);
  16. _context = _weights.CreateContext(@params);
  17. }
  18. public void Dispose()
  19. {
  20. _weights.Dispose();
  21. _context.Dispose();
  22. }
  23. [Fact]
  24. public void CheckProperties()
  25. {
  26. Assert.Equal(768, _context.ContextSize);
  27. Assert.Equal(4096, _context.EmbeddingSize);
  28. Assert.Equal(32000, _context.VocabCount);
  29. }
  30. }
  31. }