From a49c605f121d0d06ea9ba1a0ef324736b56afd1b Mon Sep 17 00:00:00 2001 From: myhloli Date: Sun, 15 Jun 2025 10:57:30 +0800 Subject: [PATCH 1/2] fix: update request handling to pass state from send_one_request to wait_one_response --- mineru/model/vlm_sglang_model/engine.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mineru/model/vlm_sglang_model/engine.py b/mineru/model/vlm_sglang_model/engine.py index 0674a0ed..f028bba4 100644 --- a/mineru/model/vlm_sglang_model/engine.py +++ b/mineru/model/vlm_sglang_model/engine.py @@ -183,8 +183,8 @@ async def _one_request( created_time: Optional[float], ): tokenized_obj = await self._tokenize_one_request(obj) - self._send_one_request(obj, tokenized_obj, created_time) - async for out in self._wait_one_response(obj, request): + state = self._send_one_request(obj, tokenized_obj, created_time) + async for out in self._wait_one_response(obj, state, request): yield out @@ -256,8 +256,8 @@ async def _generate_request( is_single = obj.is_single if is_single: tokenized_obj = await self._tokenize_one_request(obj) - self._send_one_request(obj, tokenized_obj, created_time) - async for response in self._wait_one_response(obj, request): + state = self._send_one_request(obj, tokenized_obj, created_time) + async for response in self._wait_one_response(obj, state, request): yield response else: async for response in _handle_batch_request(self, obj, request, created_time): From e1181ba814382a9576e288753ac8df01cccde01f Mon Sep 17 00:00:00 2001 From: myhloli Date: Sun, 15 Jun 2025 11:03:07 +0800 Subject: [PATCH 2/2] fix: update sglang version to 0.4.7 and adjust changelog for compatibility issues --- README.md | 3 ++- README_zh-CN.md | 3 ++- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 867dc3ab..7a530248 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,10 @@ Easier to use: Just grab MinerU Desktop. No coding, no login, just a simple inte # Changelog -- 2025/06/15 2.0.2 released +- 2025/06/15 2.0.3 released - Fixed a configuration file key-value update error that occurred when downloading model type was set to `all` - Fixed an issue where formula and table feature toggle parameters in the command line interface could not be effectively disabled + - Fixed compatibility issues with sglang version 0.4.7 in the `sglang-engine` mode. - Updated Dockerfile and installation documentation for deploying the full version of MinerU in sglang environment - 2025/06/13 2.0.0 Released - MinerU 2.0 represents a comprehensive reconstruction and upgrade from architecture to functionality, delivering a more streamlined design, enhanced performance, and more flexible user experience. diff --git a/README_zh-CN.md b/README_zh-CN.md index e27b2b4d..1810c8b1 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -50,9 +50,10 @@ # 更新记录 -- 2025/06/15 2.0.2发布 +- 2025/06/15 2.0.3发布 - 修复了当下载模型类型设置为`all`时,配置文件出现键值更新错误的问题 - 修复了命令行接口中公式和表格功能的开关参数实际无法关闭的问题 + - 修复了`sglang-engine`模式下,0.4.7版本sglang的兼容性问题 - 更新了sglang环境下部署完整版MinerU的Dockerfile和相关安装文档 - 2025/06/13 2.0.0发布 - MinerU 2.0 是一次从架构到功能的全面重构与升级,带来了更简洁的设计、更强的性能以及更灵活的使用体验。 diff --git a/pyproject.toml b/pyproject.toml index 3df24e68..c5222f4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ vlm = [ "pydantic", ] sglang = [ - "sglang[all]>=0.4.7", + "sglang[all]==0.4.7", ] pipeline = [ "matplotlib>=3.10,<4",