mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
extend setup instructions (#120)
This commit is contained in:
committed by
GitHub
parent
e5c567ad02
commit
fdcb8f99fa
@@ -46,21 +46,41 @@ If you are using Visual Studio Code (VSCode) as your primary code editor, you ca
|
||||
|
||||
|
||||
|
||||
## Using Lightning Studio
|
||||
|
||||
For a smooth development experience in the cloud, I recommend the [Lightning AI Studio](https://lightning.ai/) platform, which allows users to set up a persistent environment and use both VSCode and Jupyter Lab on cloud CPUs and GPUs.
|
||||
|
||||
Once you start a new Studio, you can open the terminal and execute the following setup steps to clone the repository and install the dependencies:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/rasbt/LLMs-from-scratch.git
|
||||
cd LLMs-from-scratch
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
(In contrast to Google Colab, these only need to be executed once since the Lightning AI Studion environments are persistent).
|
||||
|
||||
Then, navigate to the Python script or Jupyter Notebook you want to run. Optionally, you can also easily connect a GPU to accelerate the code's runtime, for example, when you are pretraining the LLM in chapter 5 or finetuning it in chapters 6 and 7.
|
||||
|
||||
<img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/README/studio.webp" alt="1" width="700">
|
||||
|
||||
|
||||
|
||||
## Using Google Colab
|
||||
|
||||
To use a Google Colab environment in the cloud, head over to [https://colab.research.google.com/](https://colab.research.google.com/) and open the respective chapter notebook from the GitHub menu or by dragging the notebook into the *Upload* field as shown in the figure below.
|
||||
|
||||
<img src="./figures/1.webp" alt="1" width="700">
|
||||
<img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/README/colab_1.webp" alt="1" width="700">
|
||||
|
||||
|
||||
Also make sure you upload the relevant files (dataset files and .py files the notebook is importing from) to the Colab environment as well, as shown below.
|
||||
|
||||
<img src="./figures/2.webp" alt="2" width="700">
|
||||
<img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/README/colab_2.webp" alt="2" width="700">
|
||||
|
||||
|
||||
You can optionally run the code on a GPU by changing the *Runtime* as illustrated in the figure below.
|
||||
|
||||
<img src="./figures/3.webp" alt="3" width="700">
|
||||
<img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/README/colab_3.webp" alt="3" width="700">
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user