@@ -18,7 +18,7 @@ Note that the [issue tracker][issues] is only intended for actionable items. In
18
18
19
19
First, [ fork the repository on GitHub] ( https://github.com/dottxt-ai/outlines/fork ) and clone the fork locally:
20
20
21
- ``` bash
21
+ ``` shell
22
22
git clone
[email protected] /YourUserName/outlines.git
23
23
cd outlines
24
24
```
@@ -27,35 +27,49 @@ Create a new virtual environment:
27
27
28
28
* If you are using ` uv ` * :
29
29
30
- ``` bash
30
+ ``` shell
31
31
uv venv
32
32
source .venv/bin/activate
33
33
alias pip=" uv pip" # ... or just remember to prepend any pip command with uv in the rest of this guide
34
34
```
35
35
36
36
* If you are using ` venv ` * :
37
37
38
- ``` bash
38
+ ``` shell
39
39
python -m venv .venv
40
40
source .venv/bin/activate
41
41
```
42
42
43
43
* If you are using ` conda ` * :
44
44
45
- ``` bash
45
+ ``` shell
46
46
conda env create -f environment.yml
47
47
```
48
48
49
49
Then install the dependencies in editable mode, and install the ` pre-commit ` hooks:
50
50
51
- ``` bash
51
+ ``` shell
52
+ python -m venv .venv
53
+ source .venv/bin/activate
54
+ ```
55
+
56
+ Then install the dependencies in editable mode, and install the pre-commit hooks:
57
+
58
+ ``` shell
52
59
pip install -e " .[test]"
53
60
pre-commit install
54
61
```
62
+ If you own a GPU and want to run the vLLM tests you will have to run:
63
+
64
+ ``` shell
65
+ pip install -e " .[test-gpu]"
66
+ ```
67
+
68
+ instead.
55
69
56
70
Outlines provides optional dependencies for different supported backends, which you can install with
57
71
58
- ``` bash
72
+ ``` shell
59
73
pip install " .[vllm]"
60
74
```
61
75
@@ -85,13 +99,13 @@ You will not have access to a GPU, but you'll be able to make basic contribution
85
99
86
100
Run the tests:
87
101
88
- ``` bash
102
+ ``` shell
89
103
pytest
90
104
```
91
105
92
106
And run the code style checks:
93
107
94
- ``` bash
108
+ ``` shell
95
109
pre-commit run --all-files
96
110
```
97
111
@@ -101,7 +115,7 @@ Outlines uses [asv](https://asv.readthedocs.io) for automated benchmark testing.
101
115
102
116
You can run the benchmark test suite locally with the following command:
103
117
104
- ``` bash
118
+ ``` shell
105
119
asv run --config benchmarks/asv.conf.json
106
120
```
107
121
@@ -112,19 +126,19 @@ Caveats:
112
126
113
127
#### Run a specific test:
114
128
115
- ``` bash
129
+ ``` shell
116
130
asv run --config benchmarks/asv.conf.json -b bench_json_schema.JsonSchemaBenchmark.time_json_schema_to_fsm
117
131
```
118
132
119
133
#### Profile a specific test:
120
134
121
- ``` bash
135
+ ``` shell
122
136
asv run --config benchmarks/asv.conf.json --profile -b bench_json_schema.JsonSchemaBenchmark.time_json_schema_to_fsm
123
137
```
124
138
125
139
#### Compare to ` origin/main `
126
140
127
- ``` bash
141
+ ``` shell
128
142
get fetch origin
129
143
asv continuous origin/main HEAD --config benchmarks/asv.conf.json
130
144
```
@@ -140,13 +154,13 @@ asv continuous origin/main HEAD --config benchmarks/asv.conf.json
140
154
141
155
To work on the * documentation* you will need to install the related dependencies:
142
156
143
- ``` bash
157
+ ``` shell
144
158
pip install -r requirements-doc.txt
145
159
```
146
160
147
161
To build the documentation and serve it locally, run the following command in the repository's root folder:
148
162
149
- ``` bash
163
+ ``` shell
150
164
mkdocs serve
151
165
```
152
166
@@ -157,7 +171,7 @@ It will be updated every time you make a change.
157
171
158
172
Create a new branch on your fork, commit and push the changes:
159
173
160
- ``` bash
174
+ ``` shell
161
175
git checkout -b new-branch
162
176
git add .
163
177
git commit -m " Changes I made"
0 commit comments