fix: 兼容模型加载失败场景,手动构造 image-classification pipeline

- 增加模型加载的异常处理,当 pipeline 直接加载失败时回退为
    手动加载 AutoImageProcessor 和 AutoModelForImageClassification
  - 添加 torchvision 依赖
This commit is contained in:
zhenghu
2026-04-15 14:27:58 +08:00
parent 86541eb55e
commit 581630c4e0
3 changed files with 40 additions and 5 deletions

View File

@@ -10,6 +10,7 @@ dependencies = [
"ruff>=0.14.8",
"streamlit==1.52.1",
"torch>=2.7.0",
"torchvision>=0.22.0",
"transformers>=4.52.0",
"pillow>=11.2.0",
]