mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-20 15:10:59 +08:00
fix: resolve "no such file" error when processing non-English filenames in open-mineru (#11315)
This commit is contained in:
parent
556353e910
commit
90b0c8b4a6
@ -72,8 +72,8 @@ export default class OpenMineruPreprocessProvider extends BasePreprocessProvider
|
|||||||
// Find the main file after extraction
|
// Find the main file after extraction
|
||||||
let finalPath = ''
|
let finalPath = ''
|
||||||
let finalName = file.origin_name.replace('.pdf', '.md')
|
let finalName = file.origin_name.replace('.pdf', '.md')
|
||||||
// Find the corresponding folder by file name
|
// Find the corresponding folder by file id
|
||||||
outputPath = path.join(outputPath, `${file.origin_name.replace('.pdf', '')}`)
|
outputPath = path.join(outputPath, file.id)
|
||||||
try {
|
try {
|
||||||
const files = fs.readdirSync(outputPath)
|
const files = fs.readdirSync(outputPath)
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ export default class OpenMineruPreprocessProvider extends BasePreprocessProvider
|
|||||||
formData.append('return_md', 'true')
|
formData.append('return_md', 'true')
|
||||||
formData.append('response_format_zip', 'true')
|
formData.append('response_format_zip', 'true')
|
||||||
formData.append('files', fileBuffer, {
|
formData.append('files', fileBuffer, {
|
||||||
filename: file.origin_name
|
filename: file.name
|
||||||
})
|
})
|
||||||
|
|
||||||
while (retries < maxRetries) {
|
while (retries < maxRetries) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user