【NLP笔记】开源MOSS对话语言模型安装实测

本文档详细记录了在Python 3.8环境下安装和运行开源MOSS对话语言模型的步骤,包括创建环境、安装Pytorch 1.13.1 + CUDA 11.7、TensorFlow 2.12.0,以及处理安装过程中遇到的AttributeError和ModuleNotFoundError等错误。实测过程还包括模型下载和通过GUI进行交互。
部署运行你感兴趣的模型镜像

1、 运行环境

1.1 创建python 3.8环境

conda create -n py38 python=3.8

(base) xf@VP01:~/ai/nlp$ conda create -n py38 python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/xf/anaconda3/envs/py38

  added / updated specs:
    - python=3.8


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pip-23.0.1                 |   py38h06a4308_0         2.5 MB  defaults
    python-3.8.16              |       h7a1cb2a_3        23.7 MB  defaults
    setuptools-66.0.0          |   py38h06a4308_0         1.2 MB  defaults
    wheel-0.38.4               |   py38h06a4308_0          63 KB  defaults
    ------------------------------------------------------------
                                           Total:        27.4 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      anaconda/pkgs/main/linux-64::_libgcc_mutex-0.1-main
  _openmp_mutex      anaconda/pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu
  ca-certificates    anaconda/pkgs/main/linux-64::ca-certificates-2023.01.10-h06a4308_0
  ld_impl_linux-64   anaconda/pkgs/main/linux-64::ld_impl_linux-64-2.38-h1181459_1
  libffi             anaconda/pkgs/main/linux-64::libffi-3.4.2-h6a678d5_6
  libgcc-ng          anaconda/pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1
  libgomp            anaconda/pkgs/main/linux-64::libgomp-11.2.0-h1234567_1
  libstdcxx-ng       anaconda/pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1
  ncurses            anaconda/pkgs/main/linux-64::ncurses-6.4-h6a678d5_0
  openssl            anaconda/pkgs/main/linux-64::openssl-1.1.1t-h7f8727e_0
  pip                anaconda/pkgs/main/linux-64::pip-23.0.1-py38h06a4308_0
  python             anaconda/pkgs/main/linux-64::python-3.8.16-h7a1cb2a_3
  readline           anaconda/pkgs/main/linux-64::readline-8.2-h5eee18b_0
  setuptools         anaconda/pkgs/main/linux-64::setuptools-66.0.0-py38h06a4308_0
  sqlite             anaconda/pkgs/main/linux-64::sqlite-3.41.2-h5eee18b_0
  tk                 anaconda/pkgs/main/linux-64::tk-8.6.12-h1ccaba5_0
  wheel              anaconda/pkgs/main/linux-64::wheel-0.38.4-py38h06a4308_0
  xz                 anaconda/pkgs/main/linux-64::xz-5.2.10-h5eee18b_1
  zlib               anaconda/pkgs/main/linux-64::zlib-1.2.13-h5eee18b_0


Proceed ([y]/n)? y


Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate py38
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) xf@VP01:~/ai/nlp$ conda activate py38
(py38) xf@VP01:~/ai/nlp$

1.2 安装MOSS

1.2.1 从仓库下载MOSS到本地

git clone https://github.com/OpenLMLab/MOSS.git

(py38) xf@VP01:~/ai/nlp$ git clone https://github.com/OpenLMLab/MOSS.git
Cloning into 'MOSS'...
remote: Enumerating objects: 1590, done.
remote: Counting objects: 100% (186/186), done.
remote: Compressing objects: 100% (104/104), done.
Receiving objects: 100% (1590/1590), 40.20 MiB | 60.00 KiB/s, done.
remote: Total 1590 (delta 100), reused 145 (delta 82), pack-reused 1404
Resolving deltas: 100% (675/675), done.
Updating files: 100% (1157/1157), done.
(py38) xf@VP01:~/ai/nlp$ cd moss
(py38) xf@VP01:~/ai/nlp/MOSS$ 

1.2.2 安装依赖

pip install -r requirements.txt

