diff --git a/docs/en/modelers_install.md b/docs/en/modelers_install.md new file mode 100644 index 0000000000000000000000000000000000000000..c716eb2802a03338e4436cf57e873b1a3de7ab2f --- /dev/null +++ b/docs/en/modelers_install.md @@ -0,0 +1,67 @@ +# openMind Hub Client Installation + +Before the installation, you need to configure the local environment. The openMind Hub Client supports Python 3.8, 3.9, and 3.10. For details, see [Installation Description](https://docs.python.org/3/using/index.html). Compatibility with other versions is not guaranteed. + +## Installation Guide + +To avoid compatibility issues between dependencies in different projects, Python and conda virtual environments are recommended. For details about how to install and manage the virtual environments, see [Python virtual environment](https://docs.python.org/3/library/venv.html) and [conda virtual environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html). This document only describes how to create and enable the virtual environments. + +1. Create and activate virtual environments. + + - Create and activate a Python virtual environment. + + ```shell + # Create a Python virtual environment named **your_venv_name**. + python3 -m venv /path/to/your_venv_name + # Activate the **your_venv_name** virtual environment. + source /path/to/your_venv_name/bin/activate + ``` + + - Create and activate a conda virtual environment. + + ```shell + # Create a Python 3.8 virtual environment named **your_venv_name**. + conda create -n your_venv_name python=3.8 + # Activate the **your_venv_name** virtual environment. + conda activate your_venv_name + ``` + +2. Install the openMind Hub Client in pip mode as required. + + ```shell + pip install openmind_hub + ``` + +## Verifying the Installation + +After the installation is complete, run the following command to check whether openMind Hub Client is successfully installed: + +```bash +python -c "from openmind_hub import repo_info; print(repo_info('PyTorch-NPU/t5_small'))" +``` + +The detailed information about the t5_small model will be displayed in the command output. + +## Uninstallation + +Uninstall openMind Hub Client: + +```shell +pip uninstall openmind_hub +``` + +**Note** + +You can run the following commands to record logs about the installation and uninstallation of openMind Hub Client. **LOG_FILE** indicates the log path or log file name specified by the user. + +Note that installation or uninstallation logs are not dumped. Pay attention to the remaining drive space before recording the logs. + +```shell +# Record logs during openMind Hub Client installation. +pip install openmind_hub --log LOG_FILE +``` + +```shell +# Record logs during openMind Hub Client uninstallation. +pip uninstall openmind_hub --log LOG_FILE +``` diff --git a/docs/menu/menu.json b/docs/menu/menu.json index 08a221d2ddbec263ec5489ea649a517a836bf245..2cd95baebab948fc8decaf159ec20cb73a9e1218 100644 --- a/docs/menu/menu.json +++ b/docs/menu/menu.json @@ -21,7 +21,7 @@ } }, { - "id": "install", + "id": "modelers_install", "label": { "zh": "安装", "en": "Installation" diff --git a/docs/zh/modelers_install.md b/docs/zh/modelers_install.md new file mode 100644 index 0000000000000000000000000000000000000000..dd46fd5fc0e27e991da7af783062171512b62fc3 --- /dev/null +++ b/docs/zh/modelers_install.md @@ -0,0 +1,67 @@ +# 安装openmind Hub Client + +在开始安装之前,需要先配置本地环境。openMind Hub Client支持的Python版本是3.8/3.9/3.10,可查阅[安装说明](https://docs.python.org/zh-cn/3/using/index.html)。其他版本不保证兼容。 + +## 安装指导 + +为避免不同项目间不同依赖项的兼容性问题,推荐在Python或conda虚拟环境中安装openMind Hub Client。有关虚拟环境的安装和管理请详见[Python虚拟环境](https://docs.python.org/zh-cn/3/library/venv.html)和[conda虚拟环境](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html),此处仅提供创建和启用虚拟环境的方法。 + +1. 创建与激活虚拟环境。 + + - Python虚拟环境创建与激活。 + + ```shell + # 创建名为your_venv_name的python虚拟环境 + python3 -m venv /path/to/your_venv_name + # 激活your_venv_name虚拟环境 + source /path/to/your_venv_name/bin/activate + ``` + + - conda虚拟环境创建与激活。 + + ```shell + # 创建名为your_venv_name的python 3.8的虚拟环境 + conda create -n your_venv_name python=3.8 + # 激活your_venv_name虚拟环境 + conda activate your_venv_name + ``` + +2. 使用pip方式安装openMind Hub Client。 + + ```shell + pip install openmind_hub + ``` + +## 验证安装 + +安装完成后,使用如下命令检查openMind Hub Client安装是否成功: + +```bash +python -c "from openmind_hub import repo_info; print(repo_info('PyTorch-NPU/t5_small'))" +``` + +此方法会获取到t5_small模型的详细信息。 + +## 卸载 + +卸载openMind Hub Client: + +```shell +pip uninstall openmind_hub +``` + +**提示** + +通过以下指令可以记录安装和卸载openMind Hub Client的日志,其中LOG_FILE为用户指定的日志路径或日志文件名。 + +【注意】安装或卸载的日志不会转储,记录前请注意磁盘空间剩余容量。 + +```shell +# 安装openMind Hub Client时记录日志 +pip install openmind_hub-0.6-py3-none-any.whl --log LOG_FILE +``` + +```shell +# 卸载openMind Hub Client时记录日志 +pip uninstall openmind_hub --log LOG_FILE +```