File tree 4 files changed +26
-4
lines changed
4 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 7
7
def bing_search (text , result_len = 3 ):
8
8
if not (BING_SEARCH_URL and BING_SUBSCRIPTION_KEY ):
9
9
return [{"snippet" : "please set BING_SUBSCRIPTION_KEY and BING_SEARCH_URL in os ENV" ,
10
- "title" : "env inof not fould " ,
10
+ "title" : "env info is not found " ,
11
11
"link" : "https://python.langchain.com/en/latest/modules/agents/tools/examples/bing_search.html" }]
12
12
search = BingSearchAPIWrapper (bing_subscription_key = BING_SUBSCRIPTION_KEY ,
13
13
bing_search_url = BING_SEARCH_URL )
Original file line number Diff line number Diff line change 163
163
OPEN_CROSS_DOMAIN = False
164
164
165
165
# Bing 搜索必备变量
166
- # 使用 Bing 搜索需要使用 Bing Subscription Key
167
- # 具体申请方式请见 https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/quickstarts/rest/python
166
+ # 使用 Bing 搜索需要使用 Bing Subscription Key,需要在azure port中申请试用bing search
167
+ # 具体申请方式请见
168
+ # https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/create-bing-search-service-resource
169
+ # 使用python创建bing api 搜索实例详见:
170
+ # https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/quickstarts/rest/python
168
171
BING_SEARCH_URL = "https://api.bing.microsoft.com/v7.0/search"
172
+ # 注意不是bing Webmaster Tools的api key,
173
+
174
+ # 此外,如果是在服务器上,报Failed to establish a new connection: [Errno 110] Connection timed out
175
+ # 是因为服务器加了防火墙,需要联系管理员加白名单,如果公司的服务器的话,就别想了GG
169
176
BING_SUBSCRIPTION_KEY = ""
Original file line number Diff line number Diff line change @@ -146,7 +146,6 @@ $ pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/
146
146
$ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
147
147
```
148
148
149
-
150
149
Q12 启动api.py时upload_file接口抛出 ` partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import) `
151
150
152
151
这是由于 charset_normalizer模块版本过高导致的,需要降低低charset_normalizer的版本,测试在charset_normalizer==2.1.0上可用。
@@ -174,3 +173,7 @@ download_with_progressbar(url, tmp_path)
174
173
然后按照给定网址,如"https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar"手动下载文件,上传到对应的文件夹中,如“.paddleocr/whl/rec/ch/ch_PP-OCRv3_rec_infer/ch_PP-OCRv3_rec_infer.tar” .
175
174
176
175
---
176
+
177
+ Q14 调用api中的 ` bing_search_chat ` 接口时,报出 ` Failed to establish a new connection: [Errno 110] Connection timed out `
178
+
179
+ 这是因为服务器加了防火墙,需要联系管理员加白名单,如果公司的服务器的话,就别想了GG--!
Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ class LoaderCheckPoint:
30
30
ptuning_dir : str = None
31
31
use_ptuning_v2 : bool = False
32
32
# 如果开启了8bit量化加载,项目无法启动,参考此位置,选择合适的cuda版本,https://github.com/TimDettmers/bitsandbytes/issues/156
33
+ # 另一个原因可能是由于bitsandbytes安装时选择了系统环境变量里不匹配的cuda版本,
34
+ # 例如PATH下存在cuda10.2和cuda11.2,bitsandbytes安装时选择了10.2,而torch等安装依赖的版本是11.2
35
+ # 因此主要的解决思路是清理环境变量里PATH下的不匹配的cuda版本,一劳永逸的方法是:
36
+ # 0. 在终端执行`pip uninstall bitsandbytes`
37
+ # 1. 删除.bashrc文件下关于PATH的条目
38
+ # 2. 在终端执行 `echo $PATH >> .bashrc`
39
+ # 3. 删除.bashrc文件下PATH中关于不匹配的cuda版本路径
40
+ # 4. 在终端执行`source .bashrc`
41
+ # 5. 再执行`pip install bitsandbytes`
42
+
33
43
load_in_8bit : bool = False
34
44
is_llamacpp : bool = False
35
45
bf16 : bool = False
@@ -99,6 +109,8 @@ def _load_model(self, model_name):
99
109
LoaderClass = AutoModelForCausalLM
100
110
101
111
# Load the model in simple 16-bit mode by default
112
+ # 如果加载没问题,但在推理时报错RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`
113
+ # 那还是因为显存不够,此时只能考虑--load-in-8bit,或者配置默认模型为`chatglm-6b-int8`
102
114
if not any ([self .llm_device .lower () == "cpu" ,
103
115
self .load_in_8bit , self .is_llamacpp ]):
104
116
You can’t perform that action at this time.
0 commit comments