Skip to content

Commit

Permalink
feat: multi-valued language
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Martin <[email protected]>
  • Loading branch information
feloy committed Jan 6, 2025
1 parent 0515c48 commit 18a7465
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/utils/catalogUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('sanitize', () => {
readme: '',
recommended: ['hf.instructlab.granite-7b-lab-GGUF', 'hf.instructlab.merlinite-7b-lab-GGUF'],
backend: 'llama-cpp',
language: 'lang1',
languages: ['lang1'],
frameworks: ['fw1'],
},
],
Expand All @@ -170,7 +170,7 @@ describe('sanitize', () => {
expect(catalog.version).equals(CatalogFormat.CURRENT);
expect(catalog.models[0].backend).toBeUndefined();
expect(catalog.models[0].name).equals('Mistral-7B-Instruct-v0.3-Q4_K_M');
expect(catalog.recipes[0].language).equals('lang1');
expect(catalog.recipes[0].languages).toStrictEqual(['lang1']);
expect(catalog.recipes[0].frameworks).toStrictEqual(['fw1']);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/utils/catalogUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function sanitizeRecipe(recipe: unknown): Recipe {
basedir: 'basedir' in recipe && typeof recipe.basedir === 'string' ? recipe.basedir : undefined,
recommended: 'recommended' in recipe && isStringArray(recipe.recommended) ? recipe.recommended : undefined,
backend: 'backend' in recipe && typeof recipe.backend === 'string' ? recipe.backend : undefined,
language: 'language' in recipe && typeof recipe.language === 'string' ? recipe.language : undefined,
languages: 'languages' in recipe && isStringArray(recipe.languages) ? recipe.languages : undefined,
frameworks: 'frameworks' in recipe && isStringArray(recipe.frameworks) ? recipe.frameworks : undefined,
};
throw new Error('invalid recipe format');
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/models/IRecipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ export interface Recipe {
* server the recipe requires
*/
backend?: string;
language?: string;
languages?: string[];
frameworks?: string[];
}

0 comments on commit 18a7465

Please sign in to comment.