a5e1e93a by Jonille Arreglo

31675_chatbotplus_llm

1 parent 26bb74be
Showing 1 changed file with 11 additions and 2 deletions
......@@ -288,14 +288,23 @@ async function runOpensource(req, res) {
const response = await axios.post(endpoint_api_url + '/chat/completions', {
model: currentModel,
messages: JSON.parse(message),
temperature
max_tokens: 2048,
temperature,
top_p: 0.7,
top_k: 50,
repetition_penalty: 1
}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + api_key
},
}).catch(error => {
error_msg = error.response.statusText ? error.response.statusText : '';
if(error.response?.data?.error?.param === 'max_tokens') {
input = "The output for your prompt is too long for us to process. Please reduce your prompt and try again.";
} else {
error_msg = error.response.statusText ? error.response.statusText : '';
}
console.log("err",error.response.data.error);
});
if (error_msg !== '') {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!