feat/kie-qwen-page-routing #3

Merged
annt839 merged 6 commits from feat/kie-qwen-page-routing into main 2026-09-29 01:31:15 +00:00
Owner
No description provided.
annt839 added 6 commits 2026-09-29 01:31:00 +00:00
- Lượt 1: document_type, document_number, issued_date, issuing_authority,
  title chỉ trên 3 trang đầu.
- Lượt 2: signer chỉ trên trang DLA có Signature/Stamp; ưu tiên trang có
  Stamp trong thân trang (bỏ dấu giáp lai ở dải 10% mép), tối đa
  IDP_KIE_MAX_PAGES trang cuối; không có trang nào thì không gọi model.
- Viết lại description các trường theo yêu cầu nghiệp vụ.
- normalize_answer nhận signer trả về dạng mảng.
- IDP_KIE_URL/IDP_KIE_MODEL mặc định trỏ Qwen3.5-4B cổng 9224, không còn
  dùng chung model OCR (Chandra DLA sinh JSON lan man khi làm KIE).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Chandra giữ image v2 và biến PORT/GPU_UTIL cũ; thêm service kie (vLLM
0.23, weights từ volume qwen35_4b, tắt thinking) khởi động sau khi chandra
healthy. Mặc định GPU_UTIL 0.55 + KIE_GPU_UTIL 0.3, đo ~80% card H200.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1.27.x render đen phần lớn trang PDF scan ghép từ dải ảnh Indexed, làm
Chandra trả text lặp và KIE đọc ảnh đen.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- tx(): chỉ ROLLBACK khi đang có transaction; BEGIN IMMEDIATE hết busy_timeout
  trước đây ném "cannot rollback - no transaction is active" che mất lỗi gốc.
- Luồng OCR/callback/coordinator chạy qua Worker.loop: lỗi được log.exception
  rồi thử lại, không còn giết luồng vĩnh viễn.
- OCR: model trả rỗng (trang trắng) thành trang không có block; output không
  parse được thì kèm 200 ký tự đầu vào thông báo lỗi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chandra + kie (vLLM, weights mount từ CHANDRA_MODEL_DIR/KIE_MODEL_DIR) và
api + worker (image build từ Dockerfile, network_mode host, đọc .env) thay cho
hai tmux run-api.sh/run-worker.sh và docker run chandra riêng. Worker mount
native-hdfs của gói portable, đợi hai model healthy mới nhận trang. GPU chọn
bằng GPU_DEVICE (driver nvidia) thay cho CDI GPU_UUID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
annt839 merged commit d2325f3102 into main 2026-09-29 01:31:15 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: annt839/parsing-service#3