🦙 feat: Add LLama 3 System Context Length (#2938)

This commit is contained in:
Danny Avila 2024-05-31 12:16:08 -04:00 committed by GitHub
parent f9a0166352
commit 8939d8af37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View file

@ -59,6 +59,8 @@ const openAIModels = {
'gpt-3.5-turbo-1106': 16375, // -10 from max
'gpt-3.5-turbo-0125': 16375, // -10 from max
'mistral-': 31990, // -10 from max
llama3: 8187, // -5 from max
'llama-3': 8187, // -5 from max
};
const cohereModels = {

View file

@ -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', () => {
expect(getModelMaxTokens('unknown-model')).toBeUndefined();
});