Skip to content

Commit 81ad00e

Browse files
committed
Fixed random responses from LLMs
1 parent e516644 commit 81ad00e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ai-assistant/src/core/services/llm/llama3_70B.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Llama3_70B implements ILLMModel {
2121
authorization: "Bearer " + HF_TOKEN,
2222
},
2323
data: {
24-
temprature: 0,
24+
temperature: 0,
2525
messages: prompt.messages,
2626
model: "mistralai/Mistral-7B-Instruct-v0.1",
2727
stream: false,
@@ -37,21 +37,24 @@ export class Llama3_70B implements ILLMModel {
3737
}
3838

3939
async ask(prompt: Prompt): Promise<string | null> {
40-
return await this.fromHuggingFace(prompt);
40+
// return await this.fromHuggingFace(prompt);
4141

4242
const url = `${this.baseURL}/chat/completions`;
4343
const res = await this.http.post(url, {
4444
headers: {
4545
"Content-Type": "application/json",
4646
},
4747
data: {
48+
temperature: 0,
4849
messages: prompt.messages,
4950
},
5051
});
5152
if (!res.content) return null;
5253

5354
// @ts-ignore
5455
const message = JSON.parse(res.content).choices[0].message.content;
56+
console.log(message);
57+
5558
return message;
5659
}
5760
}

ai-assistant/src/core/services/llm/mistral_7b.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class Mistral_7B implements ILLMModel {
2020
},
2121
data: {
2222
model: this.model,
23-
temprature: 0,
23+
temperature: 0,
2424
messages: prompt.messages,
2525
},
2626
});

0 commit comments

Comments
 (0)