Hi,
I created a fine-tuned model to include in my existing chatbot application. Previous the chatbot was just working fine on a davinci engine. How do I use the fine-tuned model in Node? When I use my existing code, the model doesn’t send a result back and there’s no error. I feel like I am missing something. Thanks for any help!
function complete(incomingMsg) {
let response;
let prompt;
const apiKey = process.env.OPENAI_API_KEY;
const client = axios.create({
headers: { 'Authorization': 'Bearer ' + apiKey }
});
const endpoint = "https://api.openai.com/v1/engines/davinci/completions";
prompt = generatePrompt(incomingMsg);
const params = {
prompt,
temperature: 0.9,
max_tokens: 64,
top_p: 1,
model: "curie:ft-personal-2022-05-01-13-44-XXX",
stop: ["Human:"],
Inject_start_text:["\n, AI:"],
Inject_restart_text:["\n, Human:"],
}
client.post(endpoint, params)
.then(result => {
response = result.data.choices[0].text;
io.emit('answer', result.data.choices[0].text);
console.log(result);
sessionChatLog = `${prompt}${response}`;
}).catch(err => {
console.log(err);
});
}