File size: 2,748 Bytes
33d4721
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Quickstart Guide for Local Training

This quickstart is for local installation and usage.
If you want to use AutoTrain on Hugging Face Spaces, please refer to the *AutoTrain on Hugging Face Spaces* section.

You can install AutoTrain Advanced using pip:

```bash
$ pip install autotrain-advanced
```

It is advised to install autotrain-advanced in a virtual environment to avoid any conflicts with other packages.
Note: AutoTrain doesn't install pytorch, torchaudio, torchvision, or any other large dependencies. You will need to install them separately.

```bash
$ conda create -n autotrain python=3.10
$ conda activate autotrain
$ pip install autotrain-advanced
$ conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
$ conda install -c "nvidia/label/cuda-12.1.0" cuda-nvcc
$ conda install xformers -c xformers
$ python -m nltk.downloader punkt
$ pip install flash-attn --no-build-isolation # if you want to use flash-attn
$ pip install deepspeed # if you want to use deepspeed
````

# Running AutoTrain User Interface (UI)

To run the autotrain app locally, you can use the following command:

```bash
$ export HF_TOKEN=your_hugging_face_write_token
$ autotrain app --host 127.0.0.1 --port 8000
```

This will start the app on `http://127.0.0.1:8000`.


# Using AutoTrain Command Line Interface (CLI)

It is also possible to use the CLI:

```bash
$ export HF_TOKEN=your_hugging_face_write_token
$ autotrain --help
```

This will show the CLI commands that can be used:

```bash
usage: autotrain <command> [<args>]

positional arguments:
{
    app,
    llm,
    setup,
    api,
    text-classification,
    text-regression,
    image-classification,
    tabular,
    spacerunner,
    seq2seq,
    token-classification
}
    
    commands

options:
  -h, --help            show this help message and exit
  --version, -v         Display AutoTrain version
  --config CONFIG       Optional configuration file

For more information about a command, run: `autotrain <command> --help`
```

It is advised to use only the `autotrain --config CONFIG_FILE` command for training when using the CLI.

The autotrain commands that end users will be interested in are:

- `app`: Start the AutoTrain UI
- `llm`: Train a language model
- `text-classification`: Train a text classification model
- `text-regression`: Train a text regression model
- `image-classification`: Train an image classification model
- `tabular`: Train a tabular model
- `spacerunner`: Train any custom model using SpaceRunner
- `seq2seq`: Train a sequence-to-sequence model
- `token-classification`: Train a token classification model

Note: above commands are not required if you use preferred `autotrain --config CONFIG_FILE` command to train the models.