新增处理"OutOfMemoryError: CUDA out of memory"和"Resource averaged_perceptron_tagger not found"的方法

This commit is contained in:
dong 2023-04-20 10:21:10 +08:00 committed by imClumsyPanda
parent f147043253
commit 4b2a597e12
1 changed files with 13 additions and 3 deletions

View File

@ -28,10 +28,14 @@ A3: https://github.com/nltk/nltk_data/raw/gh-pages/packages/tokenizers/punkt.zip
Q4: 使用过程中 Python 包`nltk`发生了`Resource averaged_perceptron_tagger not found.`报错,该如何解决?
A4: 将 https://github.com/nltk/nltk_data/blob/gh-pages/packages/taggers/averaged_perceptron_tagger.zip 下载,解压放到 `nltk_data/taggers` 存储路径下。
`nltk_data` 存储路径可以通过 `nltk.data.path` 查询。
A4: 方法一:将 https://github.com/nltk/nltk_data/blob/gh-pages/packages/taggers/averaged_perceptron_tagger.zip 下载,解压放到 `nltk_data/taggers` 存储路径下。
`nltk_data` 存储路径可以通过 `nltk.data.path` 查询。
A4: 方法二:科学上网,用梯子,执行 python代码
```
import nltk
nltk.download()
```
---
Q5: 本项目可否在 colab 中运行?
@ -101,4 +105,10 @@ embedding_model_dict = {
"text2vec": "/Users/liuqian/Downloads/ChatGLM-6B/text2vec-large-chinese"
}
```
---
Q10: 执行`python cli_demo.py`过程中,显卡内存爆了,提示"OutOfMemoryError: CUDA out of memory"
A10: 将VECTOR_SEARCH_TOP_K和LLM_HISTORY_LEN的值设小一点比如VECTOR_SEARCH_TOP_K=5和LLM_HISTORY_LEN=2这样由query和context拼接得到的prompt会变短会减少内存的占用。
---