From bea6e96aa9546823e6a83e41cb30368fccbfacf9 Mon Sep 17 00:00:00 2001 From: colin <98445953+colinmccloskey@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:09:50 -0400 Subject: [PATCH] Removing comments --- .../meta/cp4m/llm/HuggingFaceLlamaPrompt.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/main/java/com/meta/cp4m/llm/HuggingFaceLlamaPrompt.java b/src/main/java/com/meta/cp4m/llm/HuggingFaceLlamaPrompt.java index 62bdb1e..0a46f7e 100644 --- a/src/main/java/com/meta/cp4m/llm/HuggingFaceLlamaPrompt.java +++ b/src/main/java/com/meta/cp4m/llm/HuggingFaceLlamaPrompt.java @@ -51,36 +51,7 @@ public HuggingFaceLlamaPrompt(HuggingFaceConfig config) { public Optional createPrompt(ThreadState threadState) { PromptBuilder builder = new PromptBuilder(); - -// int totalTokens = 5; // Account for closing tokens -// Message systemMessage = threadState.messages().get(0).role().equals(Message.Role.SYSTEM) ? threadState.messages().get(0) : MessageFactory.instance(FBMessage.class) -// .newMessage( -// Instant.now(), -// this.systemMessage, -// Identifier.random(), -// Identifier.random(), -// Identifier.random(), -// Message.Role.SYSTEM); -// ArrayList output = new ArrayList<>(); -// totalTokens += tokenCount(systemMessage.message()); -// for (int i = threadState.messages().size() - 1; i >= 0; i--) { -// Message m = threadState.messages().get(i); -// -// if (m.role().equals(Message.Role.SYSTEM)) { -// continue; // system has already been counted -// } -// totalTokens += tokenCount(m.message()); -// if (totalTokens > maxInputTokens) { -// break; -// } -// output.add(0, m); -// } -// if (output.isEmpty()) { -// return Optional.empty(); -// } -// output.add(0, systemMessage); - - + int totalTokens = tokenCount(this.systemMessage) + 5; // Account for closing tokens builder.addSystem(this.systemMessage);