Skip to content

Commit

Permalink
fix: default vector
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Aug 26, 2023
1 parent defc736 commit 4973d7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions client/src/pages/api/system/getInitData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ const defaultQAModel = {
price: 0
};

const defaultVectorModels = [
const defaultVectorModels: VectorModelItemType[] = [
{
model: 'text-embedding-ada-002',
name: 'Embedding-2',
price: 0
price: 0,
defaultToken: 500,
maxToken: 3000
}
];

Expand Down
2 changes: 1 addition & 1 deletion client/src/service/moduleDispatch/kb/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function dispatchKBSearch(props: Record<string, any>): Promise<KBSe
}

// get vector
const vectorModel = kbList[0]?.vectorModel;
const vectorModel = kbList[0]?.vectorModel || global.vectorModels[0];
const { vectors, tokenLen } = await getVector({
model: vectorModel.model,
input: [userChatInput]
Expand Down

0 comments on commit 4973d7a

Please sign in to comment.