Browse Source

Added timing to stateless test

tags/v0.7.0^2
Martin Evans 2 years ago
parent
commit
cdf20d3c7a
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      LLama.Unittest/StatelessExecutorTest.cs

+ 7
- 0
LLama.Unittest/StatelessExecutorTest.cs View File

@@ -1,3 +1,4 @@
using System.Diagnostics;
using LLama.Common;
using Xunit.Abstractions;

@@ -34,9 +35,15 @@ namespace LLama.Unittest
const string question = "Question. what is a cat?\nAnswer: ";
var @params = new InferenceParams { MaxTokens = 32, AntiPrompts = new[] { "." } };

var timer = new Stopwatch();
timer.Start();

var result1 = string.Join("", await executor.InferAsync(question, @params).ToListAsync());
var result2 = string.Join("", await executor.InferAsync(question, @params).ToListAsync());

timer.Stop();
_testOutputHelper.WriteLine($"{timer.ElapsedMilliseconds}ms");

_testOutputHelper.WriteLine(result1);
_testOutputHelper.WriteLine(result2);



Loading…
Cancel
Save