Skip to content

Commit

Permalink
移除空格,增加custom_models 容错性
Browse files Browse the repository at this point in the history
  • Loading branch information
QAbot-zh authored Dec 30, 2024
1 parent 3b5b496 commit 69fcb92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/utils/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function collectModelTable(
// server custom models
customModels
.split(",")
.map((v) => v.trim())
.filter((v) => !!v && v.length > 0)
.forEach((m) => {
const available = !m.startsWith("-");
Expand Down
2 changes: 1 addition & 1 deletion test/model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('collectModelTable', () => {
});

test('All models except OpenAI should be excluded, and additional models should be added when customized as "-all, +*openai,gpt-4o@azure"', () => {
const customModels = '-all, +*openai,gpt-4o@azure';
const customModels = '-all,+*openai,gpt-4o@azure';
const result = collectModelTable(mockModels, customModels);

expect(result['gpt-3.5-turbo@openai'].available).toBe(true);
Expand Down

0 comments on commit 69fcb92

Please sign in to comment.