1
1
# Setting Up the Environment
2
2
3
- To follow along this course, you will need a mactonish device with Apple Silicon. We manage the codebase with the poetry
4
- dependency manager.
3
+ To follow along this course, you will need a mactonish device with Apple Silicon. We manage the codebase with pdm.
5
4
6
- ## Install Poetry
5
+ ## Install pdm
7
6
8
- Please follow the [ offcial guide] ( https://python-poetry.org/docs/#installing-with-the-official-installer ) to install
9
- poetry.
7
+ Please follow the [ offcial guide] ( https://pdm-project.org/en/latest/ ) to install pdm.
10
8
11
9
## Clone the Repository
12
10
@@ -30,23 +28,23 @@ We provide all reference implementations and you can refer to them if you get st
30
28
31
29
``` bash
32
30
cd tiny-llm
33
- poetry install
31
+ pdm install -v # this will automatically create a virtual environment and install all dependencies
34
32
```
35
33
36
34
## Check the Installation
37
35
38
36
``` bash
39
- poetry run python check.py
37
+ pdm run python check.py
40
38
# The reference solution should pass all the tests
41
- poetry run pytest tests_ref_impl_week1
39
+ pdm run pytest tests_ref_impl_week1
42
40
```
43
41
44
42
## Run Unit Tests
45
43
46
44
Your code is in ` src/tiny_llm ` . You can run the unit tests with:
47
45
48
46
``` bash
49
- poetry run pytest tests
47
+ pdm run pytest tests
50
48
```
51
49
52
50
## Download the Model Parameters
@@ -58,21 +56,21 @@ after week 1 day 6 when you start to load the model parameters.)
58
56
59
57
Follow the guide of [ this page] ( https://huggingface.co/docs/huggingface_hub/main/en/guides/cli ) to install the huggingface
60
58
cli. You should install it in your user directory/globally instead of in the tiny-llm virtual environment created by
61
- poetry .
59
+ pdm .
62
60
63
61
The model parameters are hosted on Hugging Face. Once you authenticated your cli with the credentials, you can download
64
62
them with:
65
63
66
64
``` bash
67
- # do not do this in the virtual environment created by poetry; do `deactivate` first if you did `poetry shell`
65
+ # do not do this in the virtual environment created by pdm
68
66
huggingface-cli login
69
67
huggingface-cli download Qwen/Qwen2-7B-Instruct-MLX
70
68
```
71
69
72
70
Then, you can run:
73
71
74
72
``` bash
75
- poetry run python main_ref_impl_week1.py
73
+ pdm run python main_ref_impl_week1.py
76
74
```
77
75
78
76
It should load the model and print some text.
0 commit comments