Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Rerank with an empty documents array or object documents fails with an internal tokenizer error

Đang mở
#4,671 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@Daksha1611 đang làm issue này rồi.

Từ ngày 19/10/2026.

  • #4672 của @Daksha1611 — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
24/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
backend

Hướng nghiên cứu

Read rerank_calculator_ov.cc where the calculator reads getDocumentsList() and calls the tokenizer, then inspect rerank_handler_test.cpp for how empty and object documents are parsed. Reproduce the request with a rerank model and trace how the empty list reaches tokenization. Done means these inputs return a clear 400 response instead of an internal tokenizer error; the report notes a rerank model is needed for end-to-end verification.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

RerankHandler::parseRequest() accepts "documents": [] and documents given as {"title", "text"}
objects. The rerank calculator only reads getDocumentsList() (rerank_calculator_ov.cc), which is
empty in both cases: object documents are parsed into documentsMap, which is not used yet (the docs
list dictionary documents as unsupported, and parseResponse has a TODO for the map). The
calculator then calls the tokenizer with an empty list.

With a real Qwen3 tokenizer, encode() of an empty list throws:

Exception from src/inference/src/cpp/infer_request.cpp:224:
Exception from src/plugins/intel_cpu/src/graph.cpp:1626:
Node SpecialTokensSplit_122229 of type Reference
basic_string::_M_create

The calculator catches the exception and returns its message as an internal error, so the client
gets an opaque 500 instead of a message saying the documents are not supported or are missing.

Two documents given as objects with the same title also collapse into one, because the map is keyed
by title.

I checked the parsing and the tokenizer call separately; I did not run the calculator end to end,
since that needs a rerank model.

To Reproduce

curl http://localhost:8000/v3/rerank -H "Content-Type: application/json" \
  -d '{"model": "<rerank model>", "query": "hello", "documents": []}'

The same with "documents": [{"title": "a", "text": "Welcome"}].

Expected behavior

A 400 that says what is wrong: "documents array should not be empty" or "documents given as objects
are not supported, use an array of strings".

Logs

The tokenizer exception above.

Configuration

  1. OVMS version: main @ eec7daac
  2. rerank servable
  3. N/A
  4. N/A
  5. N/A

Additional context

The existing tests deliberately expect object documents to parse into the map
(rerank_handler_test.cpp), so I left the parser alone and checked after it.

I have a patch with tests and will open a PR.

Ngôn ngữ chính
C++
Star
947
Fork
280
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
46

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openvinotoolkit/model_server

Tất cả issue của openvinotoolkit/model_server

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.