690604:1208 ADR-034-134 #08
CI / CD Pipeline / build (push) Successful in 5m39s
CI / CD Pipeline / deploy (push) Successful in 7m54s

This commit is contained in:
2026-06-04 12:08:19 +07:00
parent 03963fd896
commit b14a0b3d58
2 changed files with 15 additions and 3 deletions
@@ -607,8 +607,8 @@ export default function OcrSandboxPromptManager() {
OCR Raw Text (Step 1 Result)
</CardTitle>
<Badge variant="outline" className="text-xs">
{ocrResult.engineUsed === 'typhoon-ocr-3b'
? 'Typhoon OCR-3B'
{ocrResult.engineUsed === 'typhoon-np-dms-ocr'
? 'Typhoon OCR'
: ocrResult.ocrUsed
? 'Tesseract'
: 'Fast Path (Text Layer)'}
@@ -234,7 +234,19 @@ def process_with_typhoon_ocr(pil_image: Image.Image, options_override: dict = {}
response = client.post(f"{OLLAMA_API_URL}/api/generate", json=payload)
response.raise_for_status()
data = response.json()
return str(data.get("response", "")).strip()
result_text = str(data.get("response", "")).strip()
logger.info(
f"[DIAG] Ollama response — model={model_name} "
f"textLen={len(result_text)} "
f"done={data.get('done')} "
f"done_reason={data.get('done_reason')} "
f"eval_count={data.get('eval_count', 0)}"
)
if not result_text:
logger.warning(
f"[DIAG] Ollama returned empty response — full response keys: {list(data.keys())}"
)
return result_text
@app.post("/ocr", response_model=OcrResponse, dependencies=[Depends(get_api_key)])