Skip to content

Commit

Permalink
fix: enum inference type (#1198)
Browse files Browse the repository at this point in the history
Signed-off-by: axel7083 <[email protected]>
  • Loading branch information
axel7083 authored Jun 11, 2024
1 parent 5ddb5c5 commit b384a3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions packages/backend/src/utils/inferenceUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ describe('parseInferenceType', () => {
expect(parseInferenceType(undefined)).toBe(InferenceType.NONE);
});

test('llamacpp should return the proper InferenceType.LLAMA_CPP', () => {
expect(parseInferenceType('llamacpp')).toBe(InferenceType.LLAMA_CPP);
test('llama-cpp should return the proper InferenceType.LLAMA_CPP', () => {
expect(parseInferenceType('llama-cpp')).toBe(InferenceType.LLAMA_CPP);
});
});

Expand All @@ -115,7 +115,7 @@ describe('getInferenceType', () => {
expect(
getInferenceType([
{
backend: 'llamacpp',
backend: 'llama-cpp',
} as unknown as ModelInfo,
]),
).toBe(InferenceType.LLAMA_CPP);
Expand All @@ -125,10 +125,10 @@ describe('getInferenceType', () => {
expect(
getInferenceType([
{
backend: 'llamacpp',
backend: 'llama-cpp',
},
{
backend: 'llamacpp',
backend: 'llama-cpp',
},
] as unknown as ModelInfo[]),
).toBe(InferenceType.LLAMA_CPP);
Expand All @@ -138,10 +138,10 @@ describe('getInferenceType', () => {
expect(
getInferenceType([
{
backend: 'llamacpp',
backend: 'llama-cpp',
},
{
backend: 'whispercpp',
backend: 'whisper-cpp',
},
] as unknown as ModelInfo[]),
).toBe(InferenceType.NONE);
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/models/IInference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import type { ModelInfo } from './IModelInfo';

export enum InferenceType {
LLAMA_CPP = 'llamacpp',
WHISPER_CPP = 'whispercpp',
LLAMA_CPP = 'llama-cpp',
WHISPER_CPP = 'whisper-cpp',
NONE = 'none',
}

Expand Down

0 comments on commit b384a3d

Please sign in to comment.