[deploy] Oracle 环境部署 + 模型基准测试 + OllamaAdapter 优化

- Oracle 依赖安装: flask/gunicorn/requests/PyYAML/opencv/numpy 全部成功
- FAM-Edge 全部 8 个模块导入验证 PASS
- llava-phi3 基准测试: 冷启动 109s, 预热无限制 13.35s, 预热+num_predict=30 仅 4.34s PASS
- OllamaAdapter 新增 num_predict 可配置参数 (默认 500)
- config.yaml.example 新增 num_predict 配置项
- 创建 PROGRESS.md 进度追踪文档
This commit is contained in:
ericwyuan
2026-08-19 23:01:21 +08:00
parent c1bfac59df
commit 50d83539f6
3 changed files with 97 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ models:
model_name: "llava-phi3"
base_url: "http://localhost:11434"
timeout: 240
num_predict: 500 # 最大生成 token 数ARM 上建议限制以控制延迟)
circuit_breaker:
enabled: false # 本地模型不启用熔断
threshold: 5

View File

@@ -24,6 +24,7 @@ class OllamaAdapter(BaseModelAdapter):
self.base_url = config.get('base_url', 'http://localhost:11434')
self.model_name = config.get('model_name', 'llava-phi3')
self.timeout = config.get('timeout', 240)
self.num_predict = config.get('num_predict', 500)
cb_cfg = config.get('circuit_breaker', {})
self._cb = CircuitBreaker(
threshold=cb_cfg.get('threshold', 5),
@@ -84,7 +85,7 @@ class OllamaAdapter(BaseModelAdapter):
"prompt": prompt,
"images": images,
"stream": False,
"options": {"temperature": 0.2, "top_p": 0.8}
"options": {"temperature": 0.2, "top_p": 0.8, "num_predict": self.num_predict}
},
timeout=self.timeout
)