update Readme
This commit is contained in:
19
README.md
19
README.md
@@ -20,25 +20,6 @@ docker run -it --rm \
|
||||
-v /mnt/contest_ceph/zhoushasha/models/microsoft/beit-base-patch16-224:/model:rw \
|
||||
--privileged bi100-3.2.1-x86-ubuntu20.04-py3.10-poc-llm-infer:test
|
||||
```
|
||||
4、测试服务
|
||||
```python
|
||||
# 服务地址(根据实际部署修改)
|
||||
BASE_URL = "http://localhost:80"
|
||||
PREDICT_ENDPOINT = "/v1/private/s782b4996"
|
||||
|
||||
# 本地图片路径(替换为你的图片路径)
|
||||
IMAGE_PATH = "test_image.jpg"
|
||||
|
||||
# 读取图片文件并发送请求
|
||||
with open(IMAGE_PATH, "rb") as f:
|
||||
files = {"image": f} # 键名必须为 "image",与服务端接收字段一致
|
||||
response = requests.post(f"{BASE_URL}{PREDICT_ENDPOINT}", files=files)
|
||||
|
||||
# 打印响应结果
|
||||
print("预测接口响应状态码:", response.status_code)
|
||||
print("预测结果:")
|
||||
print(response.json())
|
||||
```
|
||||
|
||||
## 视觉分类模型测试服务原理
|
||||
|
||||
|
||||
Reference in New Issue
Block a user