https://github.com/ssbuild/nn-serving
轻量级多进程服务
https://github.com/ssbuild/nn-serving
Last synced: about 1 year ago
JSON representation
轻量级多进程服务
- Host: GitHub
- URL: https://github.com/ssbuild/nn-serving
- Owner: ssbuild
- Created: 2021-08-19T01:54:27.000Z (almost 5 years ago)
- Default Branch: dev
- Last Pushed: 2023-06-09T02:54:26.000Z (about 3 years ago)
- Last Synced: 2025-04-18T12:17:51.717Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# 简介
nn-serving 是一个神经网络推理服务,推理冻结的模型并提供restful接口.
# 推荐环境
linux python >=3.8
因对进程的管理和共享内存机制,暂时不支持windows
# 安装模块
pip install -r nn-serving/requirements.txt
## 提供三个worker demo
## woker_none
回显
```commandline
cd script
bash start.sh
客户端执行
curl http://192.168.16.157:8081/predict -H "Content-Type: application/json" -X POST -d '{"param":{"mode":"cls"},"texts":["111"]}'
返回
{"param":{"mode":"cls"},"texts":["111"]}
```
## woker_bert
bert
## woker_regression
实例demo提供一个回归预测 y = 1 *x1 + 2 * x2
```commandline
cd script
bash start.sh
客户端执行
curl http://192.168.16.157:8081/predict -H "Content-Type: application/json" -X POST -d '{"param":{"mode":"cls"},"texts":["111"]}'
返回
[
[
1.1050461530685425,
1.8959273099899292,
1.5472604036331177,
1.8059791326522827,
1.0221816301345825,
0.8907957077026367,
2.3363492488861084,
1.1122045516967773,
1.6358901262283325,
1.4435145854949951
]
]
```