From e0177badc5d5cf69db4772ad5fe20b265bf8efd9 Mon Sep 17 00:00:00 2001 From: MaxRobinsonTheGreat Date: Wed, 15 May 2024 10:19:24 -0500 Subject: [PATCH] improved replicate params --- src/models/replicate.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/models/replicate.js b/src/models/replicate.js index 4301448..ea5a4a9 100644 --- a/src/models/replicate.js +++ b/src/models/replicate.js @@ -22,17 +22,10 @@ export class ReplicateAPI { async sendRequest(turns, systemMessage) { const stop_seq = '***'; - let prompt_template; - const prompt = toSinglePrompt(turns, systemMessage, stop_seq); + const prompt = toSinglePrompt(turns, null, stop_seq); let model_name = this.model_name || 'meta/meta-llama-3-70b-instruct'; - if (model_name.includes('llama')) { // llama - prompt_template = "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{prompt}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n" - } - else { // mistral - prompt_template = "[INST] {prompt} [/INST] " - } - const input = { prompt, prompt_template }; + const input = { prompt, system_prompt: systemMessage }; let res = null; try { console.log('Awaiting Replicate API response...');