国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Langchain-Chatchat-Ubuntu服務(wù)器本地安裝部署筆記

這篇具有很好參考價(jià)值的文章主要介紹了Langchain-Chatchat-Ubuntu服務(wù)器本地安裝部署筆記。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

?Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 與 ChatGLM 等語言模型的本地知識(shí)庫問答 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM) QA app with langchain。

? ? ? ? 開源網(wǎng)址:https://github.com/chatchat-space/Langchain-Chatchat

?? ? ? ? 因?yàn)檫@是自己畢設(shè)項(xiàng)目所需,利用虛擬機(jī)實(shí)驗(yàn)一下是否能成功部署。項(xiàng)目參考:Langchain-Chatchat-win10本地安裝部署成功筆記(CPU)_file "d:\ai\virtual-digital-human\langchain-chatch-CSDN博客

其中有些是自己遇到的坑也會(huì)在這里說一下。

一、實(shí)驗(yàn)環(huán)境

可以查看目前使用的系統(tǒng)版本信息。

cat /proc/version
Linux version 5.15.133.1-microsoft-standard-WSL2 (root@1c602f52c2e4) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Thu Oct 5 21:02:42 UTC 2023

如果安裝有顯卡驅(qū)動(dòng),可以使用下面的代碼來查看顯卡信息。

nvidia-smi  #查看顯卡信息

Sat Mar  9 19:31:33 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.40.06              Driver Version: 551.23         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3090        On  |   00000000:AF:00.0 Off |                  N/A |
| 32%   25C    P8              6W /  350W |     134MiB /  24576MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA GeForce RTX 3090        On  |   00000000:D8:00.0 Off |                  N/A |
| 32%   24C    P8             11W /  350W |     144MiB /  24576MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                   
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A       227      G   /Xwayland                                   N/A      |
|    1   N/A  N/A       227      G   /Xwayland                                   N/A      |
+-----------------------------------------------------------------------------------------+

二、安裝步驟

1、安裝 Anaconda軟件,用于管理python虛擬環(huán)境

自己使用的是清華鏡像:Index of /anaconda/archive/ | 清華大學(xué)開源軟件鏡像站 | Tsinghua Open Source Mirror

wget下載命令如下:

?wget -c 'https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh' -P <下載到的文件的位置>

?2、創(chuàng)建python運(yùn)行虛擬環(huán)境

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)?

可以通過?conda info --envs 檢查環(huán)境是否創(chuàng)建完成。

# conda environments:
#
base                     /home/david/anaconda3
NAD                      /home/david/anaconda3/envs/NAD
chat                     /home/david/anaconda3/envs/chat
chat_demo                /home/david/anaconda3/envs/chat_demo

進(jìn)入已經(jīng)創(chuàng)建好的虛擬環(huán)境:conda activate 環(huán)境名稱

$ conda activate chat_demo
(chat_demo) $ python --version
Python 3.11.7

3、安裝pytorch

~$ pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting torch
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2c/df/5810707da6f2fd4be57f0cc417987c0fa16a2eecf0b1b71f82ea555dc619/torch-2.2.1-cp311-cp311-manylinux1_x86_64.whl (755.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 755.6/755.6 MB 2.4 MB/s eta 0:00:00
Collecting torchvision
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3a/49/12fc5188602c68a789a0fdaee63d176a71ad5c1e34d25aeb8554abe46089/torchvision-0.17.1-cp311-cp311-manylinux1_x86_64.whl (6.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.9/6.9 MB 6.6 MB/s eta 0:00:00
Collecting torchaudio
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a6/57/ccebdda4db80e384166c70d8645fa998637051b3b19aca1fd8de80602afb/torchaudio-2.2.1-cp311-cp311-manylinux1_x86_64.whl (3.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 6.7 MB/s eta 0:00:00
Collecting filelock (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/81/54/84d42a0bee35edba99dee7b59a8d4970eccdd44b99fe728ed912106fc781/filelock-3.13.1-py3-none-any.whl (11 kB)
Collecting typing-extensions>=4.8.0 (from torch)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f9/de/dc04a3ea60b22624b51c703a84bbe0184abcd1d0b9bc8074b5d6b7ab90bb/typing_extensions-4.10.0-py3-none-any.whl (33 kB)
Collecting sympy (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d2/05/e6600db80270777c4a64238a98d442f0fd07cc8915be2a1c16da7f2b9e74/sympy-1.12-py3-none-any.whl (5.7 MB)
Collecting networkx (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d5/f0/8fbc882ca80cf077f1b246c0e3c3465f7f415439bdea6b899f6b19f61f70/networkx-3.2.1-py3-none-any.whl (1.6 MB)
Collecting jinja2 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/30/6d/6de6be2d02603ab56e72997708809e8a5b0fbfee080735109b40a3564843/Jinja2-3.1.3-py3-none-any.whl (133 kB)
Collecting fsspec (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ad/30/2281c062222dc39328843bd1ddd30ff3005ef8e30b2fd09c4d2792766061/fsspec-2024.2.0-py3-none-any.whl (170 kB)
Collecting nvidia-cuda-nvrtc-cu12==12.1.105 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b6/9f/c64c03f49d6fbc56196664d05dba14e3a561038a81a638eeb47f4d4cfd48/nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (23.7 MB)
Collecting nvidia-cuda-runtime-cu12==12.1.105 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/eb/d5/c68b1d2cdfcc59e72e8a5949a37ddb22ae6cade80cd4a57a84d4c8b55472/nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (823 kB)
Collecting nvidia-cuda-cupti-cu12==12.1.105 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/7e/00/6b218edd739ecfc60524e585ba8e6b00554dd908de2c9c66c1af3e44e18d/nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (14.1 MB)
Collecting nvidia-cudnn-cu12==8.9.2.26 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ff/74/a2e2be7fb83aaedec84f391f082cf765dfb635e7caa9b49065f73e4835d8/nvidia_cudnn_cu12-8.9.2.26-py3-none-manylinux1_x86_64.whl (731.7 MB)
Collecting nvidia-cublas-cu12==12.1.3.1 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/37/6d/121efd7382d5b0284239f4ab1fc1590d86d34ed4a4a2fdb13b30ca8e5740/nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl (410.6 MB)
Collecting nvidia-cufft-cu12==11.0.2.54 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/86/94/eb540db023ce1d162e7bea9f8f5aa781d57c65aed513c33ee9a5123ead4d/nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl (121.6 MB)
Collecting nvidia-curand-cu12==10.3.2.106 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/44/31/4890b1c9abc496303412947fc7dcea3d14861720642b49e8ceed89636705/nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl (56.5 MB)
Collecting nvidia-cusolver-cu12==11.4.5.107 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bc/1d/8de1e5c67099015c834315e333911273a8c6aaba78923dd1d1e25fc5f217/nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl (124.2 MB)
Collecting nvidia-cusparse-cu12==12.1.0.106 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/65/5b/cfaeebf25cd9fdec14338ccb16f6b2c4c7fa9163aefcf057d86b9cc248bb/nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl (196.0 MB)
Collecting nvidia-nccl-cu12==2.19.3 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/38/00/d0d4e48aef772ad5aebcf70b73028f88db6e5640b36c38e90445b7a57c45/nvidia_nccl_cu12-2.19.3-py3-none-manylinux1_x86_64.whl (166.0 MB)
Collecting nvidia-nvtx-cu12==12.1.105 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/da/d3/8057f0587683ed2fcd4dbfbdfdfa807b9160b809976099d36b8f60d08f03/nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl (99 kB)
Collecting triton==2.2.0 (from torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bd/ac/3974caaa459bf2c3a244a84be8d17561f631f7d42af370fc311defeca2fb/triton-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (167.9 MB)
Collecting nvidia-nvjitlink-cu12 (from nvidia-cusolver-cu12==11.4.5.107->torch)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/58/d1/d1c80553f9d5d07b6072bc132607d75a0ef3600e28e1890e11c0f55d7346/nvidia_nvjitlink_cu12-12.4.99-py3-none-manylinux2014_x86_64.whl (21.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.1/21.1 MB 6.6 MB/s eta 0:00:00
Collecting numpy (from torchvision)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/3a/d0/edc009c27b406c4f9cbc79274d6e46d634d139075492ad055e3d68445925/numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)
Collecting pillow!=8.3.*,>=5.3.0 (from torchvision)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/66/9c/2e1877630eb298bbfd23f90deeec0a3f682a4163d5ca9f178937de57346c/pillow-10.2.0-cp311-cp311-manylinux_2_28_x86_64.whl (4.5 MB)
Collecting MarkupSafe>=2.0 (from jinja2->torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/97/18/c30da5e7a0e7f4603abfc6780574131221d9148f323752c2755d48abad30/MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28 kB)
Collecting mpmath>=0.19 (from sympy->torch)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: mpmath, typing-extensions, sympy, pillow, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, numpy, networkx, MarkupSafe, fsspec, filelock, triton, nvidia-cusparse-cu12, nvidia-cudnn-cu12, jinja2, nvidia-cusolver-cu12, torch, torchvision, torchaudio
Successfully installed MarkupSafe-2.1.5 filelock-3.13.1 fsspec-2024.2.0 jinja2-3.1.3 mpmath-1.3.0 networkx-3.2.1 numpy-1.26.4 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.19.3 nvidia-nvjitlink-cu12-12.4.99 nvidia-nvtx-cu12-12.1.105 pillow-10.2.0 sympy-1.12 torch-2.2.1 torchaudio-2.2.1 torchvision-0.17.1 triton-2.2.0 typing-extensions-4.10.0

驗(yàn)證是否安裝成功:

~$ python
Python 3.11.7 (main, Dec 15 2023, 18:12:31) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> x = torch.rand(5,3)
>>> print(x)
tensor([[0.8278, 0.8746, 0.1025],
        [0.7528, 0.6855, 0.7386],
        [0.6271, 0.1371, 0.1849],
        [0.4098, 0.3203, 0.7615],
        [0.5088, 0.7645, 0.8044]])

4、拉取Langchain-Chatchat源代碼

?有兩種方式獲取源代碼,一種是獲取最新代碼,一種是獲取指定版本的源代碼。

# 拉取倉庫

git clone https://github.com/chatchat-space/Langchain-Chatchat.git

# 指定版本獲取代碼

git clone -b v0.2.6 https://github.com/chatchat-space/Langchain-Chatchat.git

在拉取源代碼之前先安裝 git

5、安裝依賴包

cd Langchain-Chatchat

pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
Found existing installation: triton 2.2.0
    Uninstalling triton-2.2.0:
      Successfully uninstalled triton-2.2.0
  Attempting uninstall: pillow
    Found existing installation: pillow 10.2.0
    Uninstalling pillow-10.2.0:
      Successfully uninstalled pillow-10.2.0
  Attempting uninstall: nvidia-nccl-cu12
    Found existing installation: nvidia-nccl-cu12 2.19.3
    Uninstalling nvidia-nccl-cu12-2.19.3:
      Successfully uninstalled nvidia-nccl-cu12-2.19.3
  Attempting uninstall: numpy
    Found existing installation: numpy 1.26.4
    Uninstalling numpy-1.26.4:
      Successfully uninstalled numpy-1.26.4
  Attempting uninstall: torch
    Found existing installation: torch 2.2.1
    Uninstalling torch-2.2.1:
      Successfully uninstalled torch-2.2.1
  Attempting uninstall: torchvision
    Found existing installation: torchvision 0.17.1
    Uninstalling torchvision-0.17.1:
      Successfully uninstalled torchvision-0.17.1
  Attempting uninstall: torchaudio
    Found existing installation: torchaudio 2.2.1
    Uninstalling torchaudio-2.2.1:
      Successfully uninstalled torchaudio-2.2.1
Successfully installed PyMuPDF-1.23.16 PyMuPDFb-1.23.9 SQLAlchemy-2.0.25 Shapely-2.0.3 XlsxWriter-3.2.0 accelerate-0.24.1 aiofiles-23.2.1 aiohttp-3.9.3 aioprometheus-23.12.0 aiosignal-1.3.1 altair-5.2.0 antlr4-python3-runtime-4.9.3 anyio-4.3.0 arxiv-2.1.0 attrs-23.2.0 backoff-2.2.1 beautifulsoup4-4.12.3 blinker-1.7.0 blis-0.7.11 brotli-1.1.0 cachetools-5.3.3 catalogue-2.0.10 certifi-2024.2.2 cffi-1.16.0 chardet-5.2.0 charset-normalizer-3.3.2 click-8.1.7 cloudpathlib-0.16.0 coloredlogs-15.0.1 confection-0.1.4 contourpy-1.2.0 cryptography-42.0.5 cycler-0.12.1 cymem-2.0.8 dataclasses-json-0.6.4 deepdiff-6.7.1 deprecated-1.2.14 deprecation-2.1.0 distro-1.9.0 duckduckgo-search-3.9.9 effdet-0.4.1 einops-0.7.0 emoji-2.10.1 et-xmlfile-1.1.0 faiss-cpu-1.7.4 fastapi-0.109.0 feedparser-6.0.10 filetype-1.2.0 flatbuffers-24.3.7 fonttools-4.49.0 frozenlist-1.4.1 fschat-0.2.35 gitdb-4.0.11 gitpython-3.1.42 greenlet-3.0.3 h11-0.14.0 h2-4.1.0 hpack-4.0.0 httpcore-1.0.4 httptools-0.6.1 httpx-0.26.0 httpx_sse-0.4.0 huggingface-hub-0.21.4 humanfriendly-10.0 hyperframe-6.0.1 idna-3.6 importlib-metadata-7.0.2 iniconfig-2.0.0 iopath-0.1.10 joblib-1.3.2 jsonpatch-1.33 jsonpath-python-1.0.6 jsonpointer-2.4 jsonschema-4.21.1 jsonschema-specifications-2023.12.1 kiwisolver-1.4.5 langchain-0.0.354 langchain-community-0.0.20 langchain-core-0.1.23 langchain-experimental-0.0.47 langcodes-3.3.0 langdetect-1.0.9 langsmith-0.0.87 layoutparser-0.3.4 llama-index-0.9.35 lxml-5.1.0 markdown-3.5.2 markdown-it-py-3.0.0 markdown2-2.4.13 markdownify-0.11.6 marshmallow-3.21.1 matplotlib-3.8.3 mdurl-0.1.2 metaphor-python-0.1.23 msg-parser-1.2.0 msgpack-1.0.8 multidict-6.0.5 murmurhash-1.0.10 mypy-extensions-1.0.0 nest-asyncio-1.6.0 nh3-0.2.15 ninja-1.11.1.1 nltk-3.8.1 numexpr-2.8.6 numpy-1.24.4 nvidia-nccl-cu12-2.18.1 olefile-0.47 omegaconf-2.3.0 onnx-1.15.0 onnxruntime-1.15.1 openai-1.9.0 opencv-python-4.9.0.80 openpyxl-3.1.2 ordered-set-4.1.0 orjson-3.9.15 packaging-23.2 pandas-2.0.3 pathlib-1.0.1 pdf2image-1.17.0 pdfminer.six-20231228 pdfplumber-0.11.0 pikepdf-8.4.1 pillow-9.5.0 pillow-heif-0.15.0 pluggy-1.4.0 portalocker-2.8.2 preshed-3.0.9 prompt-toolkit-3.0.43 protobuf-4.25.3 psutil-5.9.8 pyarrow-15.0.1 pyclipper-1.3.0.post5 pycocotools-2.0.7 pycparser-2.21 pydantic-1.10.13 pydeck-0.8.1b0 pygments-2.17.2 pyjwt-2.8.0 pypandoc-1.13 pyparsing-3.1.2 pypdf-4.1.0 pypdfium2-4.27.0 pytesseract-0.3.10 pytest-7.4.3 python-dateutil-2.9.0.post0 python-decouple-3.8 python-docx-1.1.0 python-dotenv-1.0.1 python-iso639-2024.2.7 python-magic-0.4.27 python-multipart-0.0.9 python-pptx-0.6.23 pytz-2024.1 pyyaml-6.0.1 quantile-python-1.1 rapidfuzz-3.6.2 rapidocr_onnxruntime-1.3.8 ray-2.9.3 referencing-0.33.0 regex-2023.12.25 requests-2.31.0 rich-13.7.1 rpds-py-0.18.0 safetensors-0.4.2 scikit-learn-1.4.1.post1 scipy-1.12.0 sentence_transformers-2.2.2 sentencepiece-0.2.0 sgmllib3k-1.0.0 shortuuid-1.0.12 simplejson-3.19.2 six-1.16.0 smart-open-6.4.0 smmap-5.0.1 sniffio-1.3.1 socksio-1.0.0 soupsieve-2.5 spacy-3.7.2 spacy-legacy-3.0.12 spacy-loggers-1.0.5 srsly-2.4.8 sse_starlette-1.8.2 starlette-0.35.0 streamlit-1.30.0 streamlit-aggrid-0.3.4.post3 streamlit-antd-components-0.3.1 streamlit-chatbox-1.1.11 streamlit-feedback-0.1.3 streamlit-modal-0.1.0 streamlit-option-menu-0.3.12 strsimpy-0.2.1 svgwrite-1.4.3 tabulate-0.9.0 tenacity-8.2.3 thinc-8.2.3 threadpoolctl-3.3.0 tiktoken-0.5.2 timm-0.9.16 tokenizers-0.15.2 toml-0.10.2 toolz-0.12.1 torch-2.1.2 torchaudio-2.1.2 torchvision-0.16.2 tornado-6.4 tqdm-4.66.1 transformers-4.37.2 transformers_stream_generator-0.0.4 triton-2.1.0 typer-0.9.0 typing-inspect-0.9.0 tzdata-2024.1 tzlocal-5.2 unstructured-0.12.5 unstructured-client-0.21.1 unstructured-inference-0.7.23 unstructured.pytesseract-0.3.12 urllib3-2.2.1 uvicorn-0.28.0 uvloop-0.19.0 validators-0.22.0 vllm-0.2.7 wasabi-1.1.2 watchdog-3.0.0 watchfiles-0.21.0 wavedrom-2.0.3.post3 wcwidth-0.2.13 weasel-0.3.4 websockets-12.0 wrapt-1.16.0 xformers-0.0.23.post1 xlrd-2.0.1 yarl-1.9.4 youtube-search-2.1.2 zipp-3.17.0

6、下載模型

下載兩個(gè)模型:M3e-base 內(nèi)置模型和 chatglm3-6b 模型。

git lfs install

git clone https://gitee.com/hf-models/m3e-base.git

git clone https://gitee.com/hf-models/chatglm3-6b.git

如果需要上 huggingface.co 獲取模型可能需要科學(xué)上網(wǎng)工具。

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

7、修改配置文件

批量修改配置文件名

批量復(fù)制configs目錄下所有的配置文件,去掉example后綴:

# cd Langchain-Chatchat
# 批量復(fù)制configs目錄下所有配置文件,去掉example
python copy_config_example.py
修改model_config.py文件

修改m3e-base的模型本地路徑(注意是雙反斜杠"\\"):

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

修改server_config.py

0.2.6之前版本,需要修改0.0.0.0為127.0.0.1不然會(huì)報(bào)錯(cuò)。

# 各服務(wù)器默認(rèn)綁定host。如改為"0.0.0.0"需要修改下方所有XX_SERVER的host
DEFAULT_BIND_HOST = "127.0.0.1" if sys.platform != "win32" else "127.0.0.1"

8、初始化數(shù)據(jù)庫

python init_database.py --recreate-vs

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

配置里面模型的運(yùn)行設(shè)置設(shè)置為 auto (還是建議用顯卡跑)

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

9、一鍵啟動(dòng)項(xiàng)目

運(yùn)行:

python startup.py -a
==============================Langchain-Chatchat Configuration==============================
操作系統(tǒng):Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35.
python版本:3.11.7 (main, Dec 15 2023, 18:12:31) [GCC 11.2.0]
項(xiàng)目版本:v0.2.10
langchain版本:0.0.354. fastchat版本:0.2.35


當(dāng)前使用的分詞器:ChineseRecursiveTextSplitter
當(dāng)前啟動(dòng)的LLM模型:['chatglm3-6b'] @ cuda
{'device': 'cuda',
 'host': '127.0.0.1',
 'infer_turbo': False,
 'model_path': 'model/chatglm3-6b',
 'model_path_exists': True,
 'port': 20002}
當(dāng)前Embbedings模型: m3e-base @ cuda
==============================Langchain-Chatchat Configuration==============================


2024-03-09 20:18:03,837 - startup.py[line:655] - INFO: 正在啟動(dòng)服務(wù):
2024-03-09 20:18:03,838 - startup.py[line:656] - INFO: 如需查看 llm_api 日志,請(qǐng)前往 /home/david/20240207/Langchain-Chatchat/logs
/home/david/anaconda3/envs/chat_demo/lib/python3.11/site-packages/langchain_core/_api/deprecation.py:117: LangChainDeprecationWarning: 模型啟動(dòng)功能將于 Langchain-Chatchat 0.3.x重寫,支持更多模式和加速啟動(dòng),0.2.x中相關(guān)功能將廢棄
  warn_deprecated(
2024-03-09 20:18:10 | ERROR | stderr | INFO:     Started server process [329625]
2024-03-09 20:18:10 | ERROR | stderr | INFO:     Waiting for application startup.
2024-03-09 20:18:10 | ERROR | stderr | INFO:     Application startup complete.
2024-03-09 20:18:10 | ERROR | stderr | INFO:     Uvicorn running on http://127.0.0.1:20000 (Press CTRL+C to quit)
2024-03-09 20:18:10 | INFO | model_worker | Loading the model ['chatglm3-6b'] on worker 7b784767 ...
Loading checkpoint shards:   0%|                                                                                               | 0/7 [00:00<?, ?it/s]
2024-03-09 20:18:11 | ERROR | stderr | /home/david/anaconda3/envs/chat_demo/lib/python3.11/site-packages/torch/_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
2024-03-09 20:18:11 | ERROR | stderr |   return self.fget.__get__(instance, owner)()
Loading checkpoint shards:  14%|████████████▍                                                                          | 1/7 [00:03<00:21,  3.62s/it]
Loading checkpoint shards:  29%|████████████████████████▊                                                              | 2/7 [00:07<00:18,  3.74s/it]
Loading checkpoint shards:  43%|█████████████████████████████████████▎                                                 | 3/7 [00:08<00:10,  2.74s/it]
Loading checkpoint shards:  57%|█████████████████████████████████████████████████▋                                     | 4/7 [00:10<00:06,  2.09s/it]
Loading checkpoint shards:  71%|██████████████████████████████████████████████████████████████▏                        | 5/7 [00:11<00:03,  1.76s/it]
Loading checkpoint shards:  86%|██████████████████████████████████████████████████████████████████████████▌            | 6/7 [00:12<00:01,  1.63s/it]
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:13<00:00,  1.31s/it]
Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:13<00:00,  1.90s/it]
2024-03-09 20:18:24 | ERROR | stderr |
2024-03-09 20:18:30 | INFO | model_worker | Register to controller
INFO:     Started server process [329963]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:7861 (Press CTRL+C to quit)


==============================Langchain-Chatchat Configuration==============================
操作系統(tǒng):Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35.
python版本:3.11.7 (main, Dec 15 2023, 18:12:31) [GCC 11.2.0]
項(xiàng)目版本:v0.2.10
langchain版本:0.0.354. fastchat版本:0.2.35


當(dāng)前使用的分詞器:ChineseRecursiveTextSplitter
當(dāng)前啟動(dòng)的LLM模型:['chatglm3-6b'] @ cuda
{'device': 'cuda',
 'host': '127.0.0.1',
 'infer_turbo': False,
 'model_path': 'model/chatglm3-6b',
 'model_path_exists': True,
 'port': 20002}
當(dāng)前Embbedings模型: m3e-base @ cuda


服務(wù)端運(yùn)行信息:
    OpenAI API Server: http://127.0.0.1:20000/v1
    Chatchat  API  Server: http://127.0.0.1:7861
    Chatchat WEBUI Server: http://127.0.0.1:8501
==============================Langchain-Chatchat Configuration==============================



  You can now view your Streamlit app in your browser.

  URL: http://127.0.0.1:8501

配置成功!

常用命令:

sudo usermod -a -G sudo username? ? ? ? 為用戶添加sudo權(quán)限

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

?10、本地瀏覽器打開Linux遠(yuǎn)程服務(wù)器網(wǎng)頁

在需要進(jìn)行端口轉(zhuǎn)發(fā):

ssh -L 8501:127.0.0.1:8501 llama@172.17.135.6 -N

在瀏覽器(推薦使用Firefox)中打開?http://localhost:8501/即可進(jìn)入webUI。

ubuntu 安裝langchain-chatchat,Langchain-Chatchat 學(xué)習(xí),langchain,筆記,python,ubuntu,大數(shù)據(jù)

踩坑

1、使用 chatglm2-6b-int4 量化模型?,啟動(dòng)項(xiàng)目報(bào)錯(cuò):

AttributeError: 'NoneType' object has no attribute 'int4WeightExtractionHalf'

解決辦法:文章來源地址http://www.zghlxwxcb.cn/news/detail-844561.html

pip install cpm_kernels

到了這里,關(guān)于Langchain-Chatchat-Ubuntu服務(wù)器本地安裝部署筆記的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • LangChain-Chatchat 開源知識(shí)庫來了

    LangChain-Chatchat 開源知識(shí)庫來了

    LangChain-Chatchat 是基于 ChatGLM 等大語言模型與 LangChain 等應(yīng)用框架實(shí)現(xiàn),開源、可離線部署的 RAG 檢索增強(qiáng)生成大模型知識(shí)庫項(xiàng)目。最新版本為 v0.2.10,目前已收獲 26.7k Stars,非常不錯(cuò)的一個(gè)開源知識(shí)庫項(xiàng)目。 項(xiàng)目地址:https://github.com/chatchat-space/Langchain-Chatchat 顧名思義,LangC

    2024年04月17日
    瀏覽(18)
  • LangChain-Chatchat學(xué)習(xí)資料-Windows開發(fā)部署

    LangChain-Chatchat學(xué)習(xí)資料-Windows開發(fā)部署

    1.LacnChain-Chatchat項(xiàng)目 本人使用的是Windows10專業(yè)版22H2版本,已經(jīng)安裝了Python3.10,CUDA11.8版本,miniconda3。 硬件采用聯(lián)想R9000P,AMD R7 5800H,16G內(nèi)存,RTX3060 6G。 默認(rèn)依賴包括基本運(yùn)行環(huán)境(FAISS向量庫)。如果要使用 milvus/pg_vector 等向量庫,請(qǐng)將 requirements.txt 中相應(yīng)依賴取消注釋再

    2024年02月11日
    瀏覽(18)
  • Langchain-Chatchat大語言模型本地知識(shí)庫的踩坑、部署、使用

    Langchain-Chatchat大語言模型本地知識(shí)庫的踩坑、部署、使用

    Langchain-Chatchat是一個(gè)基于ChatGLM大語言模型與Langchain應(yīng)用框架實(shí)現(xiàn),開源、可離線部署的檢索增強(qiáng)生成(RAG)大模型的本地知識(shí)庫問答應(yīng)用項(xiàng)目。 GitHub: https://github.com/chatchat-space/Langchain-Chatchat 本項(xiàng)目實(shí)現(xiàn)原理如下圖所示,過程包括加載文件 - 讀取文本 - 文本分割 - 文本向量化

    2024年02月04日
    瀏覽(49)
  • 【AI】Langchain-Chatchat搭建本地知識(shí)庫-未完,先記錄踩的坑

    【AI】Langchain-Chatchat搭建本地知識(shí)庫-未完,先記錄踩的坑

    事先說一下,我本地的顯卡4070只有12G顯存,無法運(yùn)行本地知識(shí)庫,我把自己折騰的過程和遇到的坑先記錄一下吧,后續(xù)如果有算力的話就再跑一遍試試。后續(xù)來了:【AI】使用阿里云免費(fèi)服務(wù)器搭建Langchain-Chatchat本地知識(shí)庫 Langchain-Chatchat曾用名Langchain-ChatGLM,是智譜AI的本地

    2024年02月04日
    瀏覽(23)
  • AI-基于Langchain-Chatchat和chatglm3-6b部署私有本地知識(shí)庫

    AI-基于Langchain-Chatchat和chatglm3-6b部署私有本地知識(shí)庫

    手把手教你搭建本地知識(shí)庫問答AI機(jī)器人 LangChain-Chatchat:基于LangChain和ChatGLM2-6B構(gòu)建本地離線私有化知識(shí)庫 在家庭私有云上部署體驗(yàn)語言模型chatglm3-6b,打造私人助理 手把手教大家在本地運(yùn)行ChatGLM3-6B大模型(一) 自從去年GPT模型火爆以來,降低了很多個(gè)人和企業(yè)進(jìn)入人工智

    2024年02月20日
    瀏覽(30)
  • LLMs之RAG:LangChain-Chatchat(一款中文友好的全流程本地知識(shí)庫問答應(yīng)用)的簡介(支持 FastChat 接入的ChatGLM-2/LLaMA-2等多款主流LLMs+多款embe

    LLMs之RAG:LangChain-Chatchat(一款中文友好的全流程本地知識(shí)庫問答應(yīng)用)的簡介(支持 FastChat 接入的ChatGLM-2/LLaMA-2等多款主流LLMs+多款embe

    LLMs之RAG:LangChain-Chatchat(一款中文友好的全流程本地知識(shí)庫問答應(yīng)用)的簡介(支持?FastChat 接入的ChatGLM-2/LLaMA-2等多款主流LLMs+多款embedding模型m3e等+多種TextSplitter分詞器)、安裝(鏡像部署【AutoDL云平臺(tái)/Docker鏡像】,離線私有部署+支持RTX3090 ,支持FAISS/Milvus/PGVector向量庫, 基于

    2024年02月08日
    瀏覽(25)
  • ubuntu服務(wù)器配置ftp服務(wù)

    ubuntu服務(wù)器配置ftp服務(wù)

    目錄 ?一、安裝vsftpd 二、配置vsftpd 三、設(shè)置安全組 四、客戶端測(cè)試 SFTP服務(wù)的配置看主頁的下一篇博客:ubuntu云服務(wù)器配置SFTP服務(wù)-CSDN博客 需求:配置ftp服務(wù)用于在windows電腦上直接瀏覽、下載、上傳ubuntu服務(wù)器上的文件,用于文件共享,方便實(shí)用 效果:用戶打開windows資源

    2024年02月13日
    瀏覽(22)
  • Ubuntu 配置 Samba 服務(wù)器

    手把手教程 Samba 服務(wù)器讓設(shè)備之間傳輸文件更便捷 在 Ubuntu 16.04 和 18.04 配置 用于為root用戶添加Samba密碼,以便允許root用戶訪問Samba共享 編輯配置文件/etc/samba/smb.conf,添加服務(wù)器的共享文件夾,設(shè)置用戶權(quán)限 在文件末尾添加 并且 ctrl + f 搜索 syslog,找到syslog = 0,注釋掉它(

    2024年02月05日
    瀏覽(30)
  • ubuntu 代理服務(wù)器的設(shè)置

    準(zhǔn)備: 具備公網(wǎng)IP服務(wù)器(Ubuntu 18.04.4 LTS,阿里云) 本地計(jì)算機(jī)(Ubuntu 20.04 LTS) 操作: 1.在服務(wù)器安裝程序tinyproxy. apt update apt install tinyproxy 2.在服務(wù)器打開配置文件 vim /etc/tinyproxy/tinyproxy.conf 3.在配置文件中查找以下參數(shù),并進(jìn)行更改 #定義監(jiān)聽端口,默認(rèn)端口為8888,當(dāng)然

    2024年02月07日
    瀏覽(21)
  • ubuntu部署gitlab服務(wù)器

    ubuntu部署gitlab服務(wù)器

    筆者使用的ubuntu版本為20.04,gitlab版本為16.2.1 (此篇文章部分引用他人文件,單純記錄,如有侵權(quán)請(qǐng)聯(lián)系) 遇到圖中情況點(diǎn)擊tab跳轉(zhuǎn)到確定上點(diǎn)擊回車。 前往Gitlab官網(wǎng):https://packages.gitlab.com/gitlab/gitlab-ce,找到最新版本的 gitlab-ce 安裝包,注意版本是 ubuntu/focal 。 如果運(yùn)行

    2024年02月05日
    瀏覽(32)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包