当前位置: 首页 > news >正文

第一章 从零开始学习大型语言模型-搭建环境

构建大型语言模型

1.如何设置Python环境

1.1 macos

1 homebrew

我在这台计算机上使用Homebrew,这是另一个软件包管理器。因此,如果我去这里键入Homebrew,则不必顺其自然。这只是我碰巧在这台计算机上使用的东西。它被称为MacOS缺少的软件包管理器。因此,它允许您安装某些尚未随附MacOS的工具。

holyeyes@holyeyesdeMini ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
==> The following new directories will be created:
/opt/homebrew/bin
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
/opt/homebrew/opt
/opt/homebrew/share/zsh
/opt/homebrew/share/zsh/site-functions
/opt/homebrew/var/homebrew
/opt/homebrew/var/homebrew/linked
/opt/homebrew/Cellar
/opt/homebrew/Caskroom
/opt/homebrew/Frameworks
==> The Xcode Command Line Tools will be installed.Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/bin/install -d -o root -g wheel -m 0755 /opt/homebrew
==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /bin/chmod ug=rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /bin/chmod go-w /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown holyeyes /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/sbin/chown -R holyeyes:admin /opt/homebrew
==> /usr/bin/sudo /bin/mkdir -p /Users/holyeyes/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/holyeyes/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown -R holyeyes /Users/holyeyes/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools for Xcode-16.2
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ for\ Xcode-16.2
Software Update ToolFinding available softwareDownloading Command Line Tools for Xcode
Downloaded Command Line Tools for Xcode
Installing Command Line Tools for XcodeDone with Command Line Tools for Xcode
Done.
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Downloading and installing Homebrew...
remote: Enumerating objects: 304569, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (68/68), done.remote: Total 304569 (delta 57), reused 87 (delta 43), pack-reused 304458 (from 2)
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (33/33), done.
remote: Total 55 (delta 33), reused 33 (delta 33), pack-reused 22 (from 1)
==> Updating Homebrew...
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:fd162df7a06190ee800a9e6afd28f4466d33548821a480ba043cd927b44d60f7
######################################################################### 100.0%
==> Pouring portable-ruby-3.4.4.arm64_big_sur.bottle.tar.gz
==> /usr/bin/sudo /bin/mkdir -p /etc/paths.d
Password:
Sorry, try again.
Password:
==> /usr/bin/sudo tee /etc/paths.d/homebrew
/opt/homebrew/bin
==> /usr/bin/sudo /usr/sbin/chown root:wheel /etc/paths.d/homebrew
==> Installation successful!==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).==> Homebrew is run entirely by unpaid volunteers. Please consider donating:https://github.com/Homebrew/brew#donations==> Next steps:
- Run these commands in your terminal to add Homebrew to your PATH:echo >> /Users/holyeyes/.zprofileecho 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/holyeyes/.zprofileeval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:https://docs.brew.shholyeyes@holyeyesdeMini ~ % brew
zsh: command not found: brew
holyeyes@holyeyesdeMini ~ %     echo >> /Users/holyeyes/.zprofileecho 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/holyeyes/.zprofileeval "$(/opt/homebrew/bin/brew shellenv)"
holyeyes@holyeyesdeMini ~ % brew
Example usage:brew search TEXT|/REGEX/brew info [FORMULA|CASK...]brew install FORMULA|CASK...brew updatebrew upgrade [FORMULA|CASK...]brew uninstall FORMULA|CASK...brew list [FORMULA|CASK...]Troubleshooting:brew configbrew doctorbrew install --verbose --debug FORMULA|CASKContributing:brew create URL [--no-fetch]brew edit [FORMULA|CASK...]Further help:brew commandsbrew help [COMMAND]man brewhttps://docs.brew.sh
holyeyes@holyeyesdeMini ~ % 
2 python

当您进行科学计算时,功能和python。因此,在这种情况下,安装一个较旧的版本是安全的。
因此,对于本书,我在所有版本(例如3.10、11、12)上进行了测试,也可以很好地效果。
但是要安全起见,这是一般的经验法则。我建议安装稍低或较小的版本,例如3.11或类似版本。

