Skip to content

Commit

Permalink
Add instruction for downloading models from openmind hub (#2577)
Browse files Browse the repository at this point in the history
  • Loading branch information
cookieyyds authored Oct 11, 2024
1 parent fd33b59 commit 64c5084
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ print(response)
> By default, LMDeploy downloads model from HuggingFace. If you would like to use models from ModelScope, please install ModelScope by `pip install modelscope` and set the environment variable:
>
> `export LMDEPLOY_USE_MODELSCOPE=True`
>
> If you would like to use models from openMind Hub, please install openMind Hub by `pip install openmind_hub` and set the environment variable:
>
> `export LMDEPLOY_USE_OPENMIND_HUB=True`
For more information about inference pipeline, please refer to [here](docs/en/llm/pipeline.md).

Expand Down
4 changes: 4 additions & 0 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ print(response)
> デフォルトでは、LMDeployはHuggingFaceからモデルをダウンロードします。ModelScopeからモデルを使用する場合は、`pip install modelscope`コマンドでModelScopeをインストールし、環境変数を設定してください:
>
> `export LMDEPLOY_USE_MODELSCOPE=True`
>
> openMind Hubからモデルを使用する場合は、`pip install openmind_hub`コマンドでopenMind Hubをインストールし、環境変数を設定してください:
>
> `export LMDEPLOY_USE_OPENMIND_HUB=True`
推論パイプラインに関する詳細情報は[こちら](./docs/en/llm/pipeline.md)を参照してください。

Expand Down
4 changes: 4 additions & 0 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ print(response)
> LMDeploy 默认从 HuggingFace 上面下载模型,如果要从 ModelScope 上面下载模型,请通过命令 `pip install modelscope` 安装ModelScope,并设置环境变量:
>
> `export LMDEPLOY_USE_MODELSCOPE=True`
>
> 如果要从 openMind Hub 上面下载模型,请通过命令 `pip install openmind_hub` 安装openMind Hub,并设置环境变量:
>
> `export LMDEPLOY_USE_OPENMIND_HUB=True`
关于 pipeline 的更多推理参数说明,请参考[这里](docs/zh_cn/llm/pipeline.md)

Expand Down
2 changes: 1 addition & 1 deletion lmdeploy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def get_model(pretrained_model_name_or_path: str,
download_dir: str = None,
revision: str = None,
token: str = None):
"""Get model from huggingface or modelscope."""
"""Get model from huggingface, modelscope or openmind_hub."""
import os
if os.getenv('LMDEPLOY_USE_MODELSCOPE', 'False').lower() == 'true':
from modelscope import snapshot_download
Expand Down

0 comments on commit 64c5084

Please sign in to comment.