You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _pages/dat450/assignment4.md
+5-27Lines changed: 5 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ In this assignment, you will perform supervised fine-tuning (SFT) of a small ope
19
19
20
20
### Requirements
21
21
22
-
Please submit your solution in Canvas. Submission deadline: December `SPECIFY HERE`.
22
+
Please submit your solution [in Canvas](https://canvas.chalmers.se/courses/36909/assignments/117618). **Submission deadline: December 1**.
23
23
24
24
Submit Python files containing your solution to the programming tasks described below. In addition, to save time for the people who grade your submission, please submit a text file containing the outputs printed out by your Python program; read the instructions carefully so that the right outputs are included. (Most important outputs already designed for the code)
25
25
@@ -34,39 +34,17 @@ This assignment is adapted from a previous version by Marco Kuhlmann and updated
34
34
## Step 0: Preliminaries
35
35
36
36
### Libraries
37
-
We use the following libraries from the HF ecosystem:
37
+
38
+
As in the previous assignment, you can use the pre-set environment `source /data/courses/2025_dat450_dit247/venvs/dat450_venv/bin/activate`.
39
+
40
+
Alternatively, if you are working on your own machine or some cloud-based service, install the following libraries with a package manager such as `pip` or `uv`:
As in the previous assignment, you can still use the pre-set environment `source /data/courses/2025_dat450_dit247/venvs/dat450_venv/bin/activate`, or you can try something popular nowadays called **`uv`**. **`uv`** is a super-fast Python package manager and environment tool—kind of like `pip`, but much faster and cleaner. So, bear with me in the following paragraph if you want to start working with it.
46
-
47
-
First, we need to install it on Mierva (or later on your operating system, which you can do by following this [documentation](https://docs.astral.sh/uv/getting-started/installation/)). The easiest way:
48
-
49
-
```bash
50
-
curl -LsSf https://astral.sh/uv/install.sh | sh
51
-
```
52
-
53
-
After installation, restart your terminal or reload your shell:
54
-
```bash
55
-
source~/.bashrc
56
-
```
57
-
Check that it works:
58
-
```bash
59
-
uv --version
60
-
```
61
-
That's it, you're ready to dive into the task. Then you can start to sync your environmnet using:
62
-
63
-
```bash
64
-
uv python install 3.12
65
-
uv venv --python 3.12
66
-
uv sync
67
-
```
68
-
69
-
70
48
### Getting the files
71
49
72
50
The dataset [Alpaca](https://huggingface.co/datasets/tatsu-lab/alpaca) is a collection of 52k instruction-response pairs designed for SFT of LLM for instruction following (JSON format). For easy use we already downloaed this dataset that you can load using the HF datasets as:
0 commit comments