mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 13:53:50 +00:00
4.8.21 feature (#3742)
* model config * feat: normalization embedding * adapt unstrea reasoning response * remove select app * perf: dataset search code * fix: multiple audio video show * perf: query extension output * perf: link check * perf: faq doc * fix: ts * feat: support reasoning text output * feat: workflow support reasoning output
This commit is contained in:
@@ -56,14 +56,15 @@ export const readPdfFile = async ({ buffer }: ReadRawTextByBuffer): Promise<Read
|
||||
}
|
||||
};
|
||||
|
||||
// @ts-ignore
|
||||
const loadingTask = pdfjs.getDocument(buffer.buffer);
|
||||
const doc = await loadingTask.promise;
|
||||
|
||||
// Avoid OOM.
|
||||
let result = '';
|
||||
const pageArr = Array.from({ length: doc.numPages }, (_, i) => i + 1);
|
||||
for await (const pageNo of pageArr) {
|
||||
result += await readPDFPage(doc, pageNo);
|
||||
for (let i = 0; i < pageArr.length; i++) {
|
||||
result += await readPDFPage(doc, i + 1);
|
||||
}
|
||||
|
||||
loadingTask.destroy();
|
||||
|
Reference in New Issue
Block a user