holyeyes@holyeyesdeMini ~ % brew install python@3.11
==> Downloading https://formulae.brew.sh/api/formula.jws.json
==> Downloading https://formulae.brew.sh/api/cask.jws.json
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.11/manifests/3.11.13
######################################################################### 100.0%
==> Fetching dependencies for python@3.11: mpdecimal, ca-certificates, openssl@3, readline, sqlite and xz
==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/manifests/4.0.1
######################################################################### 100.0%
==> Fetching mpdecimal
==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/blobs/sha256:e21da583
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2025-
######################################################################### 100.0%
==> Fetching ca-certificates
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:dd
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.5.0
######################################################################### 100.0%
==> Fetching openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:7bbac0e8
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/readline/manifests/8.2.13
######################################################################### 100.0%
==> Fetching readline
==> Downloading https://ghcr.io/v2/homebrew/core/readline/blobs/sha256:738c27cee
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.50.1
######################################################################### 100.0%
==> Fetching sqlite
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:13d6403cd7d
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/xz/manifests/5.8.1
######################################################################### 100.0%
==> Fetching xz
==> Downloading https://ghcr.io/v2/homebrew/core/xz/blobs/sha256:dcd7823f2624cbc
######################################################################### 100.0%
==> Fetching python@3.11
==> Downloading https://ghcr.io/v2/homebrew/core/python/3.11/blobs/sha256:cab6ab
######################################################################### 100.0%
==> Installing dependencies for python@3.11: mpdecimal, ca-certificates, openssl@3, readline, sqlite and xz
==> Installing python@3.11 dependency: mpdecimal
==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/manifests/4.0.1
Already downloaded: /Users/holyeyes/Library/Caches/Homebrew/downloads/dbbf60721dc54b6215f6c0988496331d4110a2a358da867a1129cd84b8166b31--mpdecimal-4.0.1.bottle_manifest.json
==> Pouring mpdecimal--4.0.1.arm64_sequoia.bottle.tar.gz
🍺  /opt/homebrew/Cellar/mpdecimal/4.0.1: 22 files, 645.6KB
==> Installing python@3.11 dependency: ca-certificates
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2025-
Already downloaded: /Users/holyeyes/Library/Caches/Homebrew/downloads/bc18acc15e0abddc102f828b57a29cfdbec1b6b002db37ad12bad9dbf0e9d12f--ca-certificates-2025-05-20.bottle_manifest.json
==> Pouring ca-certificates--2025-05-20.all.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺  /opt/homebrew/Cellar/ca-certificates/2025-05-20: 4 files, 225.8KB
==> Installing python@3.11 dependency: openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.5.0
Already downloaded: /Users/holyeyes/Library/Caches/Homebrew/downloads/d3c8243df37f69247721b1d8a6c51e1a8afd6664b832423921ffd99bb2bb381a--openssl@3-3.5.0.bottle_manifest.json
==> Pouring openssl@3--3.5.0.arm64_sequoia.bottle.tar.gz
🍺  /opt/homebrew/Cellar/openssl@3/3.5.0: 7,563 files, 35.4MB
==> Installing python@3.11 dependency: readline
==> Downloading https://ghcr.io/v2/homebrew/core/readline/manifests/8.2.13
Already downloaded: /Users/holyeyes/Library/Caches/Homebrew/downloads/aa1afa38997a2866d91c81fdda8b36d436cd4ea7a82aed07d13c83c56eb3460e--readline-8.2.13.bottle_manifest.json
==> Pouring readline--8.2.13.arm64_sequoia.bottle.tar.gz
🍺  /opt/homebrew/Cellar/readline/8.2.13: 51 files, 1.7MB
==> Installing python@3.11 dependency: sqlite
==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.50.1
Already downloaded: /Users/holyeyes/Library/Caches/Homebrew/downloads/a40fe78724db12f47a20638d2ac82e7057f6f1f425ea185cb180dd97df08cb2e--sqlite-3.50.1.bottle_manifest.json
==> Pouring sqlite--3.50.1.arm64_sequoia.bottle.tar.gz
🍺  /opt/homebrew/Cellar/sqlite/3.50.1: 13 files, 4.9MB
==> Installing python@3.11 dependency: xz
==> Downloading https://ghcr.io/v2/homebrew/core/xz/manifests/5.8.1
Already downloaded: /Users/holyeyes/Library/Caches/Homebrew/downloads/86a115cc1d43ff8a480fd907f812e70a403e1675d8a7223f61bbb08cbd2adc27--xz-5.8.1.bottle_manifest.json
==> Pouring xz--5.8.1.arm64_sequoia.bottle.tar.gz
🍺  /opt/homebrew/Cellar/xz/5.8.1: 96 files, 2.5MB
==> Installing python@3.11
==> Pouring python@3.11--3.11.13.arm64_sequoia.bottle.tar.gz
==> /opt/homebrew/Cellar/python@3.11/3.11.13/bin/python3.11 -Im ensurepip
==> /opt/homebrew/Cellar/python@3.11/3.11.13/bin/python3.11 -Im pip install -v -
==> Caveats
Python is installed as/opt/homebrew/bin/python3.11Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to
`python3.11`, `python3.11-config`, `pip3.11` etc., respectively, are installed into/opt/homebrew/opt/python@3.11/libexec/binYou can install Python packages withpip3.11 install <package>
They will install into the site-package directory/opt/homebrew/lib/python3.11/site-packagestkinter is no longer included with this formula, but it is available separately:brew install python-tk@3.11gdbm (`dbm.gnu`) is no longer included in this formula, but it is available separately:brew install python-gdbm@3.11
`dbm.ndbm` changed database backends in Homebrew Python 3.11.
If you need to read a database from a previous Homebrew Python created via `dbm.ndbm`,
you'll need to read your database using the older version of Homebrew Python and convert to another format.
`dbm` still defaults to `dbm.gnu` when it is installed.If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH:brew install python3For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python
==> Summary
🍺  /opt/homebrew/Cellar/python@3.11/3.11.13: 3,306 files, 62.1MB
==> Running `brew cleanup python@3.11`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> python@3.11
Python is installed as/opt/homebrew/bin/python3.11Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to
`python3.11`, `python3.11-config`, `pip3.11` etc., respectively, are installed into/opt/homebrew/opt/python@3.11/libexec/binYou can install Python packages withpip3.11 install <package>
They will install into the site-package directory/opt/homebrew/lib/python3.11/site-packagestkinter is no longer included with this formula, but it is available separately:brew install python-tk@3.11gdbm (`dbm.gnu`) is no longer included in this formula, but it is available separately:brew install python-gdbm@3.11
`dbm.ndbm` changed database backends in Homebrew Python 3.11.
If you need to read a database from a previous Homebrew Python created via `dbm.ndbm`,
you'll need to read your database using the older version of Homebrew Python and convert to another format.
`dbm` still defaults to `dbm.gnu` when it is installed.If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH:brew install python3For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python
holyeyes@holyeyesdeMini ~ % python3
Python 3.9.6 (default, Nov 11 2024, 03:15:38) 
[Clang 16.0.0 (clang-1600.0.26.6)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>> quit()
holyeyes@holyeyesdeMini ~ %     
3 uv

最近有一个名为UV的新软件包,这是一个本质上提供与PIP相同或相似的语法,但也具有一些优势,并且非常快。所以我最近也搬到了只使用UV因为它快得多,这是一个非常精心设计的软件包经理。
您可以通过PIP安装UV安装它。

holyeyes@holyeyesdeMini ~ % pip3.11 install uv
Collecting uvDownloading uv-0.7.16-py3-none-macosx_11_0_arm64.whl.metadata (11 kB)
Downloading uv-0.7.16-py3-none-macosx_11_0_arm64.whl (16.4 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.4/16.4 MB 11.4 MB/s eta 0:00:00
Installing collected packages: uv
Successfully installed uv-0.7.16
holyeyes@holyeyesdeMini ~ % 
4 创建虚拟环境。

这不是严格必要的,但我强烈建议您这样做。这意味着虚拟环境意味着它是计算机上的单独文件夹
安装所有软件包的位置。在这种情况下,它还将带来自己的Python版本。这意味着,如果您偶然地弄乱了任何东西,则可以删除此虚拟环境然后重新开始,您知道,将整个计算机弄乱。因此,这实际上是我强烈推荐的。
因此,让我在这里实际下载此GitHub代码。所以我去我的github存储库然后您可以单击下载zip,它将在这种情况下将其下载到下载文件夹。让我打开,然后让我将其拖到桌面上,因为它更容易看到。
因此,我现在有了,我可以进入这里,您可以看到该文件夹 的内容在这里与Github上显示的内容相同。

(holyeyes) holyeyes@holyeyesdeMini ~ % cd Desktop 
(holyeyes) holyeyes@holyeyesdeMini Desktop % ls
LLMs-from-scratch-main
(holyeyes) holyeyes@holyeyesdeMini Desktop % cd LLMs-from-scratch-main 
(holyeyes) holyeyes@holyeyesdeMini LLMs-from-scratch-main % ls
CITATION.cff		ch01			ch07
LICENSE.txt		ch02			pixi.toml
README.md		ch03			pkg
appendix-A		ch04			pyproject.toml
appendix-D		ch05			requirements.txt
appendix-E		ch06			setup
(holyeyes) holyeyes@holyeyesdeMini LLMs-from-scratch-main % uv venv --python=python3.11
Using CPython 3.11.13 interpreter at: /opt/homebrew/opt/python@3.11/bin/python3.11
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
(holyeyes) holyeyes@holyeyesdeMini LLMs-from-scratch-main % ls -al
total 104
drwxrwxr-x@ 23 holyeyes  staff    736  6 28 15:03 .
drwx------+  5 holyeyes  staff    160  6 28 14:39 ..
drwxrwxr-x@  4 holyeyes  staff    128  6 28 08:28 .github
-rw-rw-r--@  1 holyeyes  staff   8112  6 28 08:28 .gitignore
drwxr-xr-x   7 holyeyes  staff    224  6 28 15:03 .venv
-rw-rw-r--@  1 holyeyes  staff    746  6 28 08:28 CITATION.cff
-rw-rw-r--@  1 holyeyes  staff  11507  6 28 08:28 LICENSE.txt
-rw-rw-r--@  1 holyeyes  staff  14184  6 28 08:28 README.md
drwxrwxr-x@  5 holyeyes  staff    160  6 28 08:28 appendix-A
drwxrwxr-x@  4 holyeyes  staff    128  6 28 08:28 appendix-D
drwxrwxr-x@  4 holyeyes  staff    128  6 28 08:28 appendix-E
drwxrwxr-x@  3 holyeyes  staff     96  6 28 08:28 ch01
drwxrwxr-x@  8 holyeyes  staff    256  6 28 08:28 ch02
drwxrwxr-x@  6 holyeyes  staff    192  6 28 08:28 ch03
drwxrwxr-x@  6 holyeyes  staff    192  6 28 08:28 ch04
drwxrwxr-x@ 14 holyeyes  staff    448  6 28 08:28 ch05
drwxrwxr-x@  7 holyeyes  staff    224  6 28 08:28 ch06
drwxrwxr-x@  9 holyeyes  staff    288  6 28 08:28 ch07
-rw-rw-r--@  1 holyeyes  staff   1166  6 28 08:28 pixi.toml
drwxrwxr-x@  3 holyeyes  staff     96  6 28 08:28 pkg
-rw-rw-r--@  1 holyeyes  staff   1003  6 28 08:28 pyproject.toml
-rw-rw-r--@  1 holyeyes  staff    457  6 28 08:28 requirements.txt
drwxrwxr-x@  8 holyeyes  staff    256  6 28 08:28 setup
(holyeyes) holyeyes@holyeyesdeMini LLMs-from-scratch-main % source .venv/bin/activate
(LLMs-from-scratch-main) holyeyes@holyeyesdeMini LLMs-from-scratch-main % 

现在,让我创建这个虚拟环境,这样就有这个命令。我只是向你展示了这个命令中的位置。因此,这将创建一个虚拟环境,让我们使用Python,假设3.11。这将创建一个名为VENVE的文件夹。我们可以仔细检查。现在在这里,它有自己的版本的Python。因此,如果我们搞砸了任何东西,那实际上不是问题。我们可以删除此文件夹,然后我们应该能够再次将其设置。因此,我的意思是,如果我们以后搞砸了,可以将其删除,然后像这样重新创建它。

现在,我还想说的还有一件事,您也可能看不到此文件夹.因为它以dot和文件夹的文件开头,默认情况下以dot开头
在发现者中。因此,有一个发现器选项必须使您不可见.可见文件和文件夹。但是在这里可以说是可见的。一旦您创建了此通风夹文件夹,下一步将激活此功能。因此创建虚拟环境.除非删除,否则您只需要做一次。但是每次您使用它时,您激活它。所以现在这很活跃,当我输入python时,我可以输入python,这是并向您显示您使用的Python版本。

您可以看到它正在执行Python时现在正在使用。它正在使用我的虚拟环境中使用此Python。因此,让我从这里的这条路做这个Python 3.11。同样,我可以删除此。因此,让我摆脱这种类型的Python版本。它不会可用,因为我只是删除了它,因此在这种情况下,我们有一个虚拟环境,该环境非常具体
如果我们搞砸了,我们可以重新开始

(LLMs-from-scratch-main) holyeyes@holyeyesdeMini LLMs-from-scratch-main % which python
/Users/holyeyes/Desktop/LLMs-from-scratch-main/.venv/bin/python
(LLMs-from-scratch-main) holyeyes@holyeyesdeMini LLMs-from-scratch-main % python --version
Python 3.11.13
(LLMs-from-scratch-main) holyeyes@holyeyesdeMini LLMs-from-scratch-main % 

在Github上也是如此。查看,有一个要求。它列出了最新的.在运行本书所需的包裹中。因此,如果您做PIP或UV PIP,安装减去R,您可以像这样一次安装所有包装。是的,因此,这样,如果我们完成了,您不必做任何其他事情。这应该安装所有软件包,您需要这本书。

(LLMs-from-scratch-main) holyeyes@holyeyesdeMini LLMs-from-scratch-main % uv pip install -r requirements.txt
Resolved 138 packages in 1.97s
Prepared 138 packages in 59.55s
Installed 138 packages in 779ms+ absl-py==2.3.0+ anyio==4.9.0+ appnope==0.1.4+ argon2-cffi==25.1.0+ argon2-cffi-bindings==21.2.0+ arrow==1.3.0+ asttokens==3.0.0+ astunparse==1.6.3+ async-lru==2.0.5+ attrs==25.3.0+ babel==2.17.0+ beautifulsoup4==4.13.4+ bleach==6.2.0+ certifi==2025.6.15+ cffi==1.17.1+ charset-normalizer==3.4.2+ comm==0.2.2+ contourpy==1.3.2+ cycler==0.12.1+ debugpy==1.8.14+ decorator==5.2.1+ defusedxml==0.7.1+ executing==2.2.0+ fastjsonschema==2.21.1+ filelock==3.18.0+ flatbuffers==25.2.10+ fonttools==4.58.4+ fqdn==1.5.1+ fsspec==2025.5.1+ gast==0.6.0+ google-pasta==0.2.0+ grpcio==1.73.1+ h11==0.16.0+ h5py==3.14.0+ httpcore==1.0.9+ httpx==0.28.1+ idna==3.10+ ipykernel==6.29.5+ ipython==9.3.0+ ipython-pygments-lexers==1.1.1+ isoduration==20.11.0+ jedi==0.19.2+ jinja2==3.1.6+ json5==0.12.0+ jsonpointer==3.0.0+ jsonschema==4.24.0+ jsonschema-specifications==2025.4.1+ jupyter-client==8.6.3+ jupyter-core==5.8.1+ jupyter-events==0.12.0+ jupyter-lsp==2.2.5+ jupyter-server==2.16.0+ jupyter-server-terminals==0.5.3+ jupyterlab==4.4.3+ jupyterlab-pygments==0.3.0+ jupyterlab-server==2.27.3+ keras==3.10.0+ kiwisolver==1.4.8+ libclang==18.1.1+ markdown==3.8.2+ markdown-it-py==3.0.0+ markupsafe==3.0.2+ matplotlib==3.10.3+ matplotlib-inline==0.1.7+ mdurl==0.1.2+ mistune==3.1.3+ ml-dtypes==0.5.1+ mpmath==1.3.0+ namex==0.1.0+ nbclient==0.10.2+ nbconvert==7.16.6+ nbformat==5.10.4+ nest-asyncio==1.6.0+ networkx==3.5+ notebook-shim==0.2.4+ numpy==2.0.2+ opt-einsum==3.4.0+ optree==0.16.0+ overrides==7.7.0+ packaging==25.0+ pandas==2.3.0+ pandocfilters==1.5.1+ parso==0.8.4+ pexpect==4.9.0+ pillow==11.2.1+ platformdirs==4.3.8+ prometheus-client==0.22.1+ prompt-toolkit==3.0.51+ protobuf==5.29.5+ psutil==7.0.0+ ptyprocess==0.7.0+ pure-eval==0.2.3+ pycparser==2.22+ pygments==2.19.2+ pyparsing==3.2.3+ python-dateutil==2.9.0.post0+ python-json-logger==3.3.0+ pytz==2025.2+ pyyaml==6.0.2+ pyzmq==27.0.0+ referencing==0.36.2+ regex==2024.11.6+ requests==2.32.4+ rfc3339-validator==0.1.4+ rfc3986-validator==0.1.1+ rich==14.0.0+ rpds-py==0.25.1+ send2trash==1.8.3+ setuptools==80.9.0+ six==1.17.0+ sniffio==1.3.1+ soupsieve==2.7+ stack-data==0.6.3+ sympy==1.14.0+ tensorboard==2.19.0+ tensorboard-data-server==0.7.2+ tensorflow==2.19.0+ tensorflow-io-gcs-filesystem==0.37.1+ termcolor==3.1.0+ terminado==0.18.1+ tiktoken==0.9.0+ tinycss2==1.4.0+ torch==2.7.1+ tornado==6.5.1+ tqdm==4.67.1+ traitlets==5.14.3+ types-python-dateutil==2.9.0.20250516+ typing-extensions==4.14.0+ tzdata==2025.2+ uri-template==1.3.0+ urllib3==2.5.0+ wcwidth==0.2.13+ webcolors==24.11.1+ webencodings==0.5.1+ websocket-client==1.8.0+ werkzeug==3.1.3+ wheel==0.45.1+ wrapt==1.17.2
(LLMs-from-scratch-main) holyeyes@holyeyesdeMini LLMs-from-scratch-main % 
5 我们可以进行UV跑步并打开新的Jupyter Lab环境。

Jupyter Lab是打开Jupyter笔记本电脑的一种方式。默认情况下,这将打开主浏览器。然后,是的,我们可以为不同章节打开代码,例如或者我们可以制作新笔记本。这就是当您关注这本书时,我建议这样做,要么要制作新笔记本并在此处运行代码,或另一件事,因为您可以打开现有笔记本.

(LLMs-from-scratch-main) holyeyes@holyeyesdeMini LLMs-from-scratch-main % jupyter lab
[I 2025-06-28 15:27:26.031 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2025-06-28 15:27:26.032 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2025-06-28 15:27:26.033 ServerApp] jupyterlab | extension was successfully linked.
[I 2025-06-28 15:27:26.034 ServerApp] Writing Jupyter server cookie secret to /Users/holyeyes/Library/Jupyter/runtime/jupyter_cookie_secret
[I 2025-06-28 15:27:26.715 ServerApp] notebook_shim | extension was successfully linked.
[I 2025-06-28 15:27:26.750 ServerApp] notebook_shim | extension was successfully loaded.
[I 2025-06-28 15:27:26.750 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2025-06-28 15:27:26.751 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2025-06-28 15:27:26.752 LabApp] JupyterLab extension loaded from /Users/holyeyes/Desktop/LLMs-from-scratch-main/.venv/lib/python3.11/site-packages/jupyterlab
[I 2025-06-28 15:27:26.752 LabApp] JupyterLab application directory is /Users/holyeyes/Desktop/LLMs-from-scratch-main/.venv/share/jupyter/lab
[I 2025-06-28 15:27:26.752 LabApp] Extension Manager is 'pypi'.
[I 2025-06-28 15:27:26.799 ServerApp] jupyterlab | extension was successfully loaded.
[I 2025-06-28 15:27:26.800 ServerApp] Serving notebooks from local directory: /Users/holyeyes/Desktop/LLMs-from-scratch-main
[I 2025-06-28 15:27:26.800 ServerApp] Jupyter Server 2.16.0 is running at:
[I 2025-06-28 15:27:26.800 ServerApp] http://localhost:8888/lab?token=81066349d6be305205d06814be3bf586c4ea6a30b2f1a607
[I 2025-06-28 15:27:26.800 ServerApp]     http://127.0.0.1:8888/lab?token=81066349d6be305205d06814be3bf586c4ea6a30b2f1a607
[I 2025-06-28 15:27:26.800 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2025-06-28 15:27:26.806 ServerApp] To access the server, open this file in a browser:file:///Users/holyeyes/Library/Jupyter/runtime/jpserver-14816-open.htmlOr copy and paste one of these URLs:http://localhost:8888/lab?token=81066349d6be305205d06814be3bf586c4ea6a30b2f1a607http://127.0.0.1:8888/lab?token=81066349d6be305205d06814be3bf586c4ea6a30b2f1a607
[I 2025-06-28 15:27:26.815 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[W 2025-06-28 15:27:28.817 LabApp] Could not determine jupyterlab build status without nodejs
http://www.lqws.cn/news/561295.html

相关文章:

  • 人大金仓数据库jdbc连接jar包kingbase8-8.6.0.jar驱动包最新版下载(不需要积分)
  • 5G核心网,NAS短消息的实现
  • 可编程逻辑器件的发展与比较
  • 构建 AI 系统的 4 大 Agentic AI 设计模式
  • Python 可迭代的对象、迭代器 和生成器(何时使用生成器表达式)
  • 2099. 找到和最大的长度为 K 的子序列
  • 第6篇:中间件——Gin的请求处理管道
  • 大事件项目记录10-文章分类接口开发-更新文章分类
  • AtCoder AT_abc412_c [ABC412C] Giant Domino 题解
  • JavaEE:CAS单点登录
  • 数据结构1 ——数据结构的基本概念+一点点算法
  • 表达式求值
  • Brocade 博科交换机配置带外管理IP
  • 【unity游戏开发——网络】网络协议、TCP vs UDP 本质区别
  • 第九节:Vben Admin 最新 v5.0 (vben5) 快速入门 - 菜单管理(上)
  • AI间对话APK制成
  • Centos 8设置固定IP
  • STM32中Usart的使用
  • WordPress最新版6.8.1安装教程
  • 前缀和 + 哈希表
  • NV046NV060美光固态闪存NV061NV063
  • 从用户到权限:解密 AWS IAM Identity Center 的授权之道
  • Linux更改国内镜像源
  • ZooKeeper深度面试指南三
  • Hadoop集群异常:两个NameNode全部为StandBy状态
  • 【中文核心期刊推荐】《计算机工程与设计》
  • linux学习第26天(信号集)
  • llm 基本案例实现
  • 从OCR瓶颈到结构化理解来有效提升RAG的效果
  • C++ - 浅看vector源码