From 4d741d24f24aacbbfbe265c00fd600506a7e6cdb Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Tue, 8 Aug 2023 15:57:08 +0100 Subject: [PATCH] Marked old `LLamaContext` constructor obsolete --- LLama/LLamaContext.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/LLama/LLamaContext.cs b/LLama/LLamaContext.cs index f0817f8f..4516517d 100644 --- a/LLama/LLamaContext.cs +++ b/LLama/LLamaContext.cs @@ -63,6 +63,7 @@ namespace LLama /// Model params. /// Encoding to deal with text input. /// The logger. + [Obsolete("Use the LLamaWeights.CreateContext instead")] public LLamaContext(IModelParams @params, string encoding = "UTF-8", ILLamaLogger? logger = null) { Params = @params; @@ -83,6 +84,14 @@ namespace LLama _ctx = nativeContext; } + /// + /// Create a new LLamaContext for the given LLamaWeights + /// + /// + /// + /// + /// + /// public LLamaContext(LLamaWeights model, IModelParams @params, Encoding encoding, ILLamaLogger? logger = null) { if (model.NativeHandle.IsClosed)