fix: 重复生成向量

This commit is contained in:
archer
2023-04-04 22:12:48 +08:00
parent a7c5d3cc05
commit b73829a25c
6 changed files with 10 additions and 13 deletions

View File

@@ -75,7 +75,7 @@ export const readPdfContent = (file: File) =>
const readPDFPage = async (doc: any, pageNo: number) => {
const page = await doc.getPage(pageNo);
const tokenizedText = await page.getTextContent();
const pageText = tokenizedText.items.map((token: any) => token.str).join('');
const pageText = tokenizedText.items.map((token: any) => token.str).join(' ');
return pageText;
};