Browse Source

- Added new binaries

- Fixed stateless executor out-of-context handling
 - Fixed token tests
tags/v0.6.0
Martin Evans 2 years ago
parent
commit
efb0664df0
10 changed files with 4 additions and 7 deletions
  1. +2
    -2
      LLama.Unittest/LLamaContextTests.cs
  2. +2
    -2
      LLama.Unittest/StatelessExecutorTest.cs
  3. +0
    -3
      LLama/LLamaStatelessExecutor.cs
  4. BIN
      LLama/runtimes/libllama-cuda11.dll
  5. BIN
      LLama/runtimes/libllama-cuda11.so
  6. BIN
      LLama/runtimes/libllama-cuda12.dll
  7. BIN
      LLama/runtimes/libllama-cuda12.so
  8. BIN
      LLama/runtimes/libllama.dll
  9. BIN
      LLama/runtimes/libllama.dylib
  10. BIN
      LLama/runtimes/libllama.so

+ 2
- 2
LLama.Unittest/LLamaContextTests.cs View File

@@ -37,7 +37,7 @@ namespace LLama.Unittest
{
var tokens = _context.Tokenize("The quick brown fox", true);

Assert.Equal(new[] { 1, 450, 4996, 17354, 1701, 29916 }, tokens);
Assert.Equal(new[] { 1, 1576, 4996, 17354, 1701, 29916 }, tokens);
}

[Fact]
@@ -45,7 +45,7 @@ namespace LLama.Unittest
{
var tokens = _context.Tokenize("The quick brown fox", false);

Assert.Equal(new[] { 450, 4996, 17354, 1701, 29916 }, tokens);
Assert.Equal(new[] { 1576, 4996, 17354, 1701, 29916 }, tokens);
}

[Fact]


+ 2
- 2
LLama.Unittest/StatelessExecutorTest.cs View File

@@ -48,13 +48,13 @@ namespace LLama.Unittest
{
var executor = new StatelessExecutor(_weights, _params);

const string question = " Question. why is a cat the best pet?\nAnswer: ";
const string question = " Question. cats or dogs?\nAnswer: ";

// The context size is set to 60. Generate more than that, forcing it to generate a coherent response
// with a modified context
var @params = new InferenceParams()
{
MaxTokens = 80,
MaxTokens = 70,
TokensKeep = question.Length,
};



+ 0
- 3
LLama/LLamaStatelessExecutor.cs View File

@@ -112,9 +112,6 @@ namespace LLama
NativeApi.llama_kv_cache_seq_shift(Context.NativeHandle, (LLamaSeqId)0, inferenceParams.TokensKeep + 1 + n_discard, n_past, -n_discard);

n_past -= n_discard;

tokens.Clear();
tokens.AddRange(lastTokens.Skip(lastTokens.Count - n_left / 2).Take(n_left / 2));
}

n_past = Context.Eval(tokens, n_past);


BIN
LLama/runtimes/libllama-cuda11.dll View File


BIN
LLama/runtimes/libllama-cuda11.so View File


BIN
LLama/runtimes/libllama-cuda12.dll View File


BIN
LLama/runtimes/libllama-cuda12.so View File


BIN
LLama/runtimes/libllama.dll View File


BIN
LLama/runtimes/libllama.dylib View File


BIN
LLama/runtimes/libllama.so View File


Loading…
Cancel
Save