diff --git a/LLama.Examples/Examples/BatchedExecutorFork.cs b/LLama.Examples/Examples/BatchedExecutorFork.cs index 2c401822..d740119f 100644 --- a/LLama.Examples/Examples/BatchedExecutorFork.cs +++ b/LLama.Examples/Examples/BatchedExecutorFork.cs @@ -32,7 +32,7 @@ public class BatchedExecutorFork // Evaluate the initial prompt to create one conversation using var start = executor.Create(); - start.Prompt(prompt); + start.Prompt(executor.Context.Tokenize(prompt)); await executor.Infer(); // Create the root node of the tree diff --git a/LLama.Examples/Examples/BatchedExecutorGuidance.cs b/LLama.Examples/Examples/BatchedExecutorGuidance.cs index b006c88b..fedfe4e7 100644 --- a/LLama.Examples/Examples/BatchedExecutorGuidance.cs +++ b/LLama.Examples/Examples/BatchedExecutorGuidance.cs @@ -34,9 +34,9 @@ public class BatchedExecutorGuidance // Load the two prompts into two conversations using var guided = executor.Create(); - guided.Prompt(positivePrompt); + guided.Prompt(executor.Context.Tokenize(positivePrompt)); using var guidance = executor.Create(); - guidance.Prompt(negativePrompt); + guidance.Prompt(executor.Context.Tokenize(negativePrompt)); // Run inference to evaluate prompts await AnsiConsole diff --git a/LLama.Examples/Examples/BatchedExecutorRewind.cs b/LLama.Examples/Examples/BatchedExecutorRewind.cs index 938b3106..aa0a1c75 100644 --- a/LLama.Examples/Examples/BatchedExecutorRewind.cs +++ b/LLama.Examples/Examples/BatchedExecutorRewind.cs @@ -33,7 +33,7 @@ public class BatchedExecutorRewind // Evaluate the initial prompt to create one conversation using var conversation = executor.Create(); - conversation.Prompt(prompt); + conversation.Prompt(executor.Context.Tokenize(prompt)); // Create the start node wrapping the conversation var node = new Node(executor.Context); diff --git a/LLama.Examples/Examples/BatchedExecutorSaveAndLoad.cs b/LLama.Examples/Examples/BatchedExecutorSaveAndLoad.cs index 48d96f73..f0b629fb 100644 --- a/LLama.Examples/Examples/BatchedExecutorSaveAndLoad.cs +++ b/LLama.Examples/Examples/BatchedExecutorSaveAndLoad.cs @@ -31,7 +31,7 @@ public class BatchedExecutorSaveAndLoad // Create a conversation var conversation = executor.Create(); - conversation.Prompt(prompt); + conversation.Prompt(executor.Context.Tokenize(prompt)); // Run inference loop var decoder = new StreamingTokenDecoder(executor.Context); diff --git a/LLama/Batched/BatchedExecutor.cs b/LLama/Batched/BatchedExecutor.cs index 07389e6e..0fbdcc44 100644 --- a/LLama/Batched/BatchedExecutor.cs +++ b/LLama/Batched/BatchedExecutor.cs @@ -55,23 +55,6 @@ public sealed class BatchedExecutor Epoch = 1; } - /// - /// Start a new with the given prompt - /// - /// - /// - [Obsolete("Use BatchedExecutor.Create instead")] - public Conversation Prompt(string prompt) - { - if (IsDisposed) - throw new ObjectDisposedException(nameof(BatchedExecutor)); - - var conversation = Create(); - conversation.Prompt(prompt); - - return conversation; - } - /// /// Start a new /// diff --git a/LLama/Batched/Conversation.cs b/LLama/Batched/Conversation.cs index 2da3da7c..c5792ebc 100644 --- a/LLama/Batched/Conversation.cs +++ b/LLama/Batched/Conversation.cs @@ -166,11 +166,12 @@ public sealed class Conversation /// /// /// - public void Prompt(string input) + [Obsolete("Tokenize the text and pass the tokens instead")] + public void Prompt(string input, bool addBos, bool special) { AssertCanBePrompted(); - Prompt(Executor.Context.Tokenize(input)); + Prompt(Executor.Context.Tokenize(input, addBos, special)); } ///