Skip to content

Commit b8d3fa1

Browse files
authored
Merge pull request #159 from martindevans/removed_generate_result
Removed `GenerateResult`
2 parents e074cd3 + 4f7b6ff commit b8d3fa1

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

LLama/LLamaContext.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,12 +482,6 @@ public int Eval(ReadOnlySpan<llama_token> tokens, llama_token pastTokensCount)
482482
}
483483
#endregion
484484

485-
internal IEnumerable<string> GenerateResult(IEnumerable<llama_token> ids)
486-
{
487-
foreach(var id in ids)
488-
yield return _ctx.TokenToString(id, _encoding);
489-
}
490-
491485
/// <summary>
492486
/// Convert a token into a string
493487
/// </summary>

LLama/LLamaExecutorBase.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,8 @@ public virtual IEnumerable<string> Infer(string text, IInferenceParams? inferenc
288288

289289
if (args.ReturnValue)
290290
{
291-
foreach (var item in Context.GenerateResult(_embeds))
292-
{
293-
yield return item;
294-
}
291+
foreach (var id in _embeds)
292+
yield return Context.TokenToString(id);
295293
}
296294

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

0 commit comments

Comments
 (0)