formatting

This commit is contained in:
rasbt
2025-02-15 21:05:58 -06:00
parent 61ca01c7c5
commit 7e335f8af0
2 changed files with 15 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ Otherwise, if Python is not installed or is an older version, you can install it
<img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/uv-setup/python-not-found.png" width="500" height="auto" alt="No Python Found"> <img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/uv-setup/python-not-found.png" width="500" height="auto" alt="No Python Found">
<br> <br>
**Linux (Ubuntu/Debian)** **Linux (Ubuntu/Debian)**
```bash ```bash
@@ -56,6 +57,7 @@ sudo apt install python3.10 python3.10-venv python3.10-dev
``` ```
<br> <br>
**macOS** **macOS**
If you use Homebrew, install Python with: If you use Homebrew, install Python with:
@@ -72,6 +74,7 @@ I recommend installing a Python version that is at least two versions older than
<img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/uv-setup/python-version.png" width="700" height="auto" alt="Python version"> <img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/uv-setup/python-version.png" width="700" height="auto" alt="Python version">
<br> <br>
**Windows** **Windows**
Download and run the installer from the official website: [https://www.python.org/downloads/](https://www.python.org/downloads/). Download and run the installer from the official website: [https://www.python.org/downloads/](https://www.python.org/downloads/).
@@ -87,6 +90,7 @@ I recommend installing a Python version that is at least 2 versions older than t
I highly recommend installing Python packages in a separate virtual environment to avoid modifying system-wide packages that your OS may depend on. To create a virtual environment in the current folder, follow the three steps below. I highly recommend installing Python packages in a separate virtual environment to avoid modifying system-wide packages that your OS may depend on. To create a virtual environment in the current folder, follow the three steps below.
<br> <br>
**1. Install uv** **1. Install uv**
```bash ```bash
@@ -94,6 +98,7 @@ pip install uv
``` ```
<br> <br>
**2. Create the virtual environment** **2. Create the virtual environment**
```bash ```bash
@@ -101,6 +106,7 @@ uv venv --python=python3.10
``` ```
<br> <br>
**3. Activate the virtual environment** **3. Activate the virtual environment**
```bash ```bash
@@ -146,6 +152,7 @@ uv pip install -U -r https://raw.githubusercontent.com/rasbt/LLMs-from-scratch/r
<img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/uv-setup/uv-install.png" width="700" height="auto" alt="Uv install"> <img src="https://sebastianraschka.com/images/LLMs-from-scratch-images/setup/uv-setup/uv-install.png" width="700" height="auto" alt="Uv install">
<br> <br>
**Finalizing the setup** **Finalizing the setup**
Thats it! Your environment should now be ready for running the code in the repository. Thats it! Your environment should now be ready for running the code in the repository.
@@ -169,6 +176,7 @@ uv pip install packagename
If problems persist, consider [opening a discussion](https://github.com/rasbt/LLMs-from-scratch/discussions) on GitHub or working through the *Option 2: Using Conda* section below. If problems persist, consider [opening a discussion](https://github.com/rasbt/LLMs-from-scratch/discussions) on GitHub or working through the *Option 2: Using Conda* section below.
<br> <br>
**Start working with the code** **Start working with the code**
Once everything is set up, you can start working with the code files. For instance, launch [JupyterLab](https://jupyterlab.readthedocs.io/en/latest/) by running: Once everything is set up, you can start working with the code files. For instance, launch [JupyterLab](https://jupyterlab.readthedocs.io/en/latest/) by running:

View File

@@ -13,6 +13,7 @@ In this tutorial, I am using a computer running macOS, but this workflow is simi
Uv can be installed as follows, depending on your operating system. Uv can be installed as follows, depending on your operating system.
<br> <br>
**macOS and Linux** **macOS and Linux**
```bash ```bash
@@ -26,6 +27,7 @@ wget -qO- https://astral.sh/uv/install.sh | sh
``` ```
<br> <br>
**Windows** **Windows**
```bash ```bash
@@ -75,6 +77,7 @@ uv add packaging
Alternatively, you can still install the dependencies directly from the repository using `uv pip install`. Note that this requires creating and activating the virtual environment manually: Alternatively, you can still install the dependencies directly from the repository using `uv pip install`. Note that this requires creating and activating the virtual environment manually:
<br> <br>
**1. Create a new virtual environment** **1. Create a new virtual environment**
Run the following command to manually create a new virtual environment, which will be saved via a new `.venv` subfolder: Run the following command to manually create a new virtual environment, which will be saved via a new `.venv` subfolder:
@@ -84,6 +87,7 @@ uv venv --python=python3.10
``` ```
<br> <br>
**2. Activate virtual environment** **2. Activate virtual environment**
Next, we need to activate this new virtual environment. Next, we need to activate this new virtual environment.
@@ -101,6 +105,7 @@ On Windows (PowerShell):
``` ```
<br> <br>
**3. Install dependencies** **3. Install dependencies**
Finally, we can install dependencies from a remote location using the `uv pip` interface: Finally, we can install dependencies from a remote location using the `uv pip` interface:
@@ -115,6 +120,7 @@ uv pip install -U -r https://raw.githubusercontent.com/rasbt/LLMs-from-scratch/r
## 4. Run Python code ## 4. Run Python code
<br> <br>
**Finalizing the setup** **Finalizing the setup**
Your environment should now be ready to run the code in the repository. Your environment should now be ready to run the code in the repository.
@@ -153,6 +159,7 @@ python setup/02_installing-python-libraries/python_environment_check.py
``` ```
<br> <br>
**Launching JupyterLab** **Launching JupyterLab**
You can launch a JupyterLab instance via: You can launch a JupyterLab instance via: