mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
🦙 feat: Add LLama 3 System Context Length (#2938)
This commit is contained in:
parent
f9a0166352
commit
8939d8af37
2 changed files with 14 additions and 0 deletions
|
|
@ -59,6 +59,8 @@ const openAIModels = {
|
||||||
'gpt-3.5-turbo-1106': 16375, // -10 from max
|
'gpt-3.5-turbo-1106': 16375, // -10 from max
|
||||||
'gpt-3.5-turbo-0125': 16375, // -10 from max
|
'gpt-3.5-turbo-0125': 16375, // -10 from max
|
||||||
'mistral-': 31990, // -10 from max
|
'mistral-': 31990, // -10 from max
|
||||||
|
llama3: 8187, // -5 from max
|
||||||
|
'llama-3': 8187, // -5 from max
|
||||||
};
|
};
|
||||||
|
|
||||||
const cohereModels = {
|
const cohereModels = {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,18 @@ describe('getModelMaxTokens', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should return correct tokens for LLama 3 models', () => {
|
||||||
|
expect(getModelMaxTokens('meta-llama/llama-3-8b')).toBe(
|
||||||
|
maxTokensMap[EModelEndpoint.openAI]['llama-3'],
|
||||||
|
);
|
||||||
|
expect(getModelMaxTokens('meta-llama/llama-3-8b')).toBe(
|
||||||
|
maxTokensMap[EModelEndpoint.openAI]['llama3'],
|
||||||
|
);
|
||||||
|
expect(getModelMaxTokens('llama-3-500b')).toBe(maxTokensMap[EModelEndpoint.openAI]['llama-3']);
|
||||||
|
expect(getModelMaxTokens('llama3-70b')).toBe(maxTokensMap[EModelEndpoint.openAI]['llama3']);
|
||||||
|
expect(getModelMaxTokens('llama3:latest')).toBe(maxTokensMap[EModelEndpoint.openAI]['llama3']);
|
||||||
|
});
|
||||||
|
|
||||||
test('should return undefined for no match', () => {
|
test('should return undefined for no match', () => {
|
||||||
expect(getModelMaxTokens('unknown-model')).toBeUndefined();
|
expect(getModelMaxTokens('unknown-model')).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue