Deploy langchain+chatglm

First reference: Window zero-based deployment of langchain-ChatGLM_Flying Shit Beetle’s Blog-CSDN Blog

Install part of 

1. GCC installation
gcc 64-bit download
Be sure to install 64-bit gcc, because my computer is w10 64-bit. If you install 32-bit and run langchain to report an error and configure environment variables, you
can directly use the file in the compressed package: x86_64-8.1.0- release-posix-seh-rt_v6-rev0.7z
software download address: https://sourceforge.net/projects/mingw-w64/files/

After installation, unzip it and configure the bin directory to the path directory.

image.png
gcc64 installation verification
gcc -v

2.Visual Studio 2019 installation
You can directly use the compressed package file: vs_community__studio2019.exe
Official download address: https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/
2019 version download Link, the community version is enough: https://my.visualstudio.com/Downloads?q=visual%20studio%202019&wt.mc_id=omsftvscom~older-downloads

 Note that you need to select the C++ development module , and the rest will be defaulted. You can install the others according to your own needs. The installation path can be defaulted, or you can change it according to your own situation, and then click Install. Everything will be installed automatically later, because you need The process of downloading things online is a bit long, please wait patiently~~

3. Anaconda installation
can directly use the file in the compressed package: Anaconda3-2023.03-0-Windows-x86_64.exe

Download and install
Download address: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

When installing, select all users and just go to the next step.

4. CUDA installation.
To install CUDA11.7
, please refer to https://blog.csdn.net/chen565884393/article/details/127905428

Download the installation package.
You can directly use the compressed package file: cuda_11.7.1_516.94_windows.exe

Download CUDA and choose according to your own configuration, win10 or win11 installation package.
Download address: https://developer.nvidia.com/cuda-11-7-1-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local

Check command: nvcc -V

6. Install CUDNN
and download CUDNN.
You can directly use the compressed package file: cudnn-windows-x86_64-8.5.0.96_cuda11-archive.zip
to download the installation package. You can download it from the NVIDIA official website at: https://developer.nvidia .com/rdp/cudnn-archive

Just copy the files in the three folders in CUDNN to the (bin, include, lib) folders corresponding to the CUDA installation directory. CUDA's lib directory has three folders: x64, Win32, and cmake. Copy them to the x64 folder.

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\x64

 torch_stable
download address: https://download.pytorch.org/whl/torch_stable.html
Download torch==2.0.1+cu117, you can observe that there are many versions of cu117/torch-2.0.1, cp38 corresponds to python3.8, win_amd64 corresponds to the 64-bit operating system of Windows. You can download it according to your actual situation. (+cu117 indicates CUDA10.1, +cpu indicates the CPU version)
 

chatglm_langchain_demo

#Setup envirnment

conda create -n langchain python=3.10 -channel  http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda activate langchain

# Pull the warehouse

git clone https://github.com/imClumsyPanda/langchain-ChatGLM.git

# Install dependencies

cd langchain-ChatGLM

python3 -m pip install -r requirements.txt

python3 -m pip install gradio==3.28.3

python3 -m pip install tabulate

#Download models

git lfs install #I didn’t write this sentence

git clone https://huggingface.co/THUDM/chatglm-6b-int4

git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese

python3 webui.py

success

[langchain_chatglm asks about the evaluation of intermediate professional titles] https://www.bilibili.com/video/BV1GW4y1Z7wu/?share_source=copy_web&vd_source=159f872f790f3f11c2991f350622f681

Guess you like

Origin blog.csdn.net/WASEFADG/article/details/131712662