| @@ -13,7 +13,7 @@ namespace LLama.Examples.NewVersion | |||||
| var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | ||||
| using var model = LLamaWeights.LoadFromFile(parameters); | using var model = LLamaWeights.LoadFromFile(parameters); | ||||
| using var context = model.CreateContext(parameters, Encoding.UTF8); | |||||
| using var context = model.CreateContext(parameters); | |||||
| var executor = new InteractiveExecutor(context); | var executor = new InteractiveExecutor(context); | ||||
| var session = new ChatSession(executor).WithOutputTransform(new LLamaTransforms.KeywordTextOutputStreamTransform(new string[] { "User:", "Bob:" }, redundancyLength: 8)); | var session = new ChatSession(executor).WithOutputTransform(new LLamaTransforms.KeywordTextOutputStreamTransform(new string[] { "User:", "Bob:" }, redundancyLength: 8)); | ||||
| @@ -13,7 +13,7 @@ namespace LLama.Examples.NewVersion | |||||
| var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | ||||
| using var model = LLamaWeights.LoadFromFile(parameters); | using var model = LLamaWeights.LoadFromFile(parameters); | ||||
| using var context = model.CreateContext(parameters, Encoding.UTF8); | |||||
| using var context = model.CreateContext(parameters); | |||||
| var executor = new InteractiveExecutor(context); | var executor = new InteractiveExecutor(context); | ||||
| var session = new ChatSession(executor); | var session = new ChatSession(executor); | ||||
| @@ -13,7 +13,7 @@ namespace LLama.Examples.NewVersion | |||||
| var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | ||||
| using var model = LLamaWeights.LoadFromFile(parameters); | using var model = LLamaWeights.LoadFromFile(parameters); | ||||
| using var context = model.CreateContext(parameters, Encoding.UTF8); | |||||
| using var context = model.CreateContext(parameters); | |||||
| var executor = new InstructExecutor(context); | var executor = new InstructExecutor(context); | ||||
| Console.ForegroundColor = ConsoleColor.Yellow; | Console.ForegroundColor = ConsoleColor.Yellow; | ||||
| @@ -13,7 +13,7 @@ namespace LLama.Examples.NewVersion | |||||
| var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | ||||
| using var model = LLamaWeights.LoadFromFile(parameters); | using var model = LLamaWeights.LoadFromFile(parameters); | ||||
| using var context = model.CreateContext(parameters, Encoding.UTF8); | |||||
| using var context = model.CreateContext(parameters); | |||||
| var ex = new InteractiveExecutor(context); | var ex = new InteractiveExecutor(context); | ||||
| Console.ForegroundColor = ConsoleColor.Yellow; | Console.ForegroundColor = ConsoleColor.Yellow; | ||||
| @@ -13,7 +13,7 @@ namespace LLama.Examples.NewVersion | |||||
| var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | ||||
| using var model = LLamaWeights.LoadFromFile(parameters); | using var model = LLamaWeights.LoadFromFile(parameters); | ||||
| using var context = model.CreateContext(parameters, Encoding.UTF8); | |||||
| using var context = model.CreateContext(parameters); | |||||
| var ex = new InteractiveExecutor(context); | var ex = new InteractiveExecutor(context); | ||||
| var session = new ChatSession(ex); | var session = new ChatSession(ex); | ||||
| @@ -13,7 +13,7 @@ namespace LLama.Examples.NewVersion | |||||
| var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | var parameters = new ModelParams(modelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5); | ||||
| using var model = LLamaWeights.LoadFromFile(parameters); | using var model = LLamaWeights.LoadFromFile(parameters); | ||||
| using var context = model.CreateContext(parameters, Encoding.UTF8); | |||||
| using var context = model.CreateContext(parameters); | |||||
| var ex = new InteractiveExecutor(context); | var ex = new InteractiveExecutor(context); | ||||
| Console.ForegroundColor = ConsoleColor.Yellow; | Console.ForegroundColor = ConsoleColor.Yellow; | ||||