Skip to content

Commit

Permalink
Removing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmccloskey committed Nov 1, 2023
1 parent 18541c7 commit bea6e96
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions src/main/java/com/meta/cp4m/llm/HuggingFaceLlamaPrompt.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,7 @@ public HuggingFaceLlamaPrompt(HuggingFaceConfig config) {
public Optional<String> createPrompt(ThreadState<T> 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<Message> 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);

Expand Down

0 comments on commit bea6e96

Please sign in to comment.