Browse Source

Removed `GenerateResult` method that was only used in one place

tags/v0.6.0
Martin Evans 2 years ago
parent
commit
4f7b6ffdcc
2 changed files with 2 additions and 10 deletions
  1. +0
    -6
      LLama/LLamaContext.cs
  2. +2
    -4
      LLama/LLamaExecutorBase.cs

+ 0
- 6
LLama/LLamaContext.cs View File

@@ -482,12 +482,6 @@ namespace LLama
}
#endregion

internal IEnumerable<string> GenerateResult(IEnumerable<llama_token> ids)
{
foreach(var id in ids)
yield return _ctx.TokenToString(id, _encoding);
}

/// <summary>
/// Convert a token into a string
/// </summary>


+ 2
- 4
LLama/LLamaExecutorBase.cs View File

@@ -288,10 +288,8 @@ namespace LLama

if (args.ReturnValue)
{
foreach (var item in Context.GenerateResult(_embeds))
{
yield return item;
}
foreach (var id in _embeds)
yield return Context.TokenToString(id);
}

var breakGeneration = PostProcess(inferenceParams, args, out var extraOutputs);


Loading…
Cancel
Save