-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] 对某些上传的pdf文件分块失败 #3551
Comments
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
能否附一个文件上来我看下 |
Can you attach a file for me to take a look at? |
synergy.pdf |
synergy.pdf |
+1 |
+1 |
其他pdf文件也可以分块,少量pdf文件不行 |
Other pdf files can also be divided into chunks, but a small number of pdf files cannot. |
(If you use Windows system) You can try to use the "Print function" to output this PDF as a new PDF and then upload it in chunks. |
嗯,确实是这篇文档的"问题".目前定位到了你这篇论文里的第4页(含义复杂的图表+数学公式混排)解析出问题了..印象中这种页面不太好搞.. |
Well, it is indeed the "problem" of this document. Currently, I have located the 4th page of your paper (a mixed arrangement of charts and mathematical formulas with complex meanings) and there is a problem. I have the impression that this kind of page is not easy to handle. .. |
@Sun-drenched 这种后续可以等我把 Unstructed.io 的变量开起来后再试试。之前我试下来 Unstructed 解析这种复杂格式的文件都没问题的 |
@Sun-drenched I can try this follow-up after I open the variables of Unstructed.io. I tried Unstructed before and it had no problem parsing files in this complex format. |
希望如此吧,我之前测试一些理工科论文的时候,感觉市面上主流开源方案都不能做得很好(比如这个页面所示的,带有多个且复杂图例且图中还有足以影响理解结果的位置关系;流程图中表达复杂的数学关系). 另外,报错"[error]: invalid byte sequence for encoding "UTF8": 0x00"似乎还和PostgreSQl数据库有关. |
I hope so. When I tested some science and engineering papers before, I felt that the mainstream open source solutions on the market could not do a good job (for example, as shown on this page, there are multiple and complex legends and there are enough in the figure to affect the understanding of the results. positional relationships; complex mathematical relationships expressed in flow charts). In addition, the error "[error]: invalid byte sequence for encoding "UTF8": 0x00" seems to be related to the PostgreSQl database. |
我这个pdf也是 |
是否能提供一种方案把PDF直接通过文本提取/页面截图的方式嵌入到聊天消息里而不是向量化? |
Is there a solution to embed the PDF directly into the chat message through text extraction/page screenshot instead of vectorization? |
@ProblemFactory 未来会做的 |
I got the same thing, using Vercel, Neon DB, and MinIO |
Hey @nexusdiscord! I'm here to help you with any bugs, questions, or contributions you have while waiting for a human maintainer. Let's tackle this together! The error message "invalid byte sequence for encoding 'UTF8': 0x00" indicates that the file contains invalid UTF-8 byte sequences, which is causing the chunking process to fail. To address this issue, you can try the following steps:
Here is a relevant part of the async chunkContent(params: ChunkContentParams): Promise<ChunkResult> {
// Detect and convert encoding to UTF-8 if necessary
const content = convertToUTF8(params.content);
if (this.isUsingUnstructured(params))
return await this.chunkByUnstructured(params.filename, content);
return await this.chunkByLangChain(params.filename, content);
}
function convertToUTF8(content: Uint8Array): Uint8Array {
// Implement encoding detection and conversion logic here
// For example, using the 'iconv-lite' library
const iconv = require('iconv-lite');
const detectedEncoding = detectEncoding(content); // Implement this function
return iconv.encode(iconv.decode(content, detectedEncoding), 'utf-8');
} By implementing encoding detection and conversion, you can ensure that the chunking process handles files with different encodings correctly. For more details on the chunking process, you can refer to the |
有些PDF如果先分成几段小PDF的话再分别分块就可行,比如说Head First Java本身45mb直接分块的话会报错,但如果把这个45mb分成5份小PDF,每份都小于15mb的话,lobechat就能分出来 |
When I split the PDF, I encountered a PDF page that caused an 'invalid byte sequence for encoding "UTF8": 0x00'. |
还是PDF不好分割的问题,我推荐如果分块失败,可以先把PDF转成markdown传上去, 把图表都筛掉只剩文字就好了. |
It’s still a problem that PDF is not easy to split. I recommend that if the splitting fails, you can first convert the PDF to markdown and upload it, filtering out the charts and leaving only the text. |
向量化失败,请检查后重试。失败原因: txt、pdf、文档都这样。这个问题怎么解决?需要使用特定的模型? |
Vectorization failed, please check and try again. Reason for failure: This is true for txt, pdf, and documents. How to solve this problem? Need to use a specific model? |
现在还是不行,导入带有复杂图表、纯图片(会提示no chunk)的和带代码段的pdf依旧会分块失败 |
It still doesn't work. Importing PDFs with complex charts, pure pictures (no chunk will be prompted) and code snippets will still fail to be divided into chunks. |
同样的问题!解决了吗??? |
Same problem! Is it solved? ? ? |
This issue is closed, If you have any questions, you can comment and reply. |
🎉 This issue has been resolved in version 1.50.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
📦 部署环境
Vercel
📌 软件版本
1.12.3
💻 系统环境
Windows
🌐 浏览器
Chrome
🐛 问题描述
某些pdf文件上传后无法分块,出现如图错误

📷 复现步骤
No response
🚦 期望结果
No response
📝 补充信息
No response
The text was updated successfully, but these errors were encountered: