【深度学习】基于 LLM 构建中文场景检索式对话:Llama2+NeMo

Posted by ShawnD on November 12, 2023

安装 NeMo (mac)

Note: 需要 python 3.10 以上,否则部分代码会报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# [optional] install mecab using Homebrew, to use sacrebleu for NLP collection
# you can install Homebrew here: https://brew.sh
brew install mecab

# [optional] install pynini using Conda, to use text normalization
conda install -c conda-forge pynini

# install Cython manually
pip install cython

# clone the repo and install in development mode
git clone https://github.com/NVIDIA/NeMo
cd NeMo
./reinstall.sh
1
 pip install opencc-python-reimplemented==0.1.4

安装 Llama index

1
pip install llama-index
1
pip install accelerate
1
pip install -i https://test.pypi.org/simple/ bitsandbytes
1
pip install pypdf

Reference

  1. https://github.com/NVIDIA/NeMo
  2. OSError: dlopen(libopencc.so.1, 6): image not found
  3. ImportError: Using low_cpu_mem_usage=True or a device_map requires Accelerate: pip install accelerate
  4. 使用HuggingFace的Accelerate库加载和运行超大模型