File size: 1,391 Bytes
22fb4ec |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
### Installation
In this section, we will show you how to install XTuner.
## Installation Process
We recommend users to follow our best practices for installing XTuner.
It is recommended to use a conda virtual environment with Python-3.10 to install XTuner.
### Best Practices
**Step 0.** Create a Python-3.10 virtual environment using conda.
```shell
conda create --name xtuner-env python=3.10 -y
conda activate xtuner-env
```
**Step 1.** Install XTuner.
Case a: Install XTuner via pip:
```shell
pip install -U xtuner
```
Case b: Install XTuner with DeepSpeed integration:
```shell
pip install -U 'xtuner[deepspeed]'
```
Case c: Install XTuner from the source code:
```shell
git clone https://github.com/InternLM/xtuner.git
cd xtuner
pip install -e '.[all]'
# "-e" indicates installing the project in editable mode, so any local modifications to the code will take effect without reinstalling.
```
## Verify the installation
To verify if XTuner is installed correctly, we will use a command to print the configuration files.
**Print Configuration Files:** Use the command `xtuner list-cfg` in the command line to verify if the configuration files can be printed.
```shell
xtuner list-cfg
```
You should see a list of XTuner configuration files, corresponding to the ones in [xtuner/configs](https://github.com/InternLM/xtuner/tree/main/xtuner/configs) in the source code.
|