Skip to content

Commit

Permalink
Added timing to stateless test
Browse files Browse the repository at this point in the history
  • Loading branch information
martindevans committed Oct 28, 2023
1 parent 7e3cde4 commit cdf20d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions LLama.Unittest/StatelessExecutorTest.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics;
using LLama.Common;
using Xunit.Abstractions;

Expand Down Expand Up @@ -34,9 +35,15 @@ public async Task Stateless()
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);

Expand Down

0 comments on commit cdf20d3

Please sign in to comment.