Browse Source

Fixed demos

tags/v0.5.1
Martin Evans 2 years ago
parent
commit
a45d9089e1
6 changed files with 6 additions and 6 deletions
  1. +1
    -1
      LLama.Examples/NewVersion/ChatSessionStripRoleName.cs
  2. +1
    -1
      LLama.Examples/NewVersion/ChatSessionWithRoleName.cs
  3. +1
    -1
      LLama.Examples/NewVersion/InstructModeExecute.cs
  4. +1
    -1
      LLama.Examples/NewVersion/InteractiveModeExecute.cs
  5. +1
    -1
      LLama.Examples/NewVersion/LoadAndSaveSession.cs
  6. +1
    -1
      LLama.Examples/NewVersion/LoadAndSaveState.cs

+ 1
- 1
LLama.Examples/NewVersion/ChatSessionStripRoleName.cs View File

@@ -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));


+ 1
- 1
LLama.Examples/NewVersion/ChatSessionWithRoleName.cs View File

@@ -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);


+ 1
- 1
LLama.Examples/NewVersion/InstructModeExecute.cs View File

@@ -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;


+ 1
- 1
LLama.Examples/NewVersion/InteractiveModeExecute.cs View File

@@ -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;


+ 1
- 1
LLama.Examples/NewVersion/LoadAndSaveSession.cs View File

@@ -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);


+ 1
- 1
LLama.Examples/NewVersion/LoadAndSaveState.cs View File

@@ -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;


Loading…
Cancel
Save