(moss) xf@VP01:~/ai/nlp$ pip install -r requirements.txt
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
Collecting torch==1.10.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/98/63/b2e68b08a43ee4acdb109ff7701c26a5a323d258cd20ca70bb8a69a6fd97/torch-1.10.1-cp38-cp38-manylinux1_x86_64.whl (881.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 881.9/881.9 MB 70.4 MB/s eta 0:00:00
Collecting transformers==4.25.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/90/5b/02becd3e137fdacdc30c6442d04094d0b92e500f978df00b1a197b68fd2b/transformers-4.25.1-py3-none-any.whl (5.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.8/5.8 MB 77.3 MB/s eta 0:00:00
Collecting sentencepiece
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ca/37/f0469a6f2a6a59074561d2214effec23ad9a2deac74cce467027f32167b4/sentencepiece-0.1.98-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 86.2 MB/s eta 0:00:00
Collecting datasets
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/48/b7/6190994c06fb2cee1ff25c4326312a5c38c20e721424c332195f65af5190/datasets-2.11.0-py3-none-any.whl (468 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.7/468.7 kB 140.6 MB/s eta 0:00:00
Collecting accelerate
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e7/87/25dd46811431cfc5e8d6ba8c80758cb3131574b271fbf06cf1b691dba8d4/accelerate-0.18.0-py3-none-any.whl (215 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 215.3/215.3 kB 194.0 MB/s eta 0:00:00
Collecting matplotlib
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5d/22/f55638bea4af17edf23e1c919ad5d256141bbeec0196c450be9785f1dcb6/matplotlib-3.7.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (9.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.2/9.2 MB 72.0 MB/s eta 0:00:00
Collecting huggingface_hub
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/df/90/5ad98abead047169f4f86bc67e99020c841d71c9c6bd202e04af71e70e53/huggingface_hub-0.13.4-py3-none-any.whl (200 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 200.1/200.1 kB 281.3 MB/s eta 0:00:00
Requirement already satisfied: typing-extensions in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from torch==1.10.1->-r requirements.txt (line 1)) (4.5.0)
Collecting tokenizers!=0.11.3,<0.14,>=0.11.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/4e/f2/017bf57106b845e31ef6179bf204042720a53629cf599ef9464da990e0e5/tokenizers-0.13.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 75.1 MB/s eta 0:00:00
Requirement already satisfied: filelock in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from transformers==4.25.1->-r requirements.txt (line 2)) (3.12.0)
Requirement already satisfied: numpy>=1.17 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from transformers==4.25.1->-r requirements.txt (line 2)) (1.23.5)
Collecting pyyaml>=5.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d7/42/7ad4b6d67a16229496d4f6e74201bdbebcf4bc1e87d5a70c9297d4961bd2/PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 701.2/701.2 kB 99.5 MB/s eta 0:00:00
Collecting regex!=2019.12.17
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/74/71/abf5df0be7a29b6920d4ae85eb685584afbe84610631b70fe366b2857801/regex-2023.3.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (771 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 771.9/771.9 kB 94.1 MB/s eta 0:00:00
Requirement already satisfied: packaging>=20.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from transformers==4.25.1->-r requirements.txt (line 2)) (23.1)
Requirement already satisfied: requests in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from transformers==4.25.1->-r requirements.txt (line 2)) (2.28.1)
Collecting tqdm>=4.27
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e6/02/a2cff6306177ae6bc73bc0665065de51dfb3b9db7373e122e2735faf0d97/tqdm-4.65.0-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 202.6 MB/s eta 0:00:00
Collecting dill<0.3.7,>=0.3.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/be/e3/a84bf2e561beed15813080d693b4b27573262433fced9c1d1fea59e60553/dill-0.3.6-py3-none-any.whl (110 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 110.5/110.5 kB 252.5 MB/s eta 0:00:00
Collecting pandas
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/23/c0/4b71d4a9fbfe2fbe3e379bebc22bc935e4d09b7802899a5ac1b90bf090bb/pandas-2.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.3/12.3 MB 69.5 MB/s eta 0:00:00
Collecting fsspec[http]>=2021.11.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d6/30/db3078afe553e9a07c87534cbfb87a8c8ebb083fa0a8847ca5bdc86b51a7/fsspec-2023.4.0-py3-none-any.whl (153 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 154.0/154.0 kB 306.6 MB/s eta 0:00:00
Collecting aiohttp
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d2/e5/cef5eeb11d7e8bac830b3bee1c8311b19bf8e8a1c45fe14b876c70adcd06/aiohttp-3.8.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 96.2 MB/s eta 0:00:00
Collecting multiprocess
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/13/95/8b875a678c6f9db81809dd5d6032e9f8628426e37f6aa6b7d404ba582de1/multiprocess-0.70.14-py38-none-any.whl (132 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.0/132.0 kB 85.7 MB/s eta 0:00:00
Collecting pyarrow>=8.0.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5d/91/708bcf6e636fc4f1a07bdb704c0a320bafe9b83919cd501648307b31f555/pyarrow-11.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (35.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.0/35.0 MB 69.4 MB/s eta 0:00:00
Collecting responses<0.19
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/79/f3/2b3a6dc5986303b3dd1bbbcf482022acb2583c428cd23f0b6d37b1a1a519/responses-0.18.0-py3-none-any.whl (38 kB)
Collecting xxhash
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1a/d7/a42f83d34d4999321e06ca273f5e7bf7fa177154e29e0bfe455f3c66648d/xxhash-3.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (213 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 213.0/213.0 kB 94.8 MB/s eta 0:00:00
Collecting psutil
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/af/4d/389441079ecef400e2551a3933224885a7bde6b8a4810091d628cdd75afe/psutil-5.9.5-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (282 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 282.1/282.1 kB 133.6 MB/s eta 0:00:00
Requirement already satisfied: pillow>=6.2.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from matplotlib->-r requirements.txt (line 6)) (9.4.0)
Collecting importlib-resources>=3.2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/38/71/c13ea695a4393639830bf96baea956538ba7a9d06fcce7cef10bfff20f72/importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting fonttools>=4.22.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/16/07/1c7547e27f559ec078801d522cc4d5127cdd4ef8e831c8ddcd9584668a07/fonttools-4.39.3-py3-none-any.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 86.4 MB/s eta 0:00:00
Collecting cycler>=0.10
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5c/f9/695d6bedebd747e5eb0fe8fad57b72fdf25411273a39791cde838d5a8f51/cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting contourpy>=1.0.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8e/d2/38b3da76c0a654dac29f7768a870b930be9a0d35fb469acb86f8d0aaeb54/contourpy-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (300 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 300.0/300.0 kB 57.6 MB/s eta 0:00:00
Collecting kiwisolver>=1.0.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/86/7a/6b438da7534dacd232ed4e19f74f4edced2cda9494d7e6536f54edfdf4a5/kiwisolver-1.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 86.2 MB/s eta 0:00:00
Collecting pyparsing>=2.3.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6c/10/a7d0fa5baea8fe7b50f448ab742f26f52b80bfca85ac2be9d35cdd9a3246/pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 221.3 MB/s eta 0:00:00
Collecting python-dateutil>=2.7
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 284.2 MB/s eta 0:00:00
Collecting aiosignal>=1.1.2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/76/ac/a7305707cb852b7e16ff80eaf5692309bde30e2b1100a1fcacdc8f731d97/aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d6/c1/8991e7c5385b897b8c020cdaad718c5b087a6626d1d11a23e1ea87e325a7/async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting attrs>=17.3.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f0/eb/fcb708c7bf5056045e9e98f62b93bd7467eb718b0202e7698eb11d66416c/attrs-23.1.0-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 120.7 MB/s eta 0:00:00
Collecting yarl<2.0,>=1.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d5/ec/b79d97ac390e5f658839cfea6a7a55202c10fc0f7c4d570f5c150602bdb0/yarl-1.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (266 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 266.8/266.8 kB 58.3 MB/s eta 0:00:00
Collecting frozenlist>=1.1.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ec/ab/a440db757401a1e8863c9abb374a77cb2884eda74ffbf555dedcf1fbe7f6/frozenlist-1.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.3/161.3 kB 94.5 MB/s eta 0:00:00
Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->datasets->-r requirements.txt (line 4)) (2.0.4)
Collecting multidict<7.0,>=4.5
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fe/0c/8469202f8f4b0e65816f91c3febc4bda7316c995b59ecdf3b15c574f7a24/multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.3/121.3 kB 164.6 MB/s eta 0:00:00
Requirement already satisfied: zipp>=3.1.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from importlib-resources>=3.2.0->matplotlib->-r requirements.txt (line 6)) (3.15.0)
Requirement already satisfied: six>=1.5 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from python-dateutil>=2.7->matplotlib->-r requirements.txt (line 6)) (1.16.0)
Requirement already satisfied: certifi>=2017.4.17 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from requests->transformers==4.25.1->-r requirements.txt (line 2)) (2022.12.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from requests->transformers==4.25.1->-r requirements.txt (line 2)) (1.26.15)
Requirement already satisfied: idna<4,>=2.5 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from requests->transformers==4.25.1->-r requirements.txt (line 2)) (3.4)
Collecting pytz>=2020.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7f/99/ad6bd37e748257dd70d6f85d916cafe79c0b0f5e2e95b11f7fbc82bf3110/pytz-2023.3-py2.py3-none-any.whl (502 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 502.3/502.3 kB 152.1 MB/s eta 0:00:00
Collecting tzdata>=2022.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d5/fb/a79efcab32b8a1f1ddca7f35109a50e4a80d42ac1c9187ab46522b2407d7/tzdata-2023.3-py2.py3-none-any.whl (341 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 341.8/341.8 kB 150.6 MB/s eta 0:00:00
Installing collected packages: tokenizers, sentencepiece, pytz, xxhash, tzdata, tqdm, torch, regex, pyyaml, python-dateutil, pyparsing, pyarrow, psutil, multidict, kiwisolver, importlib-resources, fsspec, frozenlist, fonttools, dill, cycler, contourpy, attrs, async-timeout, yarl, responses, pandas, multiprocess, matplotlib, huggingface_hub, aiosignal, accelerate, transformers, aiohttp, datasets
  Attempting uninstall: torch
    Found existing installation: torch 1.13.1
    Uninstalling torch-1.13.1:
      Successfully uninstalled torch-1.13.1
Successfully installed accelerate-0.18.0 aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 attrs-23.1.0 contourpy-1.0.7 cycler-0.11.0 datasets-2.11.0 dill-0.3.6 fonttools-4.39.3 frozenlist-1.3.3 fsspec-2023.4.0 huggingface_hub-0.13.4 importlib-resources-5.12.0 kiwisolver-1.4.4 matplotlib-3.7.1 multidict-6.0.4 multiprocess-0.70.14 pandas-2.0.0 psutil-5.9.5 pyarrow-11.0.0 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2023.3 pyyaml-6.0 regex-2023.3.23 responses-0.18.0 sentencepiece-0.1.98 tokenizers-0.13.3 torch-1.10.1 tqdm-4.65.0 transformers-4.25.1 tzdata-2023.3 xxhash-3.2.0 yarl-1.9.1

1.2.3 (可选) 4/8-bit 量化环境

pip install triton

(moss) xf@VP01:~/ai/nlp$ pip install triton
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fe5faa7b880>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /compute/redist/triton/
Collecting triton
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a8/ee/4e9d11787414590a9497f36ab5803c8f9252adc51a6c13a09fdc3bdf5566/triton-2.0.0.post1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (63.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.2/63.2 MB 71.5 MB/s eta 0:00:00
Collecting lit
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ba/7f/981185aaea6ac3a4ae5de9eca143a6382e3c62c9ee9ad47cffe94f8181aa/lit-16.0.1.tar.gz (137 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137.9/137.9 kB 642.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting cmake
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1d/de/48d485d12285cd53e322fb7bdb263778820984d4be54c2bb2fb5eced5e87/cmake-3.26.3-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (24.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24.0/24.0 MB 74.0 MB/s eta 0:00:00
Collecting filelock
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ad/73/b094a662ae05cdc4ec95bc54e434e307986a5de5960166b8161b7c1373ee/filelock-3.12.0-py3-none-any.whl (10 kB)
Requirement already satisfied: torch in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from triton) (1.13.1)
Requirement already satisfied: typing_extensions in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from torch->triton) (4.5.0)
Building wheels for collected packages: lit
  Building wheel for lit (setup.py) ... done
  Created wheel for lit: filename=lit-16.0.1-py3-none-any.whl size=88174 sha256=a2cc32422a65717f9aff15d6561879e3053b094a777f9aa8abe5ae4e0be3e08f
  Stored in directory: /tmp/pip-ephem-wheel-cache-7k_2y_i3/wheels/09/20/cf/d66fcd2bc1113f69a7287f477dbbd8821e55891921b11230ab
Successfully built lit
Installing collected packages: lit, cmake, filelock, triton
Successfully installed cmake-3.26.3 filelock-3.12.0 lit-16.0.1 triton-2.0.0.post1

1.3 安装Pytorch

1.3.1 查看cuda版本

(py38) xf@VP01:~/ai/nlp$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

1.3.2 Pytorch 1.13.1 + cuda 11.7

1.3.2.1 安装Pytorch

conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia

(py38) xf@VP01:~/ai/nlp$ conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/xf/anaconda3/envs/py38

  added / updated specs:
    - pytorch-cuda=11.7
    - pytorch==1.13.1
    - torchaudio==0.13.1
    - torchvision==0.14.1


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pytorch-1.13.1             |py3.8_cuda11.7_cudnn8.5.0_0        1.14 GB  pytorch
    torchaudio-0.13.1          |       py38_cu117         6.5 MB  pytorch
    torchvision-0.14.1         |       py38_cu117        29.5 MB  pytorch
    ------------------------------------------------------------
                                           Total:        1.18 GB

The following NEW packages will be INSTALLED:

  blas               anaconda/pkgs/main/linux-64::blas-1.0-mkl
  brotlipy           anaconda/pkgs/main/linux-64::brotlipy-0.7.0-py38h27cfd23_1003
  bzip2              anaconda/pkgs/main/linux-64::bzip2-1.0.8-h7b6447c_0
  cffi               anaconda/pkgs/main/linux-64::cffi-1.15.1-py38h5eee18b_3
  charset-normalizer anaconda/pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
  cryptography       anaconda/pkgs/main/linux-64::cryptography-39.0.1-py38h9ce1e76_0
  ffmpeg             pytorch/linux-64::ffmpeg-4.3-hf484d3e_0
  freetype           anaconda/pkgs/main/linux-64::freetype-2.12.1-h4a9f257_0
  giflib             anaconda/pkgs/main/linux-64::giflib-5.2.1-h5eee18b_3
  gmp                anaconda/pkgs/main/linux-64::gmp-6.2.1-h295c915_3
  gnutls             anaconda/pkgs/main/linux-64::gnutls-3.6.15-he1e5248_0
  idna               anaconda/pkgs/main/linux-64::idna-3.4-py38h06a4308_0
  intel-openmp       anaconda/pkgs/main/linux-64::intel-openmp-2021.4.0-h06a4308_3561
  jpeg               anaconda/pkgs/main/linux-64::jpeg-9e-h5eee18b_1
  lame               anaconda/pkgs/main/linux-64::lame-3.100-h7b6447c_0
  lcms2              anaconda/pkgs/main/linux-64::lcms2-2.12-h3be6417_0
  lerc               anaconda/pkgs/main/linux-64::lerc-3.0-h295c915_0
  libdeflate         anaconda/pkgs/main/linux-64::libdeflate-1.17-h5eee18b_0
  libiconv           anaconda/pkgs/main/linux-64::libiconv-1.16-h7f8727e_2
  libidn2            anaconda/pkgs/main/linux-64::libidn2-2.3.2-h7f8727e_0
  libpng             anaconda/pkgs/main/linux-64::libpng-1.6.39-h5eee18b_0
  libtasn1           anaconda/pkgs/main/linux-64::libtasn1-4.19.0-h5eee18b_0
  libtiff            anaconda/pkgs/main/linux-64::libtiff-4.5.0-h6a678d5_2
  libunistring       anaconda/pkgs/main/linux-64::libunistring-0.9.10-h27cfd23_0
  libwebp            anaconda/pkgs/main/linux-64::libwebp-1.2.4-h11a3e52_1
  libwebp-base       anaconda/pkgs/main/linux-64::libwebp-base-1.2.4-h5eee18b_1
  lz4-c              anaconda/pkgs/main/linux-64::lz4-c-1.9.4-h6a678d5_0
  mkl                anaconda/pkgs/main/linux-64::mkl-2021.4.0-h06a4308_640
  mkl-service        anaconda/pkgs/main/linux-64::mkl-service-2.4.0-py38h7f8727e_0
  mkl_fft            anaconda/pkgs/main/linux-64::mkl_fft-1.3.1-py38hd3c417c_0
  mkl_random         anaconda/pkgs/main/linux-64::mkl_random-1.2.2-py38h51133e4_0
  nettle             anaconda/pkgs/main/linux-64::nettle-3.7.3-hbbd107a_1
  numpy              anaconda/pkgs/main/linux-64::numpy-1.23.5-py38h14f4228_0
  numpy-base         anaconda/pkgs/main/linux-64::numpy-base-1.23.5-py38h31eccc5_0
  openh264           anaconda/pkgs/main/linux-64::openh264-2.1.1-h4ff587b_0
  pillow             anaconda/pkgs/main/linux-64::pillow-9.4.0-py38h6a678d5_0
  pycparser          anaconda/pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0
  pyopenssl          anaconda/pkgs/main/linux-64::pyopenssl-23.0.0-py38h06a4308_0
  pysocks            anaconda/pkgs/main/linux-64::pysocks-1.7.1-py38h06a4308_0
  pytorch            pytorch/linux-64::pytorch-1.13.1-py3.8_cuda11.7_cudnn8.5.0_0
  pytorch-mutex      pytorch/noarch::pytorch-mutex-1.0-cuda
  requests           anaconda/pkgs/main/linux-64::requests-2.28.1-py38h06a4308_1
  six                anaconda/pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1
  torchaudio         pytorch/linux-64::torchaudio-0.13.1-py38_cu117
  torchvision        pytorch/linux-64::torchvision-0.14.1-py38_cu117
  typing_extensions  anaconda/pkgs/main/linux-64::typing_extensions-4.5.0-py38h06a4308_0
  urllib3            anaconda/pkgs/main/linux-64::urllib3-1.26.15-py38h06a4308_0
  zstd               anaconda/pkgs/main/linux-64::zstd-1.5.5-hc292b87_0


Proceed ([y]/n)? y


Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(py38) xf@VP01:~/ai/nlp$ python -c "import torch;print(torch.cuda.is_available())"
True
1.3.2.2 验证CUDA

python -c "import torch;print(torch.cuda.is_available())"

关于安装cuda的个人总结:

  1. 正确的版本:
    按照官方给我命令错不了,不要随意修改命令版本组合
  2. 如果版本匹配还是验证还是False:
    是否已经安装了随意版本组合,请卸载pytorch重装

conda list 已经一目了然,全是CPU版本

	(py38) xf@VP01:~/ai/nlp$ conda list
	# packages in environment at /home/xf/anaconda3/envs/py38:
	#
	# Name                    Version                   Build  Channel
...
python                    3.8.16               h7a1cb2a_3    defaults
pytorch                   1.13.1              py3.8_cpu_0    pytorch
pytorch-cuda              11.7                 h67b0de4_0    pytorch
pytorch-mutex             1.0                         cpu    pytorch
...
torchaudio                0.13.1                 py38_cpu    pytorch
torchvision               0.14.1                 py38_cpu    pytorch
...
(py38) xf@VP01:~/ai/nlp$ python -c "import torch;print(torch.cuda.is_available())"
False

conda uninstall pytorch
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia

(py38) xf@VP01:~/ai/nlp$ conda uninstall pytorch
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/xf/anaconda3/envs/py38

  removed specs:
    - pytorch


The following packages will be REMOVED:

  blas-1.0-mkl
  brotlipy-0.7.0-py38h27cfd23_1003
  bzip2-1.0.8-h7b6447c_0
  cffi-1.15.1-py38h5eee18b_3
  charset-normalizer-2.0.4-pyhd3eb1b0_0
  cryptography-39.0.1-py38h9ce1e76_0
  ffmpeg-4.3-hf484d3e_0
  freetype-2.12.1-h4a9f257_0
  giflib-5.2.1-h5eee18b_3
  gmp-6.2.1-h295c915_3
  gnutls-3.6.15-he1e5248_0
  idna-3.4-py38h06a4308_0
  intel-openmp-2021.4.0-h06a4308_3561
  jpeg-9e-h5eee18b_1
  lame-3.100-h7b6447c_0
  lcms2-2.12-h3be6417_0
  lerc-3.0-h295c915_0
  libdeflate-1.17-h5eee18b_0
  libiconv-1.16-h7f8727e_2
  libidn2-2.3.2-h7f8727e_0
  libpng-1.6.39-h5eee18b_0
  libtasn1-4.19.0-h5eee18b_0
  libtiff-4.5.0-h6a678d5_2
  libunistring-0.9.10-h27cfd23_0
  libwebp-1.2.4-h11a3e52_1
  libwebp-base-1.2.4-h5eee18b_1
  lz4-c-1.9.4-h6a678d5_0
  mkl-2021.4.0-h06a4308_640
  mkl-service-2.4.0-py38h7f8727e_0
  mkl_fft-1.3.1-py38hd3c417c_0
  mkl_random-1.2.2-py38h51133e4_0
  nettle-3.7.3-hbbd107a_1
  numpy-1.23.5-py38h14f4228_0
  numpy-base-1.23.5-py38h31eccc5_0
  openh264-2.1.1-h4ff587b_0
  pillow-9.4.0-py38h6a678d5_0
  pycparser-2.21-pyhd3eb1b0_0
  pyopenssl-23.0.0-py38h06a4308_0
  pysocks-1.7.1-py38h06a4308_0
  pytorch-1.13.1-py3.8_cpu_0
  pytorch-mutex-1.0-cpu
  requests-2.28.1-py38h06a4308_1
  six-1.16.0-pyhd3eb1b0_1
  torchaudio-0.13.1-py38_cpu
  torchvision-0.14.1-py38_cpu
  typing_extensions-4.5.0-py38h06a4308_0
  urllib3-1.26.15-py38h06a4308_0
  zstd-1.5.5-hc292b87_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(py38) xf@VP01:~/ai/nlp$ conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/xf/anaconda3/envs/py38

  added / updated specs:
    - pytorch-cuda=11.7
    - pytorch==1.13.1
    - torchaudio==0.13.1
    - torchvision==0.14.1


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pytorch-1.13.1             |py3.8_cuda11.7_cudnn8.5.0_0        1.14 GB  pytorch
    torchaudio-0.13.1          |       py38_cu117         6.5 MB  pytorch
    torchvision-0.14.1         |       py38_cu117        29.5 MB  pytorch
    ------------------------------------------------------------
                                           Total:        1.18 GB

The following NEW packages will be INSTALLED:

  blas               anaconda/pkgs/main/linux-64::blas-1.0-mkl
  brotlipy           anaconda/pkgs/main/linux-64::brotlipy-0.7.0-py38h27cfd23_1003
  bzip2              anaconda/pkgs/main/linux-64::bzip2-1.0.8-h7b6447c_0
  cffi               anaconda/pkgs/main/linux-64::cffi-1.15.1-py38h5eee18b_3
  charset-normalizer anaconda/pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
  cryptography       anaconda/pkgs/main/linux-64::cryptography-39.0.1-py38h9ce1e76_0
  ffmpeg             pytorch/linux-64::ffmpeg-4.3-hf484d3e_0
  freetype           anaconda/pkgs/main/linux-64::freetype-2.12.1-h4a9f257_0
  giflib             anaconda/pkgs/main/linux-64::giflib-5.2.1-h5eee18b_3
  gmp                anaconda/pkgs/main/linux-64::gmp-6.2.1-h295c915_3
  gnutls             anaconda/pkgs/main/linux-64::gnutls-3.6.15-he1e5248_0
  idna               anaconda/pkgs/main/linux-64::idna-3.4-py38h06a4308_0
  intel-openmp       anaconda/pkgs/main/linux-64::intel-openmp-2021.4.0-h06a4308_3561
  jpeg               anaconda/pkgs/main/linux-64::jpeg-9e-h5eee18b_1
  lame               anaconda/pkgs/main/linux-64::lame-3.100-h7b6447c_0
  lcms2              anaconda/pkgs/main/linux-64::lcms2-2.12-h3be6417_0
  lerc               anaconda/pkgs/main/linux-64::lerc-3.0-h295c915_0
  libdeflate         anaconda/pkgs/main/linux-64::libdeflate-1.17-h5eee18b_0
  libiconv           anaconda/pkgs/main/linux-64::libiconv-1.16-h7f8727e_2
  libidn2            anaconda/pkgs/main/linux-64::libidn2-2.3.2-h7f8727e_0
  libpng             anaconda/pkgs/main/linux-64::libpng-1.6.39-h5eee18b_0
  libtasn1           anaconda/pkgs/main/linux-64::libtasn1-4.19.0-h5eee18b_0
  libtiff            anaconda/pkgs/main/linux-64::libtiff-4.5.0-h6a678d5_2
  libunistring       anaconda/pkgs/main/linux-64::libunistring-0.9.10-h27cfd23_0
  libwebp            anaconda/pkgs/main/linux-64::libwebp-1.2.4-h11a3e52_1
  libwebp-base       anaconda/pkgs/main/linux-64::libwebp-base-1.2.4-h5eee18b_1
  lz4-c              anaconda/pkgs/main/linux-64::lz4-c-1.9.4-h6a678d5_0
  mkl                anaconda/pkgs/main/linux-64::mkl-2021.4.0-h06a4308_640
  mkl-service        anaconda/pkgs/main/linux-64::mkl-service-2.4.0-py38h7f8727e_0
  mkl_fft            anaconda/pkgs/main/linux-64::mkl_fft-1.3.1-py38hd3c417c_0
  mkl_random         anaconda/pkgs/main/linux-64::mkl_random-1.2.2-py38h51133e4_0
  nettle             anaconda/pkgs/main/linux-64::nettle-3.7.3-hbbd107a_1
  numpy              anaconda/pkgs/main/linux-64::numpy-1.23.5-py38h14f4228_0
  numpy-base         anaconda/pkgs/main/linux-64::numpy-base-1.23.5-py38h31eccc5_0
  openh264           anaconda/pkgs/main/linux-64::openh264-2.1.1-h4ff587b_0
  pillow             anaconda/pkgs/main/linux-64::pillow-9.4.0-py38h6a678d5_0
  pycparser          anaconda/pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0
  pyopenssl          anaconda/pkgs/main/linux-64::pyopenssl-23.0.0-py38h06a4308_0
  pysocks            anaconda/pkgs/main/linux-64::pysocks-1.7.1-py38h06a4308_0
  pytorch            pytorch/linux-64::pytorch-1.13.1-py3.8_cuda11.7_cudnn8.5.0_0
  pytorch-mutex      pytorch/noarch::pytorch-mutex-1.0-cuda
  requests           anaconda/pkgs/main/linux-64::requests-2.28.1-py38h06a4308_1
  six                anaconda/pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1
  torchaudio         pytorch/linux-64::torchaudio-0.13.1-py38_cu117
  torchvision        pytorch/linux-64::torchvision-0.14.1-py38_cu117
  typing_extensions  anaconda/pkgs/main/linux-64::typing_extensions-4.5.0-py38h06a4308_0
  urllib3            anaconda/pkgs/main/linux-64::urllib3-1.26.15-py38h06a4308_0
  zstd               anaconda/pkgs/main/linux-64::zstd-1.5.5-hc292b87_0


Proceed ([y]/n)? y


Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(py38) xf@VP01:~/ai/nlp$ python -c "import torch;print(torch.cuda.is_available())"
True
  1. 请参考我的这篇笔记

1.4 安装TensorFlow

1.4.1 TensorFlow 2.12.0 版本选择

官方查看GPU支持版本一览

GPU
版本	Python 版本	编译器	构建工具	cuDNN	CUDA
tensorflow-2.6.0	3.6-3.9	GCC 7.3.1	Bazel 3.7.2	8.1	11.2
tensorflow-2.5.0	3.6-3.9	GCC 7.3.1	Bazel 3.7.2	8.1	11.2
tensorflow-2.4.0	3.6-3.8	GCC 7.3.1	Bazel 3.1.0	8.0	11.0
tensorflow-2.3.0	3.5-3.8	GCC 7.3.1	Bazel 3.1.0	7.6	10.1
tensorflow-2.2.0	3.5-3.8	GCC 7.3.1	Bazel 2.0.0	7.6	10.1
tensorflow-2.1.0	2.7、3.5-3.7	GCC 7.3.1	Bazel 0.27.1	7.6	10.1
tensorflow-2.0.0	2.7、3.3-3.7	GCC 7.3.1	Bazel 0.26.1	7.4	10.0
tensorflow_gpu-1.15.0	2.7、3.3-3.7	GCC 7.3.1	Bazel 0.26.1	7.4	10.0
tensorflow_gpu-1.14.0	2.7、3.3-3.7	GCC 4.8	Bazel 0.24.1	7.4	10.0
tensorflow_gpu-1.13.1	2.7、3.3-3.7	GCC 4.8	Bazel 0.19.2	7.4	10.0
tensorflow_gpu-1.12.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.15.0	7	9
tensorflow_gpu-1.11.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.15.0	7	9
tensorflow_gpu-1.10.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.15.0	7	9
tensorflow_gpu-1.9.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.11.0	7	9
tensorflow_gpu-1.8.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.10.0	7	9
tensorflow_gpu-1.7.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.9.0	7	9
tensorflow_gpu-1.6.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.9.0	7	9
tensorflow_gpu-1.5.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.8.0	7	9
tensorflow_gpu-1.4.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.5.4	6	8
tensorflow_gpu-1.3.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.4.5	6	8
tensorflow_gpu-1.2.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.4.5	5.1	8
tensorflow_gpu-1.1.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.4.2	5.1	8
tensorflow_gpu-1.0.0	2.7、3.3-3.6	GCC 4.8	Bazel 0.4.2	5.1	8

pip install tensorflow

(py38) xf@VP01:~/ai/nlp$ pip install tensorflow
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
Collecting tensorflow
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e4/8a/0c38f712159d698e6216a4006bc91b31ce9c3412aaeae262b07f02db1174/tensorflow-2.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (585.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 585.9/585.9 MB 71.2 MB/s eta 0:00:00
Collecting absl-py>=1.0.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/dd/87/de5c32fa1b1c6c3305d576e299801d8655c175ca9557019906247b994331/absl_py-1.4.0-py3-none-any.whl (126 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126.5/126.5 kB 648.9 MB/s eta 0:00:00
Collecting astunparse>=1.6.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2b/03/13dde6512ad7b4557eb792fbcf0c653af6076b81e5941d36ec61f7ce6028/astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting flatbuffers>=2.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/60/a5/9fce65f81639a71a0239d78a4721afb5eb3f0c49c104ae892deeae614b95/flatbuffers-23.3.3-py2.py3-none-any.whl (26 kB)
Collecting gast<=0.4.0,>=0.2.1 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b6/48/583c032b79ae5b3daa02225a675aeb673e58d2cb698e78510feceb11958c/gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting google-pasta>=0.1.1 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 kB 220.5 MB/s eta 0:00:00
Collecting grpcio<2.0,>=1.24.3 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/27/dd/a44fc8cad3052c94c81bb0515aa1ba2b4358eff042c705ab09ef916159e4/grpcio-1.54.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.1/5.1 MB 86.1 MB/s eta 0:00:00
Collecting h5py>=2.9.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d8/95/78c026daade80a289c31d871fea6a8b7efe6c3230347c06110cfbb4e73ef/h5py-3.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 84.3 MB/s eta 0:00:00
Collecting jax>=0.3.15 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fe/58/1641614c17fcd7293d250c2cad48011baa1ecef4f109ce2ea027aa8e4898/jax-0.4.8.tar.gz (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 155.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting keras<2.13,>=2.12.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d5/80/34e55d7e3ed9cf18020929460f969de1bf82cf2f509c639b358ae2b25618/keras-2.12.0-py2.py3-none-any.whl (1.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 156.5 MB/s eta 0:00:00
Collecting libclang>=13.0.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a1/82/1fd88a2df784dbcfdfba7dbb335653f4178c7c73fa7fe95bae888e60d34b/libclang-16.0.0-py2.py3-none-manylinux2010_x86_64.whl (22.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.9/22.9 MB 70.9 MB/s eta 0:00:00
Requirement already satisfied: numpy<1.24,>=1.22 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from tensorflow) (1.23.5)
Collecting opt-einsum>=2.3.2 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.5/65.5 kB 243.5 MB/s eta 0:00:00
Collecting packaging (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ab/c3/57f0601a2d4fe15de7a553c00adbc901425661bf048f2a22dfc500caf121/packaging-23.1-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 172.9 MB/s eta 0:00:00
Collecting protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f4/fd/d8d309382c71c5e83a1920ae9840410396e595e3b36229d96e3ba755687e/protobuf-4.22.3-cp37-abi3-manylinux2014_x86_64.whl (302 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 302.4/302.4 kB 416.0 MB/s eta 0:00:00
Requirement already satisfied: setuptools in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from tensorflow) (66.0.0)
Requirement already satisfied: six>=1.12.0 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from tensorflow) (1.16.0)
Collecting tensorboard<2.13,>=2.12 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/aa/80/f7233129f75d0d1b35e67df3a48010fffd21ccde124847e3c33d503fef01/tensorboard-2.12.2-py3-none-any.whl (5.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.6/5.6 MB 88.8 MB/s eta 0:00:00
Collecting tensorflow-estimator<2.13,>=2.12.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d1/e1/c3596da404e2c47561a2bb392397208925e65be6f61bd3081e630371d5e8/tensorflow_estimator-2.12.0-py2.py3-none-any.whl (440 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 440.7/440.7 kB 310.0 MB/s eta 0:00:00
Collecting termcolor>=1.1.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/aa/f4/8ddd8a684b4c005345f45740a449d93d0af7ccecd91319d0f4426cf08b36/termcolor-2.2.0-py3-none-any.whl (6.6 kB)
Requirement already satisfied: typing-extensions>=3.6.6 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from tensorflow) (4.5.0)
Collecting wrapt<1.15,>=1.11.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/36/ee/944dc7e5462662270e8a379755bcc543fc8f09029866288060dc163ed5b4/wrapt-1.14.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (81 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 81.0/81.0 kB 183.0 MB/s eta 0:00:00
Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e1/10/1dc513724b5366b192989859160477c4944810440646f4d55318ca0a2917/tensorflow_io_gcs_filesystem-0.32.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 142.2 MB/s eta 0:00:00
Requirement already satisfied: wheel<1.0,>=0.23.0 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from astunparse>=1.6.0->tensorflow) (0.38.4)
Collecting ml-dtypes>=0.0.3 (from jax>=0.3.15->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/4f/88/e252178b54fea300f1c4d8a28873f394a9a804515c8666a4305f2ea8bd4f/ml_dtypes-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (190 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 190.6/190.6 kB 251.1 MB/s eta 0:00:00
Collecting scipy>=1.7 (from jax>=0.3.15->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/69/f0/fb07a9548e48b687b8bf2fa81d71aba9cfc548d365046ca1c791e24db99d/scipy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 34.5/34.5 MB 67.0 MB/s eta 0:00:00
Collecting google-auth<3,>=1.6.3 (from tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/da/cc/13eb3d0b151252e1d2bafc52f412be05c3789b0f655caf5eed298cf8056c/google_auth-2.17.3-py2.py3-none-any.whl (178 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.2/178.2 kB 682.5 MB/s eta 0:00:00
Collecting google-auth-oauthlib<1.1,>=0.5 (from tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/4a/07/8d9a8186e6768b55dfffeb57c719bc03770cf8a970a074616ae6f9e26a57/google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB)
Collecting markdown>=2.6.8 (from tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9a/a1/1352b0e5a3c71a79fa9265726e2217f69df9fd4de0bcb5725cc61f62a5df/Markdown-3.4.3-py3-none-any.whl (93 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93.9/93.9 kB 130.0 MB/s eta 0:00:00
Requirement already satisfied: requests<3,>=2.21.0 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from tensorboard<2.13,>=2.12->tensorflow) (2.28.1)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c6/a1/a1bfd5afa8198fd5494db2e7658d69c0c91327b1f33f22550114210d022c/tensorboard_data_server-0.7.0-py3-none-manylinux2014_x86_64.whl (6.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.6/6.6 MB 73.0 MB/s eta 0:00:00
Collecting tensorboard-plugin-wit>=1.6.0 (from tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e0/68/e8ecfac5dd594b676c23a7f07ea34c197d7d69b3313afdf8ac1b0a9905a2/tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 781.3/781.3 kB 184.1 MB/s eta 0:00:00
Collecting werkzeug>=1.0.1 (from tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f6/f8/9da63c1617ae2a1dec2fbf6412f3a0cfe9d4ce029eccbda6e1e4258ca45f/Werkzeug-2.2.3-py3-none-any.whl (233 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 233.6/233.6 kB 286.8 MB/s eta 0:00:00
Collecting cachetools<6.0,>=2.0.0 (from google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/db/14/2b48a834d349eee94677e8702ea2ef98b7c674b090153ea8d3f6a788584e/cachetools-5.3.0-py3-none-any.whl (9.3 kB)
Collecting pyasn1-modules>=0.2.1 (from google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cd/8e/bea464350e1b8c6ed0da3a312659cb648804a08af6cacc6435867f74f8bd/pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 181.3/181.3 kB 245.3 MB/s eta 0:00:00
Collecting rsa<5,>=3.1.4 (from google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/49/97/fa78e3d2f65c02c8e1268b9aba606569fe97f6c8f7c2d74394553347c145/rsa-4.9-py3-none-any.whl (34 kB)
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<1.1,>=0.5->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6f/bb/5deac77a9af870143c684ab46a7934038a53eb4aa975bc0687ed6ca2c610/requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting importlib-metadata>=4.4 (from markdown>=2.6.8->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/30/bb/bf2944b8b88c65b797acc2c6a2cb0fb817f7364debf0675792e034013858/importlib_metadata-6.6.0-py3-none-any.whl (22 kB)
Requirement already satisfied: charset-normalizer<3,>=2 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in /home/xf/anaconda3/envs/py38/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow) (2022.12.7)
Collecting MarkupSafe>=2.1.1 (from werkzeug>=1.0.1->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9d/80/8320f182d06a9b289b1a9f266f593feb91d3781c7e104bbe09e0c4c11439/MarkupSafe-2.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting zipp>=0.5 (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5b/fa/c9e82bbe1af6266adf08afb563905eb87cab83fde00a0a08963510621047/zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting pyasn1<0.6.0,>=0.4.6 (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/14/e5/b56a725cbde139aa960c26a1a3ca4d4af437282e20b5314ee6a3501e7dfc/pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 83.9/83.9 kB 255.3 MB/s eta 0:00:00
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard<2.13,>=2.12->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7e/80/cab10959dc1faead58dc8384a781dfbf93cb4d33d50988f7a69f1b7c9bbe/oauthlib-3.2.2-py3-none-any.whl (151 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 151.7/151.7 kB 415.3 MB/s eta 0:00:00
Building wheels for collected packages: jax
  Building wheel for jax (pyproject.toml) ... done
  Created wheel for jax: filename=jax-0.4.8-py3-none-any.whl size=1439678 sha256=9ef52e63919db01012dcd465168aec5e28325ddddd6287b14f8b5613ccfa283c
  Stored in directory: /tmp/pip-ephem-wheel-cache-5im6mvh1/wheels/d1/e5/c4/93853f391fc89fbc79c6a21c645b2d81f85f736d9d310c9871
Successfully built jax
Installing collected packages: tensorboard-plugin-wit, libclang, flatbuffers, zipp, wrapt, termcolor, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard-data-server, scipy, pyasn1, protobuf, packaging, opt-einsum, oauthlib, ml-dtypes, MarkupSafe, keras, h5py, grpcio, google-pasta, gast, cachetools, astunparse, absl-py, werkzeug, rsa, requests-oauthlib, pyasn1-modules, jax, importlib-metadata, markdown, google-auth, google-auth-oauthlib, tensorboard, tensorflow
Successfully installed MarkupSafe-2.1.2 absl-py-1.4.0 astunparse-1.6.3 cachetools-5.3.0 flatbuffers-23.3.3 gast-0.4.0 google-auth-2.17.3 google-auth-oauthlib-1.0.0 google-pasta-0.2.0 grpcio-1.54.0 h5py-3.8.0 importlib-metadata-6.6.0 jax-0.4.8 keras-2.12.0 libclang-16.0.0 markdown-3.4.3 ml-dtypes-0.1.0 oauthlib-3.2.2 opt-einsum-3.3.0 packaging-23.1 protobuf-4.22.3 pyasn1-0.5.0 pyasn1-modules-0.3.0 requests-oauthlib-1.3.1 rsa-4.9 scipy-1.10.1 tensorboard-2.12.2 tensorboard-data-server-0.7.0 tensorboard-plugin-wit-1.8.1 tensorflow-2.12.0 tensorflow-estimator-2.12.0 tensorflow-io-gcs-filesystem-0.32.0 termcolor-2.2.0 werkzeug-2.2.3 wrapt-1.14.1 zipp-3.15.0

1.4.2 验证TF

python -c "import tensorflow as tf;print('\n Version:',tf.__version__,'\n GPU:', tf.test.is_gpu_available())"

(py38) xf@VP01:~/ai/nlp$ python -c "import tensorflow as tf;print('\n Version:',tf.__version__,'\n GPU:', tf.test.is_gpu_available())"
2023-04-23 23:04:28.519302: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-04-23 23:04:34.243707: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
WARNING:tensorflow:From <string>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2023-04-23 23:04:41.034158: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:982] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-04-23 23:04:45.645564: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:982] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-04-23 23:04:45.645978: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:982] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-04-23 23:04:46.214358: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:982] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-04-23 23:04:46.214425: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:982] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-04-23 23:04:46.214440: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1722] Could not identify NUMA node of platform GPU id 0, defaulting to 0.  Your kernel may not have been built with NUMA support.
2023-04-23 23:04:46.214467: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:982] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-04-23 23:04:46.214500: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /device:GPU:0 with 21256 MB memory:  -> device: 0, name: NVIDIA GeForce RTX 4090, pci bus id: 0000:01:00.0, compute capability: 8.9

 Version: 2.12.0
 GPU: True

2、运行实测MOSS

2.1 查看MOSS目录列表

(py38) xf@VP01:~/ai/nlp$ cd moss
(py38) xf@VP01:~/ai/nlp/moss$ ll
total 284
drwxrwxrwx 1 xf xf   512 Apr 23 22:05 ./
drwxrwxrwx 1 xf xf   512 Apr 23 22:50 ../
drwxrwxrwx 1 xf xf   512 Apr 23 22:05 .git/
-rwxrwxrwx 1 xf xf  1807 Apr 23 22:05 .gitignore*
-rwxrwxrwx 1 xf xf 19346 Apr 23 22:05 DATA_LICENSE*
-rwxrwxrwx 1 xf xf 11357 Apr 23 22:05 LICENSE*
-rwxrwxrwx 1 xf xf 33821 Apr 23 22:05 MODEL_LICENSE*
-rwxrwxrwx 1 xf xf 35788 Apr 23 22:05 MOSS_agreement_form.pdf*
-rwxrwxrwx 1 xf xf 17961 Apr 23 22:05 README.md*
drwxrwxrwx 1 xf xf   512 Apr 23 22:05 SFT_data/
drwxrwxrwx 1 xf xf   512 Apr 23 22:05 examples/
-rwxrwxrwx 1 xf xf 12657 Apr 23 22:05 finetune_moss.py*
-rwxrwxrwx 1 xf xf  1189 Apr 23 22:05 meta_instruction.txt*
drwxrwxrwx 1 xf xf   512 Apr 23 22:05 models/
-rwxrwxrwx 1 xf xf 82265 Apr 23 22:05 moss_api.pdf*
-rwxrwxrwx 1 xf xf  4128 Apr 23 22:05 moss_cli_demo.py*
-rwxrwxrwx 1 xf xf  7020 Apr 23 22:05 moss_gui_demo.py*
-rwxrwxrwx 1 xf xf 18027 Apr 23 22:05 moss_infer_demo.ipynb*
-rwxrwxrwx 1 xf xf 16250 Apr 23 22:05 moss_inference.py*
-rwxrwxrwx 1 xf xf    95 Apr 23 22:05 requirements.txt*

2.2 复制py38为moss,当作环境备份了

(py38) xf@VP01:~/ai/nlp/moss$ conda create -n moss --clone py38
Source:      /home/xf/anaconda3/envs/py38
Destination: /home/xf/anaconda3/envs/moss
Packages: 119
Files: 19058

Downloading and Extracting Packages


Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate moss
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(py38) xf@VP01:~/ai/nlp/moss$  conda activate moss
(moss) xf@VP01:~/ai/nlp/moss$

2.3 模型下载

看到这不出意外,造起来吧!
在这里插入图片描述但一看这网速,休息时候到了,该干嘛干嘛去吧…

2.4 你好,MOSS

已经出现
Running on local URL: http://127.0.0.1:7860
这是网页GUI链接地址
在这里插入图片描述正式进行后台管理
在这里插入图片描述O键设置参数
在这里插入图片描述H键帮助文档
在这里插入图片描述

在这里插入图片描述

3、错误处理

3.1 AttributeError: module ‘distutils’ has no attribute ‘version’

(moss) xf@VP01:~/ai/nlp/moss$ python moss_gui_demo.py
2023-04-23 23:13:06.022040: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-04-23 23:13:06.377993: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "moss_gui_demo.py", line 1, in <module>
    from accelerate import init_empty_weights, load_checkpoint_and_dispatch
  File "/home/xf/anaconda3/envs/moss/lib/python3.8/site-packages/accelerate/__init__.py", line 3, in <module>
    from .accelerator import Accelerator
  File "/home/xf/anaconda3/envs/moss/lib/python3.8/site-packages/accelerate/accelerator.py", line 37, in <module>
    from .tracking import LOGGER_TYPE_TO_CLASS, GeneralTracker, filter_trackers
  File "/home/xf/anaconda3/envs/moss/lib/python3.8/site-packages/accelerate/tracking.py", line 42, in <module>
    from torch.utils import tensorboard
  File "/home/xf/anaconda3/envs/moss/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py", line 4, in <module>
    LooseVersion = distutils.version.LooseVersion
AttributeError: module 'distutils' has no attribute 'version'

查看pip列表

(moss) xf@VP01:~/ai/nlp/moss$ pip list
Package                      Version
---------------------------- -----------
absl-py                      1.4.0
accelerate                   0.18.0
aiohttp                      3.8.4
aiosignal                    1.3.1
astunparse                   1.6.3
async-timeout                4.0.2
attrs                        23.1.0
brotlipy                     0.7.0
cachetools                   5.3.0
certifi                      2022.12.7
cffi                         1.15.1
charset-normalizer           2.0.4
cmake                        3.26.3
contourpy                    1.0.7
cryptography                 39.0.1
cycler                       0.11.0
datasets                     2.11.0
dill                         0.3.6
filelock                     3.12.0
flatbuffers                  23.3.3
fonttools                    4.39.3
frozenlist                   1.3.3
fsspec                       2023.4.0
gast                         0.4.0
google-auth                  2.17.3
google-auth-oauthlib         1.0.0
google-pasta                 0.2.0
grpcio                       1.54.0
h5py                         3.8.0
huggingface-hub              0.13.4
idna                         3.4
importlib-metadata           6.6.0
importlib-resources          5.12.0
jax                          0.4.8
keras                        2.12.0
kiwisolver                   1.4.4
libclang                     16.0.0
lit                          16.0.1
Markdown                     3.4.3
MarkupSafe                   2.1.2
matplotlib                   3.7.1
mkl-fft                      1.3.1
mkl-random                   1.2.2
mkl-service                  2.4.0
ml-dtypes                    0.1.0
multidict                    6.0.4
multiprocess                 0.70.14
numpy                        1.23.5
oauthlib                     3.2.2
opt-einsum                   3.3.0
packaging                    23.1
pandas                       2.0.0
Pillow                       9.4.0
pip                          23.1.1
protobuf                     4.22.3
psutil                       5.9.5
pyarrow                      11.0.0
pyasn1                       0.5.0
pyasn1-modules               0.3.0
pycparser                    2.21
pyOpenSSL                    23.0.0
pyparsing                    3.0.9
PySocks                      1.7.1
python-dateutil              2.8.2
pytz                         2023.3
PyYAML                       6.0
regex                        2023.3.23
requests                     2.28.1
requests-oauthlib            1.3.1
responses                    0.18.0
rsa                          4.9
scipy                        1.10.1
sentencepiece                0.1.98
setuptools                   66.0.0
six                          1.16.0
tensorboard                  2.12.2
tensorboard-data-server      0.7.0
tensorboard-plugin-wit       1.8.1
tensorflow                   2.12.0
tensorflow-estimator         2.12.0
tensorflow-io-gcs-filesystem 0.32.0
termcolor                    2.2.0
tokenizers                   0.13.3
torch                        1.10.1
torchaudio                   0.13.1
torchvision                  0.14.1
tqdm                         4.65.0
transformers                 4.25.1
triton                       2.0.0.post1
typing_extensions            4.5.0
tzdata                       2023.3
urllib3                      1.26.15
Werkzeug                     2.2.3
wheel                        0.38.4
wrapt                        1.14.1
xxhash                       3.2.0
yarl                         1.9.1
zipp                         3.15.0

setuptools的版本=66.0.0,进行版本降级

(moss) xf@VP01:~/ai/nlp/moss$ pip install setuptools==59.5.0
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
Collecting setuptools==59.5.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/40/a9/7deac76c58fa47c95360116a06b53b9b62f6db11336fe61b6ab53784d98b/setuptools-59.5.0-py3-none-any.whl (952 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 952.4/952.4 kB 6.8 MB/s eta 0:00:00
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 66.0.0
    Uninstalling setuptools-66.0.0:
      Successfully uninstalled setuptools-66.0.0
Successfully installed setuptools-59.5.0

3.2 ModuleNotFoundError: No module named ‘mdtex2html’

(moss) xf@VP01:~/ai/nlp/moss$ python moss_gui_demo.py
2023-04-24 00:53:12.226447: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-04-24 00:53:12.645032: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "moss_gui_demo.py", line 4, in <module>
    import mdtex2html
ModuleNotFoundError: No module named 'mdtex2html'

MOSS的gui缺失了mdtex2html
pip install mdtex2html

(moss) xf@VP01:~/ai/nlp/moss$ pip install mdtex2html
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
Collecting mdtex2html
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/47/fa/5156a032ad68f6c32ae0dc3aaf8b3d690004b42497d4735a08bb4cea6ec3/mdtex2html-1.2.0-py3-none-any.whl (13 kB)
Collecting latex2mathml
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/44/08/6c207389e184361c262a1f85819305cf264d01d0f4586604585897a70069/latex2mathml-3.75.2-py3-none-any.whl (73 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.1/73.1 kB 1.5 MB/s eta 0:00:00
Requirement already satisfied: markdown in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from mdtex2html) (3.4.3)
Requirement already satisfied: importlib-metadata>=4.4 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from markdown->mdtex2html) (6.6.0)
Requirement already satisfied: zipp>=0.5 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from importlib-metadata>=4.4->markdown->mdtex2html) (3.15.0)
Installing collected packages: latex2mathml, mdtex2html
Successfully installed latex2mathml-3.75.2 mdtex2html-1.2.0

3.3 ModuleNotFoundError: No module named ‘gradio’

(moss) xf@VP01:~/ai/nlp/moss$ python moss_gui_demo.py
2023-04-24 00:57:06.728079: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-04-24 00:57:07.088262: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "moss_gui_demo.py", line 5, in <module>
    import gradio as gr
ModuleNotFoundError: No module named 'gradio'

缺什么补什么
pip install gradio

(moss) xf@VP01:~/ai/nlp/moss$ pip install gradio
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple, https://pypi.ngc.nvidia.com
Collecting gradio
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b0/fb/ee0d1e9d4844de4da4d2293474a36e97c40ac2a9a84736f38af448443bb6/gradio-3.27.0-py3-none-any.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 69.4 MB/s eta 0:00:00
Collecting orjson
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/68/5c/de3ab2cd34c040d73ebc81858eb30f20e49d75ce7b859b5534294fdf8d54/orjson-3.8.10-cp38-cp38-manylinux_2_28_x86_64.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 196.5 MB/s eta 0:00:00
Requirement already satisfied: markupsafe in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (2.1.2)
Requirement already satisfied: matplotlib in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (3.7.1)
Requirement already satisfied: pyyaml in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (6.0)
Collecting jinja2
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bc/c3/f068337a370801f372f2f8f6bad74a5c140f6fda3d9de154052708dd3c65/Jinja2-3.1.2-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 211.4 MB/s eta 0:00:00
Requirement already satisfied: pandas in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (2.0.0)
Requirement already satisfied: huggingface-hub>=0.13.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (0.13.4)
Requirement already satisfied: requests in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (2.28.1)
Requirement already satisfied: typing-extensions in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (4.5.0)
Collecting aiofiles
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a8/76/635aa4f210d46ca105bfedd42d41f649b91d3e58422912726fc5e7965442/aiofiles-23.1.0-py3-none-any.whl (14 kB)
Collecting python-multipart
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b4/ff/b1e11d8bffb5e0e1b6d27f402eeedbeb9be6df2cdbc09356a1ae49806dbf/python_multipart-0.0.6-py3-none-any.whl (45 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.7/45.7 kB 62.6 MB/s eta 0:00:00
Requirement already satisfied: aiohttp in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (3.8.4)
Collecting fastapi
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2e/84/d289e941ffec2f107d9097c8f7c2dbc874b0fc3fab9776aa3cc366d45ab2/fastapi-0.95.1-py3-none-any.whl (56 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.0/57.0 kB 104.7 MB/s eta 0:00:00
Collecting markdown-it-py[linkify]>=2.0.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bf/25/2d88e8feee8e055d015343f9b86e370a1ccbec546f2865c98397aaef24af/markdown_it_py-2.2.0-py3-none-any.whl (84 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.5/84.5 kB 459.5 MB/s eta 0:00:00
Collecting pydantic
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f1/bd/0dad4908e5f693b7951b68f435139ec583f5eebb3d75505e1efa0f2284fe/pydantic-1.10.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 73.6 MB/s eta 0:00:00
Collecting websockets>=10.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/dd/b7/ed3575a038d2d7b242fb8ced354c7dbcc8c8ea170b7cf33b62f31df7896c/websockets-11.0.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 130.1/130.1 kB 93.8 MB/s eta 0:00:00
Collecting gradio-client>=0.1.3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c8/3b/4d18bb1e7311e60d6f65624a6667cdf769d367d53e0c472dc89a2fb9c93d/gradio_client-0.1.3-py3-none-any.whl (286 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 286.2/286.2 kB 124.9 MB/s eta 0:00:00
Collecting pydub
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a6/53/d78dc063216e62fc55f6b2eebb447f6a4b0a59f55c8406376f76bf959b08/pydub-0.25.1-py2.py3-none-any.whl (32 kB)
Collecting httpx
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/4e/c1/692013f1e6115a061a14f6c7d05947515a1eb7b85ef6e9bf0ffbf0e92738/httpx-0.24.0-py3-none-any.whl (75 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.3/75.3 kB 81.3 MB/s eta 0:00:00
Requirement already satisfied: numpy in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (1.23.5)
Collecting mdit-py-plugins<=0.3.3
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/33/eb/c358112e8265f827cf8228eda36cf2a720ad933f5ca66f47f808edf4bb34/mdit_py_plugins-0.3.3-py3-none-any.whl (50 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.5/50.5 kB 197.8 MB/s eta 0:00:00
Collecting ffmpy
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bf/e2/947df4b3d666bfdd2b0c6355d215c45d2d40f929451cb29a8a2995b29788/ffmpy-0.3.0.tar.gz (4.8 kB)
  Preparing metadata (setup.py) ... done
Collecting semantic-version
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6a/23/8146aad7d88f4fcb3a6218f41a60f6c2d4e3a72de72da1825dc7c8f7877c/semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Collecting altair>=4.2.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/18/62/47452306e84d4d2e67f9c559380aeb230f5e6ca84fafb428dd36b96a99ba/altair-4.2.2-py3-none-any.whl (813 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 813.6/813.6 kB 263.1 MB/s eta 0:00:00
Collecting uvicorn
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8c/f1/7c45fe2a09133e103dcf0621831545c268cd3f7a5d58dc7e470be91b2cd0/uvicorn-0.21.1-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.8/57.8 kB 217.6 MB/s eta 0:00:00
Requirement already satisfied: pillow in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio) (9.4.0)
Collecting toolz
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7f/5c/922a3508f5bda2892be3df86c74f9cf1e01217c2b1f8a0ac4841d903e3e9/toolz-0.12.0-py3-none-any.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 kB 298.1 MB/s eta 0:00:00
Collecting entrypoints
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/35/a8/365059bbcd4572cbc41de17fd5b682be5868b218c3c5479071865cab9078/entrypoints-0.4-py3-none-any.whl (5.3 kB)
Collecting jsonschema>=3.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c1/97/c698bd9350f307daad79dd740806e1a59becd693bd11443a0f531e3229b3/jsonschema-4.17.3-py3-none-any.whl (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.4/90.4 kB 215.0 MB/s eta 0:00:00
Requirement already satisfied: packaging in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio-client>=0.1.3->gradio) (23.1)
Requirement already satisfied: fsspec in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from gradio-client>=0.1.3->gradio) (2023.4.0)
Requirement already satisfied: tqdm>=4.42.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from huggingface-hub>=0.13.0->gradio) (4.65.0)
Requirement already satisfied: filelock in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from huggingface-hub>=0.13.0->gradio) (3.12.0)
Collecting mdurl~=0.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting linkify-it-py<3,>=1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fa/1a/2280e2eb892162ef5c0480a131d1d176b61f5f24abdce8dd9862454f7d14/linkify_it_py-2.0.0-py3-none-any.whl (19 kB)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from pandas->gradio) (2.8.2)
Requirement already satisfied: tzdata>=2022.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from pandas->gradio) (2023.3)
Requirement already satisfied: pytz>=2020.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from pandas->gradio) (2023.3)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->gradio) (4.0.2)
Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->gradio) (2.0.4)
Requirement already satisfied: attrs>=17.3.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->gradio) (23.1.0)
Requirement already satisfied: multidict<7.0,>=4.5 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->gradio) (6.0.4)
Requirement already satisfied: yarl<2.0,>=1.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->gradio) (1.9.1)
Requirement already satisfied: aiosignal>=1.1.2 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->gradio) (1.3.1)
Requirement already satisfied: frozenlist>=1.1.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from aiohttp->gradio) (1.3.3)
Collecting starlette<0.27.0,>=0.26.1
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/12/48/f9c1ec6bee313aba264fbc2483d9070f4e4526f2538e2b55b1e4a391d938/starlette-0.26.1-py3-none-any.whl (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.9/66.9 kB 129.3 MB/s eta 0:00:00
Collecting httpcore<0.18.0,>=0.15.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6c/39/05ebe30333ec66bba849d3c25c85d759b94c43bb03b2222de051c50d4390/httpcore-0.17.0-py3-none-any.whl (70 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.6/70.6 kB 129.0 MB/s eta 0:00:00
Requirement already satisfied: certifi in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from httpx->gradio) (2022.12.7)
Collecting sniffio
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c3/a0/5dba8ed157b0136607c7f2151db695885606968d1fae123dc3391e0cfdbf/sniffio-1.3.0-py3-none-any.whl (10 kB)
Requirement already satisfied: idna in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from httpx->gradio) (3.4)
Requirement already satisfied: fonttools>=4.22.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from matplotlib->gradio) (4.39.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from matplotlib->gradio) (1.4.4)
Requirement already satisfied: contourpy>=1.0.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from matplotlib->gradio) (1.0.7)
Requirement already satisfied: pyparsing>=2.3.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from matplotlib->gradio) (3.0.9)
Requirement already satisfied: importlib-resources>=3.2.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from matplotlib->gradio) (5.12.0)
Requirement already satisfied: cycler>=0.10 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from matplotlib->gradio) (0.11.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from requests->gradio) (1.26.15)
Collecting h11>=0.8
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 213.3 MB/s eta 0:00:00
Collecting click>=7.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c2/f1/df59e28c642d583f7dacffb1e0965d0e00b218e0186d7858ac5233dce840/click-8.1.3-py3-none-any.whl (96 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 kB 142.0 MB/s eta 0:00:00
Collecting anyio<5.0,>=3.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/77/2b/b4c0b7a3f3d61adb1a1e0b78f90a94e2b6162a043880704b7437ef297cad/anyio-3.6.2-py3-none-any.whl (80 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.6/80.6 kB 329.9 MB/s eta 0:00:00
Requirement already satisfied: zipp>=3.1.0 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from importlib-resources>=3.2.0->matplotlib->gradio) (3.15.0)
Collecting pkgutil-resolve-name>=1.3.10
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c9/5c/3d4882ba113fd55bdba9326c1e4c62a15e674a2501de4869e6bd6301f87e/pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/64/de/375aa14daaee107f987da76ca32f7a907fea00fa8b8afb67dc09bec0de91/pyrsistent-0.19.3-py3-none-any.whl (57 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 kB 463.0 MB/s eta 0:00:00
Collecting uc-micro-py
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/14/0e/738dbd15b1afe372d0d788e1e2112cfa67c9cf9e1c777360eaf9cd429caf/uc_micro_py-1.0.1-py3-none-any.whl (6.2 kB)
Requirement already satisfied: six>=1.5 in /home/xf/anaconda3/envs/moss/lib/python3.8/site-packages (from python-dateutil>=2.8.2->pandas->gradio) (1.16.0)
Building wheels for collected packages: ffmpy
  Building wheel for ffmpy (setup.py) ... done
  Created wheel for ffmpy: filename=ffmpy-0.3.0-py3-none-any.whl size=4711 sha256=2f79899352d3e8e4eef2f704aaaf529471b2108c8f0d8e235cd36ebd09c8b23c
  Stored in directory: /tmp/pip-ephem-wheel-cache-0g84p6vn/wheels/75/df/de/5e20589ee5783667772dab48861912839245af96a4d69f4f14
Successfully built ffmpy
Installing collected packages: pydub, ffmpy, websockets, uc-micro-py, toolz, sniffio, semantic-version, python-multipart, pyrsistent, pydantic, pkgutil-resolve-name, orjson, mdurl, jinja2, h11, entrypoints, click, aiofiles, uvicorn, markdown-it-py, linkify-it-py, jsonschema, anyio, starlette, mdit-py-plugins, httpcore, altair, httpx, fastapi, gradio-client, gradio
Successfully installed aiofiles-23.1.0 altair-4.2.2 anyio-3.6.2 click-8.1.3 entrypoints-0.4 fastapi-0.95.1 ffmpy-0.3.0 gradio-3.27.0 gradio-client-0.1.3 h11-0.14.0 httpcore-0.17.0 httpx-0.24.0 jinja2-3.1.2 jsonschema-4.17.3 linkify-it-py-2.0.0 markdown-it-py-2.2.0 mdit-py-plugins-0.3.3 mdurl-0.1.2 orjson-3.8.10 pkgutil-resolve-name-1.3.10 pydantic-1.10.7 pydub-0.25.1 pyrsistent-0.19.3 python-multipart-0.0.6 semantic-version-2.10.0 sniffio-1.3.0 starlette-0.26.1 toolz-0.12.0 uc-micro-py-1.0.1 uvicorn-0.21.1 websockets-11.0.2

本章完

您可能感兴趣的与本文相关的镜像

PyTorch 2.5

PyTorch 2.5

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值