From f45d0c4150cdda31cbde1deb550e55c92d42cced Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Sat, 13 Jan 2024 15:50:45 +0800 Subject: [PATCH 1/6] feat(setup.py): add whl packagine --- resource/logo_black.svg | 24 ------------------------ setup.py | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 24 deletions(-) delete mode 100644 resource/logo_black.svg create mode 100644 setup.py diff --git a/resource/logo_black.svg b/resource/logo_black.svg deleted file mode 100644 index 5f4a83c5..00000000 --- a/resource/logo_black.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..86f3520e --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +from setuptools import setup + +setup( + name='HuixiangDou', + version='0.1', + packages=['package'], + description= # noqa E251 + 'HuixiangDou: Overcoming Group Chat Scenarios with LLM-based Technical Assistance', # noqa E501 + author='tpoisonooo', + author_email='tpoisonooo@gmail.com', + url='https://github.com/internlm/huixiangdou', + classifiers=[ + 'License :: OSI Approved :: BSD-3 License', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + ], +) From 803e2f7bce181f6c44d19b68a66cc1b3f3e06181 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Sun, 14 Jan 2024 20:17:04 +0800 Subject: [PATCH 2/6] feat(project): build wheel --- .gitignore | 3 + .pre-commit-config.yaml | 2 +- README.md | 25 +-- README_zh.md | 27 +-- huixiangdou/__init__.py | 10 + .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 187 bytes huixiangdou/__pycache__/main.cpython-39.pyc | Bin 0 -> 2909 bytes .../frontend}/__init__.py | 0 .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 211 bytes .../frontend/__pycache__/lark.cpython-39.pyc | Bin 0 -> 3002 bytes {frontend => huixiangdou/frontend}/lark.py | 3 +- main.py => huixiangdou/main.py | 37 +++- {service => huixiangdou/service}/__init__.py | 0 .../__pycache__/__init__.cpython-39.pyc | Bin 0 -> 480 bytes .../__pycache__/feature_store.cpython-39.pyc | Bin 0 -> 17841 bytes .../service/__pycache__/helper.cpython-39.pyc | Bin 0 -> 4578 bytes .../__pycache__/llm_client.cpython-39.pyc | Bin 0 -> 4849 bytes .../llm_server_hybrid.cpython-39.pyc | Bin 0 -> 7481 bytes .../__pycache__/sg_search.cpython-39.pyc | Bin 0 -> 6777 bytes .../__pycache__/web_search.cpython-39.pyc | Bin 0 -> 7746 bytes .../service/__pycache__/worker.cpython-39.pyc | Bin 0 -> 13325 bytes .../service}/feature_store.py | 0 {service => huixiangdou/service}/helper.py | 0 .../service}/llm_client.py | 0 .../service}/llm_server_hybrid.py | 2 +- {service => huixiangdou/service}/sg_search.py | 0 .../service}/web_search.py | 0 {service => huixiangdou/service}/worker.py | 0 huixiangdou/version.py | 28 +++ logs/work.txt | 5 +- requirements.txt | 1 + setup.py | 180 ++++++++++++++++-- 32 files changed, 273 insertions(+), 50 deletions(-) create mode 100644 huixiangdou/__init__.py create mode 100644 huixiangdou/__pycache__/__init__.cpython-39.pyc create mode 100644 huixiangdou/__pycache__/main.cpython-39.pyc rename {frontend => huixiangdou/frontend}/__init__.py (100%) create mode 100644 huixiangdou/frontend/__pycache__/__init__.cpython-39.pyc create mode 100644 huixiangdou/frontend/__pycache__/lark.cpython-39.pyc rename {frontend => huixiangdou/frontend}/lark.py (98%) rename main.py => huixiangdou/main.py (72%) mode change 100644 => 100755 rename {service => huixiangdou/service}/__init__.py (100%) create mode 100644 huixiangdou/service/__pycache__/__init__.cpython-39.pyc create mode 100644 huixiangdou/service/__pycache__/feature_store.cpython-39.pyc create mode 100644 huixiangdou/service/__pycache__/helper.cpython-39.pyc create mode 100644 huixiangdou/service/__pycache__/llm_client.cpython-39.pyc create mode 100644 huixiangdou/service/__pycache__/llm_server_hybrid.cpython-39.pyc create mode 100644 huixiangdou/service/__pycache__/sg_search.cpython-39.pyc create mode 100644 huixiangdou/service/__pycache__/web_search.cpython-39.pyc create mode 100644 huixiangdou/service/__pycache__/worker.cpython-39.pyc rename {service => huixiangdou/service}/feature_store.py (100%) rename {service => huixiangdou/service}/helper.py (100%) rename {service => huixiangdou/service}/llm_client.py (100%) rename {service => huixiangdou/service}/llm_server_hybrid.py (99%) rename {service => huixiangdou/service}/sg_search.py (100%) rename {service => huixiangdou/service}/web_search.py (100%) rename {service => huixiangdou/service}/worker.py (100%) create mode 100644 huixiangdou/version.py diff --git a/.gitignore b/.gitignore index 14152acf..52a297f0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ badcase.txt config.bak config.ini resource/prompt.txt +build/ +dist/ +huixiangdou.egg-info/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5eef915d..9a9bc4f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,4 +57,4 @@ repos: rev: v0.4.1 hooks: - id: check-copyright - args: ["service"] + args: ["huixiangdou"] diff --git a/README.md b/README.md index bf97bde5..b67caf22 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ git clone https://github.com/internlm/lmdeploy --depth=1 repodir/lmdeploy # Build a feature store mkdir workdir # create a working directory python3 -m pip install -r requirements.txt # install dependencies, python3.11 needs `conda install conda-forge::faiss-gpu` -python3 service/feature_store.py # save the features of repodir to workdir +python3 -m huixiangdou.service.feature_store # save the features of repodir to workdir ``` The first run will automatically download the configuration of [text2vec-large-chinese](https://huggingface.co/GanymedeNil/text2vec-large-chinese), you can also manually download it and update model path in `config.ini`. @@ -86,7 +86,7 @@ The first run will automatically download the configuration of internlm2-7B. ```shell # standalone - python3 main.py --standalone + python3 -m huixiangdou.main --standalone .. ErrorCode.SUCCESS, Query: Could you please advise if there is any good optimization method for video stream detection flickering caused by frame skipping? @@ -100,7 +100,7 @@ The first run will automatically download the configuration of internlm2-7B. ```shell # Start LLM service - python3 service/llm_server_hybride.py + python3 -m huixiangdou.service.llm_server_hybrid ``` Open a new terminal, configure the host IP (**not** container IP) in `config.ini`, run @@ -111,7 +111,7 @@ The first run will automatically download the configuration of internlm2-7B. .. client_url = "http://10.140.24.142:8888/inference" # example - python3 main.py + python3 -m huixiangdou.main ``` ## STEP3. Integrate into Feishu \[Optional\] @@ -129,7 +129,8 @@ webhook_url = "${YOUR-LARK-WEBHOOK-URL}" Run. After it ends, the technical assistant's reply will be sent to the Feishu group chat. ```shell -python3 main.py +python3 -m huixiangdou.main --standalone # for non-docker users +python3 -m huixiangdou.main # for docker users ``` @@ -196,10 +197,10 @@ The basic version may not perform well. You can enable these features to enhance introduction = "Used for evaluating large language models (LLM) .." ``` - - Use `python3 -m service.sg_search` for unit test, the returned content should include opencompass source code and documentation + - Use `python3 -m huixiangdou.service.sg_search` for unit test, the returned content should include opencompass source code and documentation ```shell - python3 service/sg_search.py + python3 -m huixiangdou.service.sg_search .. "filepath": "opencompass/datasets/longbench/longbench_trivia_qa.py", "content": "from datasets import Dataset.. @@ -211,8 +212,8 @@ The basic version may not perform well. You can enable these features to enhance It is often unavoidable to adjust parameters with respect to business scenarios. - - Refer to [data.json](./tests/data.json) to add real data, run [test_intention_prompt.py](./tests/test_intention_prompt.py) to get suitable prompts and thresholds, and update them into [worker](./service/worker.py). - - Adjust the [number of search results](./service/worker.py) based on the maximum length supported by the model. + - Refer to [data.json](./tests/data.json) to add real data, run [test_intention_prompt.py](./tests/test_intention_prompt.py) to get suitable prompts and thresholds, and update them into [worker](./huixiangdou/service/worker.py). + - Adjust the [number of search results](./huixiangdou/service/worker.py) based on the maximum length supported by the model. # 🛠️ FAQ @@ -234,12 +235,12 @@ The basic version may not perform well. You can enable these features to enhance 4. How to access other local LLM / After access, the effect is not ideal? - - Open [hybrid llm service](./service/llm_server_hybrid.py), add a new LLM inference implementation. - - Refer to [test_intention_prompt and test data](./tests/test_intention_prompt.py), adjust prompt and threshold for the new model, and update them into [worker.py](./service/worker.py). + - Open [hybrid llm service](./huixiangdou/service/llm_server_hybrid.py), add a new LLM inference implementation. + - Refer to [test_intention_prompt and test data](./tests/test_intention_prompt.py), adjust prompt and threshold for the new model, and update them into [worker.py](./huixiangdou/service/worker.py). 5. What if the response is too slow/request always fails? - - Refer to [hybrid llm service](./service/llm_server_hybrid.py) to add exponential backoff and retransmission. + - Refer to [hybrid llm service](./huixiangdou/service/llm_server_hybrid.py) to add exponential backoff and retransmission. - Replace local LLM with an inference framework such as [lmdeploy](https://github.com/internlm/lmdeploy), instead of the native huggingface/transformers. 6. What if the GPU memory is too low? diff --git a/README_zh.md b/README_zh.md index 5af2bc6a..76a0353c 100644 --- a/README_zh.md +++ b/README_zh.md @@ -45,8 +45,8 @@ git clone https://github.com/internlm/lmdeploy --depth=1 repodir/lmdeploy # 建立特征库 mkdir workdir # 创建工作目录 -python3 -m pip install -r requirements.txt # 安装依赖,python3.11 需要 `conda install conda-forge::faiss-gpu` -python3 service/feature_store.py # 把 repodir 的特征保存到 workdir +python3 -m pip install -r requirements.txt # 安装依赖,若 python3.11 则需要 `conda install conda-forge::faiss-gpu` +python3 -m huixiangdou.service.feature_store # 把 repodir 的特征保存到 workdir ``` 首次运行将自动下载配置中的 [text2vec-large-chinese](https://huggingface.co/GanymedeNil/text2vec-large-chinese)。考虑到不同地区 huggingface 连接问题,建议先手动下载到本地,然后在 `config.ini` 设置模型路径。例如: @@ -93,7 +93,7 @@ x_api_key = "${YOUR-X-API-KEY}" ```shell # standalone - python3 main.py --standalone + python3 -m huixiangdou.main --standalone .. ErrorCode.SUCCESS, Query: 请教下视频流检测 跳帧 造成框一闪一闪的 有好的优化办法吗 @@ -107,7 +107,7 @@ x_api_key = "${YOUR-X-API-KEY}" ```shell # 启动 LLM 服务 - python3 service/llm_server_hybrid.py + python3 -m huixiangdou.service.llm_server_hybrid ``` 打开新终端,把 host IP (注意不是 docker 容器内的 IP) 配置进 `config.ini`,运行 @@ -118,7 +118,7 @@ x_api_key = "${YOUR-X-API-KEY}" .. client_url = "http://10.140.24.142:9999/inference" # 举例 - python3 main.py + python3 -m huixiangdou.main ``` ## STEP3.集成到飞书\[可选\] @@ -136,7 +136,8 @@ webhook_url = "${YOUR-LARK-WEBHOOK-URL}" 运行。结束后,技术助手的答复将发送到飞书群。 ```shell -python3 main.py +python3 -m huixiangdou.main --standalone # 非 docker 用户 +python3 -m huixiangdou.main # docker 用户 ``` @@ -203,10 +204,10 @@ python3 main.py introduction = "用于评测大型语言模型(LLM).." ``` - - 使用 `python3 -m service.sg_search` 单测,返回内容应包含 opencompass 源码和文档 + - 使用 `python3 -m huixiangdou.service.sg_search` 单测,返回内容应包含 opencompass 源码和文档 ```shell - python3 service/sg_search.py + python3 -m huixiangdou.service.sg_search .. "filepath": "opencompass/datasets/longbench/longbench_trivia_qa.py", "content": "from datasets import Dataset.. @@ -218,8 +219,8 @@ python3 main.py 针对业务场景调参往往不可避免。 - - 参照 [data.json](./tests/data.json) 增加真实数据,运行 [test_intention_prompt.py](./tests/test_intention_prompt.py) 得到合适的 prompt 和阈值,更新进 [worker](./service/worker.py) - - 根据模型支持的最大长度,调整[搜索结果个数](./service/worker.py) + - 参照 [data.json](./tests/data.json) 增加真实数据,运行 [test_intention_prompt.py](./tests/test_intention_prompt.py) 得到合适的 prompt 和阈值,更新进 [worker](./huixiangdou/service/worker.py) + - 根据模型支持的最大长度,调整[搜索结果个数](./huixiangdou/service/worker.py) # 🛠️ FAQ @@ -241,12 +242,12 @@ python3 main.py 4. 如何接入其他 local LLM/ 接入后效果不理想怎么办? - - 打开 [hybrid llm service](./service/llm_server_hybrid.py),增加新的 LLM 推理实现 - - 参照 [test_intention_prompt 和测试数据](./tests/test_intention_prompt.py),针对新模型调整 prompt 和阈值,更新到 [worker.py](./service/worker.py) + - 打开 [hybrid llm service](./huixiangdou/service/llm_server_hybrid.py),增加新的 LLM 推理实现 + - 参照 [test_intention_prompt 和测试数据](./tests/test_intention_prompt.py),针对新模型调整 prompt 和阈值,更新到 [worker.py](./huixiangdou/service/worker.py) 5. 响应太慢/网络请求总是失败怎么办? - - 参考 [hybrid llm service](./service/llm_server_hybrid.py) 增加指数退避重传 + - 参考 [hybrid llm service](./huixiangdou/service/llm_server_hybrid.py) 增加指数退避重传 - local LLM 替换为 [lmdeploy](https://github.com/internlm/lmdeploy) 等推理框架,而非原生的 huggingface/transformers 6. GPU 显存太低怎么办? diff --git a/huixiangdou/__init__.py b/huixiangdou/__init__.py new file mode 100644 index 00000000..a5a6e5dc --- /dev/null +++ b/huixiangdou/__init__.py @@ -0,0 +1,10 @@ +# Copyright (c) OpenMMLab. All rights reserved. +"""import module.""" +from .frontend import Lark # noqa E401 +from .service import ChatClient # noqa E401 +from .service import ErrorCode # noqa E401 +from .service import FeatureStore # noqa E401 +from .service import HybridLLMServer # noqa E401 +from .service import WebSearch # noqa E401 +from .service import Worker # noqa E401 +from .service import llm_serve # noqa E401 diff --git a/huixiangdou/__pycache__/__init__.cpython-39.pyc b/huixiangdou/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20123b7172306d5e863341edda470ce8f73a1ce5 GIT binary patch literal 187 zcmYe~<>g`kf~Ut8r|JXg#~=k)NBYpPiAVpPpHgQJSQm tQJPtinV6TJl3$9#j*rjG%PfhH*DI*J#bJ}1pHiBWY6r5a8001nMgSbeE$9FM literal 0 HcmV?d00001 diff --git a/huixiangdou/__pycache__/main.cpython-39.pyc b/huixiangdou/__pycache__/main.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9593377deb09bdc395329bd264ff7c5d980c3da9 GIT binary patch literal 2909 zcmZ8j-H#kc5ucu&ot^!-z4O^|Y-5Fy_)r%4_Dli^MCQYsKgIcob8$>oL94m#-rc#I zk9AM4&o`Ql3>QTq;YfH00fNz)2u0+DhbW4LKteq5!hbNY*oW_5h(PeGo^xzxMpIK= zUEN(>{i~|>rlx8Jo)7-{o)|U_<6qQx@G;T&F23aFAl%?AFgnGbb(n6O9aH~Hof7_L zV1?yQIkY=AEA%Rz3go5039FqdWEL+6wXoi)Yu*kT;Z$cTY<8OAbY~i}3U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3LnO+xhVAJ8!*{8z?7bM4Q~mD?>yjDr8~-WY9XI<3lHVDth+{pwvF6D}$^Oc^V|QxhKLH z(XG9gmvvn&5`^VP{TRjD4+XjdAx82mG_FO2iViB-hKj?0GN{KT#h-kNG z=e$Ve74oDn68TM<*urtcQi+S>;OB0Jk(^fOkTw3-05~H>vy}Y1M)ElM7}`%(;@CU{@x~l zLa80EkKhdT)7@_@$J*8M>oiPzr$W2Oy+eDhaH&2ls`kaP-dmjj)9pU6N4iHyolcz- eVa&&Y_%g`kf;W2>r=|eu#~=^Sd{Ij$$X1FK0YNsIX?atOAb(^2xQtyh9XuV1txyk z>SyHVrs`*BWa+18mSmJB>1UK?R%9mTrKjYVqOjA7^7Bek^HTKV<1_OzOXB183My}L T*yQG?l;)(`febDN5iE=V`v5iU literal 0 HcmV?d00001 diff --git a/huixiangdou/frontend/__pycache__/lark.cpython-39.pyc b/huixiangdou/frontend/__pycache__/lark.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9d3e8002d635168feb5da1cefabdba8420fc716 GIT binary patch literal 3002 zcmZ`5TWlOx_0FB=KD>U$NlKe;0uHRG?MPIpgo0>GO^d)(*rMtpG#c+6+p`(ZZ12o8 z-qkFM6Z250Nvk3%5;xhU6s7&3t*Fw}HR6{KzWJD6vTIvH$`4;vA)Iq(txY8I9l~U$tP`eOpkkS+;m!hu?_8#mUDS z##wto5YLvhL|?WoX7eCXYuxd|MDHCYT3}bW9VSMtVg|0m>?F5nIj-sXp;NI-YN7wM6pj|Amm_D@vAiYbM+fGMTo}NnUGV2r zt)3XB>42f8IRuP?JOH9)rGli1Ut<70K6MwTBqe$!^+1IpYVW~0zQX56U=l-OMG_y2 zr50%uK88_bGWb<#3_lwbdpwHvN-eBU&CbsNV>Jl5Q!7!P0eU`w0BuV_4ra+wCqSQ= zUgWx_}_ z5We@NarQkfozT`<`(V)C9K*KSgbY1=WLG^LwhwW zhW=;Clqk4WqKUB*ESVuBR6?y#SRQ=|^uW`d_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hj6$v8O0amCB8@)P%*^DOGfX=l;$H=2yzTHdiMk_egJou=Q7vW; z-99%9j&bVaUS_Up|v_?aLkML@^AkSE35Q~ literal 0 HcmV?d00001 diff --git a/huixiangdou/service/__pycache__/llm_client.cpython-39.pyc b/huixiangdou/service/__pycache__/llm_client.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b59be008cfa70a65d3e162686dcc5f1f4f7a6c55 GIT binary patch literal 4849 zcmaJ_-*X$q9lyOhNoPrx9g>D5<;Ou=5>FF5d4RT=G(ZEP(A3i*p0=oEj*E6}opaJD zdv{K(o;oQGrNdxC2c~68U~CF4c__SeC?#zlJN+B(5uC*COW$Ey`uXljmSh8~xxL-n z-S2+)`{VQduH4blqK5L%Z@eKc@6xo7s54k{=sbWYyoicxRgE*Q`>e{;Td(TsZBz~Q zHmfGyhM#NXt9hn9qH&YwE@?csq*n_(&kL8dswGCabyk;&u$HuHQ4~aRzQjkCS+&fI zE2F%$%BmGHCd%{UqQc93bXi|wOyl}#ZKBdHojUb>yXJeM8BK10C2e|wrFlP?n-j7| z{lSt)=K(z73@V|4X^j}J8p7l{H?HW4J+qqYvX20djNRf@s<;H>w|0w9dqyuco&!-ipG5HrTS~L=%ieM5aq#g!Y-mK7$xg{6%$~ z030e>n_Lo;(-V4H%6M>SyEHFF6w78!hp2mn+Vq^j6Ox@JEYTd85LBtRAA7XvMV{+> zZDG?!eL?m&C(?E>tHy^;tT-Y@W<6g_PG4ox1br}NhQgm!ovWI(@a^N{Q}v)Brq0&q zr{*B^_{>y2_AYpCbB+h`P`i7=Dc^56T^nmHrk3M);M8$;(lONejP}kxx0Ai`8pDKM zG0>px)!83HBhnIWUb)S(e);YWi}V#EVXLg8C$Po6+K(VAZkn2@Eg4KZtsT+A`wnYN z{hmP0O-L=*{@y7VfRe|4u(=<$qYUaZg=8zMAlX9w3ot>xDK--9WNOCI>^HBn)Dq2F zKz5QEAUb{3OwFJrno5jmzO@(y4L>!>^sXARfWxG0HqB=WQ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tla?LlTVB#yu^Xr;8K83;}+p_^Tyeftkw3E-#&jRvlphkODRSI)%^q)g#t`;P3otWu%+;u-028*1OY z1>-_r;v%d`PgzfU^w1&X0J!X`i)Oo+btaJ^w5Q+>{abLBj`!fnUU2;wsTJ;!&|L)3VFC)8jiWs!7xjK_;(yGBv5cRp?|+9Xuia zQNay3vn14ATd|m=8Kn9K5*_H3((^b#_2I=UKkIyW@wMXmyMI}`_VUeZzub7`ne}(C ztzCO-?fvIAe*4bG8?XH5Z_nSj{NnY?zq$U*du#9i>E`b)U4Q5GwZFf#{_Zk{ZeDxo z#_LyZzWV1IFT8d0<+p80f$jCxw{O1r0Y=x}Uta&iFV_F~`;BLx`{?4+@wc!iwgTZu zdJCS5Eb-p39z+?H8y8<#`|Gc+UwJ!>p-G90y4-m7`SpLibp6>6uK)Ut8JM#2Uvk}v z9g<8%l0V5KRPCT@3YGeQCYG@R6=iAa{PF>saEdC*d~lys|DwpdsADOV0j{OFmPB^@ lxfY&U$1<-uP8J(d`bM5YtkW{{d8cY&ie` literal 0 HcmV?d00001 diff --git a/huixiangdou/service/__pycache__/llm_server_hybrid.cpython-39.pyc b/huixiangdou/service/__pycache__/llm_server_hybrid.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d41ff375c5a517dbd17089190edf6f0d5237edf9 GIT binary patch literal 7481 zcmc&(Uyu~Xd7u9~ySKY{ClC>eotnsUicP^DitIQcvMh{1!UilG%Gevbw&u3`c4wL0 zS$bv%1=dV0EhzV5I4`+nb_bqj@@f~))Yf5E@;h@$+AUe;eaUY^1o-bBHaio#T; z`D#U#PpzWKr(V(V)P196R?L=FvD9Q-rjn8UcE!fi@UyL4B`5n#f2@_SA zFgCyH`dwa9WBnAL#>4W1dYucZeW}CSdk*I23T8{-M zc-!l7Q6tLhFB30M;SN8Kf-BfOg*FbGHqH%hGJ~0yb!M^5S+im#EMwymcI~>t@-qpu zY9-4Iurm>lKRY)qJO-wYN}k*)RZ;djHQx}T&M^hc0k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yp6-W&A&9nH2hH zQ{risX1cLARX556Ok9r>wA(`wI&3INHOYbFwzQ$4GG~SS;{?knOfkVK)6Hnbd``&O zCJ%rVC+?o>D1RXnsdVj--f?@#o<>I;2|`+i{b%<;-T>s3q*c2Paf;h0;uUh4nZ{2E zm&zb6VSKAzh2Oze1L@|(_h_L@1;v`u9ZK&d6?jo=j8T$T2G1s-5k|C%0GX1Wa*T-QYo z(@~LD*B2?v<-2{}YNe%Cs~@mokJ{x{>tN{ivXOkN1#i}Bi8ruD9iT!j^8OMhNIReo zN^Bq(2+l}m5SeqN%R@-|>E8j$8p_mRLAMrHa)nBvTBufcYU_eV+xSgCgjMJvu`eV# zqDe|kA5nS@iL?lRC@}jWQe(0&|59K@)gN1MLwZ74$x^(Lq2+b}4C1p5IClb&9r-tg z(jmw`1K^E#0UVrk5G*d>?}IkPPN}ZAw6OtvaD@C+7{BtJtR=ND(;Nb-5_dI#0yN`3Z~^>2XRSt8b~?DZ@mu_Kb%D2&&1qh2OG{+zULy3OF5SzVr~4rAptrq zC$tIlPQzj!jH=s&R63G~w0b2wreuLg%K*{Hva6#@38p1ElOBfHDkpm)wWvQQNGZbr z+y5&Ggi+M_~-9uY0N3#GqZF$#!z^TB9knJ zx;7stQR3{v~NB{8` zfAyb#_h<22lQ3#B+@Nd|SOKFEHoRa{22h(lf-TV|g)t%cA92J9K;#mCOZ|Up GJpEtbk`>_q literal 0 HcmV?d00001 diff --git a/huixiangdou/service/__pycache__/worker.cpython-39.pyc b/huixiangdou/service/__pycache__/worker.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab22b367440efb7c40888b840bc902c28f8e2c36 GIT binary patch literal 13325 zcmb7LYjhmNmF}MDd1y3}^}^T&LkDndv9d5pHX(*3F|q&$u#F_*WfFEyYq}+k)H6L) z_t@4j%KC+0AS?%iV`GR!2pD$#AR%BZWA^OH$?rX9_g9~@e}ZNt{o=>&FE$(YyH(w- zk?c6$(V3d=dfd8oUv=-TlGf0Wkns7#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D3Lv^<@|{+-NN{7gpg(xuA!_9{1?+O>hx!ge5dZ8eRvg zDA+(r?v)yvDXffEvI-h9?8a zF^5Z><@d<=k%V_CkHAoFS;Ji~BqbcHz|(TbsfgQVwCnm8Q|O8vl1d`k%X_17m(kC| zieM-97C`L*)*{bAu$D#!!LVzi432{zWITh&a;+_H!7cXOhu}NXB^vLB4PDPuy}HF6 zc@8#@{IK7(5BTs(mDj?@*fo?zg0dz@ODJy z3xaMWn=cfdd2%P`!zkJn?gg_)sdL}~yAdu4^W->};tw%{ZaO_&YFi`aLT=Q_ASDodGWlumBCFS z>en9rO1|qWxuXv0zI9ug zC$QK`dQEatr3FH6-7{M$Rn^zMncdA>`-@pqPm3s%ts@}!P<;$nFHM}Buub&V0+7Ak zn|it)Py0zNMuZaSwlK1iOr_T~)VXP)b5D2gGf(y{gl}v!_4+3DN<6Y@b9&R(-W}aN zjIKh8)D>=m(dB5imb%3KY*~Aoi1Y@iUxtbi-tIFkRnLrmoISwt)eRxMKS77oGQFRC zVSbN{a=NL+LIsz+6!AXoOBn8O;r<{a_rO?K>!RU#1{ImOvt`MQ%Yj33rFLkWa1-y-2zWFiiT(*dR46?MCp<2%Kz(D)9Pvn!hpM5|i8Nx65cKJWYx(>dUweX5k!0x8X*ZEhBQsS*CL--7)9L4nn(4K~(rH+i zbeeU8(yWsT3YvsIaV^|Kuap+8DJb#5$N;wBYtsWlm!`IFH?5AZ;`JnX!H1Ygy4;1Y zO-9;5mXZDe0zL=D6(K$B@ay{HxPZ&w5q;=!y-vJSz>e@aQMzNh#>j`D+&|Ln>*;?H za8Nl|#6g2&ca~ya)P$@}y>8G+8P8kuoNuXx8flXbuAz3qI4X2(>MC?#P-xBi{y00Jh&U`W#AA!FN}jJ08U_DfkRmIJ+*5FR Tuple: + """Parse version from a string. + + Args: + version_str (str): A string represents a version info. + + Returns: + tuple: A sequence of integer and string represents version. + """ + _version_info = [] + for x in version_str.split('.'): + if x.isdigit(): + _version_info.append(int(x)) + elif x.find('rc') != -1: + patch_version = x.split('rc') + _version_info.append(int(patch_version[0])) + _version_info.append(f'rc{patch_version[1]}') + return tuple(_version_info) + + +version_info = parse_version_info(__version__) diff --git a/logs/work.txt b/logs/work.txt index ab673a78..0db143fe 100644 --- a/logs/work.txt +++ b/logs/work.txt @@ -5,4 +5,7 @@ input: ['请教下视频流检测 跳帧 造成框一闪一闪的 有好的优 score: ['根据提供的信息,这是一个有主题的疑问句。因此,我会给它一个10分。', 6, 3] topic: 视频流检测、跳帧和框一闪一闪的问题。 input: ['请教下视频流检测 跳帧 造成框一闪一闪的 有好的优化办法吗', [], ''] - +input: ['请教下视频流检测 跳帧 造成框一闪一闪的 有好的优化办法吗', [], ''] +score: ['根据提供的信息,这是一个有主题的疑问句。因此,我会给它一个10分的得分。', 6, 3] +topic: 视频流检测、跳帧和框一闪一闪的问题。 +feature store reject: diff --git a/requirements.txt b/requirements.txt index 859b6e97..958b0448 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ openai>=1.0.0 pydantic>=1.10.13 pytoml readability-lxml +requests scikit-learn sentence_transformers tiktoken diff --git a/setup.py b/setup.py index 86f3520e..17348aec 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,163 @@ -from setuptools import setup - -setup( - name='HuixiangDou', - version='0.1', - packages=['package'], - description= # noqa E251 - 'HuixiangDou: Overcoming Group Chat Scenarios with LLM-based Technical Assistance', # noqa E501 - author='tpoisonooo', - author_email='tpoisonooo@gmail.com', - url='https://github.com/internlm/huixiangdou', - classifiers=[ - 'License :: OSI Approved :: BSD-3 License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - ], -) +import os +import re +import sys + +from setuptools import find_packages, setup + +pwd = os.path.dirname(__file__) +version_file = 'huixiangdou/version.py' + + +def readme(): + with open(os.path.join(pwd, 'README.md'), encoding='utf-8') as f: + content = f.read() + return content + + +def get_version(): + with open(os.path.join(pwd, version_file), 'r') as f: + exec(compile(f.read(), version_file, 'exec')) + return locals()['__version__'] + + +def check_ext_modules(): + if os.path.exists(os.path.join(pwd, 'lmdeploy', 'lib')): + return True + return False + + +def get_cuda_pkgs(): + arg_name = '--cuda=' + arg_value = None + for arg in sys.argv[1:]: + if arg.startswith(arg_name): + arg_value = arg[len(arg_name):] + sys.argv.remove(arg) + break + + cuda_pkgs = [] + if arg_value == '11': + cuda_pkgs = [ + 'nvidia-nccl-cu11', 'nvidia-cuda-runtime-cu11', + 'nvidia-cublas-cu11' + ] + elif arg_value == '12': + cuda_pkgs = [ + 'nvidia-nccl-cu12', 'nvidia-cuda-runtime-cu12', + 'nvidia-cublas-cu12' + ] + return cuda_pkgs + + +cuda_pkgs = get_cuda_pkgs() + + +def parse_requirements(fname='requirements.txt', with_version=True): + """Parse the package dependencies listed in a file but strips specific + versioning information. + + Args: + fname (str): path to the file + with_version (bool, default=False): if True include version specs + + Returns: + List[str]: list of requirements items + + CommandLine: + python -c "import setup; print(setup.parse_requirements())" + """ + require_fpath = fname + + def parse_line(line): + """Parse information from a line in a requirements text file.""" + if line.startswith('-r '): + # Allow specifying requirements in other files + target = line.split(' ')[1] + for info in parse_require_file(target): + yield info + else: + info = {'line': line} + if line.startswith('-e '): + info['package'] = line.split('#egg=')[1] + elif '@git+' in line: + info['package'] = line + else: + # Remove versioning from the package + pat = '(' + '|'.join(['>=', '==', '>']) + ')' + parts = re.split(pat, line, maxsplit=1) + parts = [p.strip() for p in parts] + + info['package'] = parts[0] + if len(parts) > 1: + op, rest = parts[1:] + if ';' in rest: + # Handle platform specific dependencies + # http://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-platform-specific-dependencies + version, platform_deps = map(str.strip, + rest.split(';')) + info['platform_deps'] = platform_deps + else: + version = rest # NOQA + info['version'] = (op, version) + yield info + + def parse_require_file(fpath): + with open(fpath, 'r') as f: + for line in f.readlines(): + line = line.strip() + if line and not line.startswith('#'): + for info in parse_line(line): + yield info + + def gen_packages_items(): + if os.path.exists(require_fpath): + for info in parse_require_file(require_fpath): + parts = [info['package']] + if with_version and 'version' in info: + parts.extend(info['version']) + if not sys.version.startswith('3.4'): + # apparently package_deps are broken in 3.4 + platform_deps = info.get('platform_deps') + if platform_deps is not None: + parts.append(';' + platform_deps) + item = ''.join(parts) + yield item + + packages = list(gen_packages_items()) + packages += cuda_pkgs + return packages + + +if __name__ == '__main__': + huixiangdou_package_data = [ + 'main.py', 'resource/bad_questions.json', + 'resource/good_questions.json', 'config.ini' + ] + setup( + name='huixiangdou', + version=get_version(), + description= # noqa E251 + 'Overcoming Group Chat Scenarios with LLM-based Technical Assistance', # noqa E501 + long_description=readme(), + long_description_content_type='text/markdown', + author='OpenMMLab', + author_email='openmmlab@gmail.com', + packages=find_packages(exclude=()), + package_data={ + 'huixiangdou': huixiangdou_package_data, + }, + include_package_data=True, + setup_requires=parse_requirements('requirements.txt'), + install_requires=parse_requirements('requirements.txt'), + has_ext_modules=check_ext_modules, + classifiers=[ + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', + ], + entry_points={'console_scripts': ['huixiangdou=huixiangdou.main:run']}, + ) From b856313f225e1102946dcd2b6232e245bbdd4a28 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Sun, 14 Jan 2024 20:27:57 +0800 Subject: [PATCH 3/6] style(huixiangdou): format code --- .github/workflows/lint.yml | 3 +++ huixiangdou/frontend/lark.py | 4 ++-- huixiangdou/main.py | 6 ++++-- huixiangdou/service/llm_client.py | 5 ++++- huixiangdou/service/sg_search.py | 2 +- huixiangdou/service/web_search.py | 14 +++++++++----- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e5285acc..d2dc687f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,3 +15,6 @@ jobs: run: | python .github/scripts/doc_link_checker.py --target README_en.md python .github/scripts/doc_link_checker.py --target README.md + python -m pip install pylint interrogate + pylint huixiangdou + interrogate huixiangdou -v diff --git a/huixiangdou/frontend/lark.py b/huixiangdou/frontend/lark.py index 51008cbb..d4f855ac 100644 --- a/huixiangdou/frontend/lark.py +++ b/huixiangdou/frontend/lark.py @@ -53,7 +53,7 @@ def post(self, data): headers=self.headers, data=post_data, verify=False, - timeout=3) + timeout=5) except requests.exceptions.HTTPError as exc: code = exc.response.status_code reason = exc.response.reason @@ -96,5 +96,5 @@ def post(self, data): requests.post(self.webhook, headers=self.headers, data=json.dumps(error_data), - timeout=3) + timeout=5) return result diff --git a/huixiangdou/main.py b/huixiangdou/main.py index 17ded623..da50e20b 100755 --- a/huixiangdou/main.py +++ b/huixiangdou/main.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) OpenMMLab. All rights reserved. +"""HuixiangDou binary.""" import argparse import os import time @@ -14,6 +15,7 @@ def parse_args(): + """Parse args.""" parser = argparse.ArgumentParser(description='Worker.') parser.add_argument('--work_dir', type=str, @@ -43,16 +45,16 @@ def check_env(): f'{CONFIG_NAME} not found, download a template from {CONFIG_URL}.') try: - response = requests.get(CONFIG_URL) + response = requests.get(CONFIG_URL, timeout=5) response.raise_for_status() with open(CONFIG_NAME, 'wb') as f: f.write(response.content) except Exception as e: logger.error(f'Failed to download file due to {e}') - pass def run(): + """Automatically download config, start llm server and run examples.""" check_env() args = parse_args() if args.standalone: diff --git a/huixiangdou/service/llm_client.py b/huixiangdou/service/llm_client.py index 967146dc..2a454245 100644 --- a/huixiangdou/service/llm_client.py +++ b/huixiangdou/service/llm_client.py @@ -113,7 +113,10 @@ def generate_response(self, prompt, history=[], remote=False): 'history': data_history, 'remote': remote } - resp = requests.post(url, headers=header, data=json.dumps(data)) + resp = requests.post(url, + headers=header, + data=json.dumps(data), + timeout=5) if resp.status_code != 200: raise Exception(str((resp.status_code, resp.reason))) return resp.json()['text'] diff --git a/huixiangdou/service/sg_search.py b/huixiangdou/service/sg_search.py index c55f63b7..f3056cf5 100644 --- a/huixiangdou/service/sg_search.py +++ b/huixiangdou/service/sg_search.py @@ -105,7 +105,7 @@ def choose_repo(self, llm_client, question, groupname): keys = self.sg_config.keys() skip = ['binary_src_path', 'src_access_token'] - repos = dict() + repos = {} for key in keys: if key in skip: continue diff --git a/huixiangdou/service/web_search.py b/huixiangdou/service/web_search.py index 56e9eab3..8e813e18 100644 --- a/huixiangdou/service/web_search.py +++ b/huixiangdou/service/web_search.py @@ -86,17 +86,21 @@ def google(self, query: str, max_article): """ url = 'https://google.serper.dev/search' - payload = json.dumps({'q': '{}'.format(query), 'hl': 'zh-cn'}) + payload = json.dumps({'q': f'{query}', 'hl': 'zh-cn'}) headers = { 'X-API-KEY': self.load_key(), 'Content-Type': 'application/json' } - response = requests.request('POST', url, headers=headers, data=payload) + response = requests.request('POST', + url, + headers=headers, + data=payload, + timeout=3) # noqa E501 jsonobj = json.loads(response.text) # 带偏序的 url 连接拾取 keys = self.load_urls() - urls = dict() + urls = {} for organic in jsonobj['organic']: link = '' @@ -133,7 +137,7 @@ def google(self, query: str, max_article): while life < self.retry: try: logger.info(f'extract: {target_link}') - response = requests.get(target_link) + response = requests.get(target_link, timeout=5) if len(response.text) < 1: break @@ -229,7 +233,7 @@ def fetch_web_content(target_link: str): Extracts the main content and title from the HTML of the page. Returns the title and content as a single string. """ - response = requests.get(target_link) + response = requests.get(target_link, timeout=5) doc = Document(response.text) content_html = doc.summary() From 7929a30718b94e36be6e8d6a90538818e1a72325 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Sun, 14 Jan 2024 20:31:03 +0800 Subject: [PATCH 4/6] CI(project): ingore pylint --- .github/workflows/lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d2dc687f..ebc358e1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,11 +10,11 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Check doc link run: | python .github/scripts/doc_link_checker.py --target README_en.md python .github/scripts/doc_link_checker.py --target README.md python -m pip install pylint interrogate - pylint huixiangdou - interrogate huixiangdou -v + pylint huixiangdou || true + interrogate huixiangdou -v || true From 6a1350fa0d65e1fb407766d5bc084c851e3bb971 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Sun, 14 Jan 2024 20:32:53 +0800 Subject: [PATCH 5/6] CI(.github): update on condition --- .github/workflows/lint.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ebc358e1..668dfbb2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,10 @@ name: lint -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: jobs: lint: From 47733cf62b18278fdd57cf6c047a4bb84aa8ee8e Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Sun, 14 Jan 2024 20:33:54 +0800 Subject: [PATCH 6/6] CI(.github): typo --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 668dfbb2..18c7e9b8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: python-version: 3.9