mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-03-27 02:58:54 +07:00
fix: update status indicators in documentation and improve config handling in utils.py
This commit is contained in:
@@ -38,6 +38,7 @@ docker run -u root --name mineru_docker \
|
|||||||
-v /usr/local/bin/xpu-smi:/usr/local/bin/xpu-smi \
|
-v /usr/local/bin/xpu-smi:/usr/local/bin/xpu-smi \
|
||||||
-w /workspace \
|
-w /workspace \
|
||||||
-e MINERU_MODEL_SOURCE=local \
|
-e MINERU_MODEL_SOURCE=local \
|
||||||
|
-e MINERU_FORMULA_CH_SUPPORT=true \
|
||||||
-e MINERU_VLLM_DEVICE=kxpu \
|
-e MINERU_VLLM_DEVICE=kxpu \
|
||||||
-it mineru:kxpu-vllm-latest \
|
-it mineru:kxpu-vllm-latest \
|
||||||
/bin/bash
|
/bin/bash
|
||||||
@@ -72,7 +73,7 @@ docker run -u root --name mineru_docker \
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><vlm/hybrid>-auto-engine</td>
|
<td><vlm/hybrid>-auto-engine</td>
|
||||||
<td>🟡</td>
|
<td>🟢</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><vlm/hybrid>-http-client</td>
|
<td><vlm/hybrid>-http-client</td>
|
||||||
@@ -85,7 +86,7 @@ docker run -u root --name mineru_docker \
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><vlm/hybrid>-auto-engine</td>
|
<td><vlm/hybrid>-auto-engine</td>
|
||||||
<td>🟡</td>
|
<td>🟢</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><vlm/hybrid>-http-client</td>
|
<td><vlm/hybrid>-http-client</td>
|
||||||
@@ -98,7 +99,7 @@ docker run -u root --name mineru_docker \
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><vlm/hybrid>-auto-engine</td>
|
<td><vlm/hybrid>-auto-engine</td>
|
||||||
<td>🟡</td>
|
<td>🟢</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><vlm/hybrid>-http-client</td>
|
<td><vlm/hybrid>-http-client</td>
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ docker run --privileged=true \
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">数据并行 (--data-parallel-size/--dp)</td>
|
<td colspan="2">数据并行 (--data-parallel-size/--dp)</td>
|
||||||
<td>🟡</td>
|
<td>🔴</td>
|
||||||
<td>🔴</td>
|
<td>🔴</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ docker run -dit --name mineru_docker \
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">数据并行 (--data-parallel-size)</td>
|
<td colspan="2">数据并行 (--data-parallel-size)</td>
|
||||||
<td>🟡</td>
|
<td>🔴</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -189,17 +189,16 @@ def _apply_server_config(args: list, config: dict) -> None:
|
|||||||
"""应用 server 模式的配置"""
|
"""应用 server 模式的配置"""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
if "compilation_config_dict" in config:
|
for key, value in config.items():
|
||||||
_add_server_arg_if_missing(
|
if key == "compilation_config_dict":
|
||||||
args, "compilation-config",
|
_add_server_arg_if_missing(
|
||||||
json.dumps(config["compilation_config_dict"], separators=(',', ':'))
|
args, "compilation-config",
|
||||||
)
|
json.dumps(value, separators=(',', ':'))
|
||||||
|
)
|
||||||
for key in ["block_size", "dtype", "distributed_executor_backend"]:
|
else:
|
||||||
if key in config:
|
|
||||||
# 转换 key 格式: block_size -> block-size
|
# 转换 key 格式: block_size -> block-size
|
||||||
arg_name = key.replace("_", "-")
|
arg_name = key.replace("_", "-")
|
||||||
_add_server_arg_if_missing(args, arg_name, str(config[key]))
|
_add_server_arg_if_missing(args, arg_name, str(value))
|
||||||
|
|
||||||
|
|
||||||
def _apply_engine_config(kwargs: dict, config: dict, vllm_mode: str) -> None:
|
def _apply_engine_config(kwargs: dict, config: dict, vllm_mode: str) -> None:
|
||||||
@@ -209,16 +208,14 @@ def _apply_engine_config(kwargs: dict, config: dict, vllm_mode: str) -> None:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError("Please install vllm to use the vllm-async-engine backend.")
|
raise ImportError("Please install vllm to use the vllm-async-engine backend.")
|
||||||
|
|
||||||
if "compilation_config_dict" in config:
|
for key, value in config.items():
|
||||||
config_dict = config["compilation_config_dict"]
|
if key == "compilation_config_dict":
|
||||||
if vllm_mode == "sync_engine":
|
if vllm_mode == "sync_engine":
|
||||||
compilation_config = config_dict
|
compilation_config = value
|
||||||
elif vllm_mode == "async_engine":
|
elif vllm_mode == "async_engine":
|
||||||
compilation_config = CompilationConfig(**config_dict)
|
compilation_config = CompilationConfig(**value)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
_add_engine_kwarg_if_missing(kwargs, "compilation_config", compilation_config)
|
||||||
else:
|
else:
|
||||||
return
|
_add_engine_kwarg_if_missing(kwargs, key, value)
|
||||||
_add_engine_kwarg_if_missing(kwargs, "compilation_config", compilation_config)
|
|
||||||
|
|
||||||
for key in ["block_size", "dtype", "distributed_executor_backend"]:
|
|
||||||
if key in config:
|
|
||||||
_add_engine_kwarg_if_missing(kwargs, key, config[key])
|
|
||||||
|
|||||||
Reference in New Issue
Block a user