/v1/tokenize returns a flat list when the text array holds a single string
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- cpp, json
Línea de trabajo
Start with src/tokenize/tokenize_parser.cpp, especially the nesting condition based on outputShape[0] > 1, and compare it with the request parsing sequence in src/llm/servable.cpp. Update or add coverage in tokenize_parser_test.cpp and tokenize_endpoint_test.cpp for a one-element array, then update the tokenize response documentation. Done means every string array returns one token list per input, including a single string, with the endpoint behavior and documented response shape covered.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The shape of the /v1/tokenize response follows the number of strings in the request instead of the
form of the request. src/tokenize/tokenize_parser.cpp nests the tokens only when the tokenizer
output has more than one row (outputShape[0] > 1), and a one-element array produces one row, the
same as a plain string:
{"text": "hello world"} -> {"tokens":[14990,1879]}
{"text": ["hello world"]} -> {"tokens":[14990,1879]}
{"text": ["hello world", "hi"]} -> {"tokens":[[14990,1879],[6023]]}
A client that sends a list and reads tokens[i] for each input gets a list of token lists for
two or more inputs, but a flat list of integers for exactly one. Batches that happen to contain one
string need special handling on the client.
None of the tests send a one-element array: the list cases in tokenize_parser_test.cpp and
tokenize_endpoint_test.cpp all use two or more strings. The docs show only the single-string
response.
To Reproduce
curl http://localhost:8000/v1/tokenize -H "Content-Type: application/json" \
-d '{"model": "Qwen/Qwen3-8B", "text": ["hello world"]}'
Reproduced with the parser and a real Qwen3 tokenizer, following the same sequence as
src/llm/servable.cpp: parse the request, encode, build the response.
Expected behavior
An array of strings always gives a list of token lists, including an array with one string.
Note that this changes the response for clients that currently send a one-element array and rely on
the flat list.
Logs
None.
Configuration
- OVMS version: main @ eec7daac
- any servable that serves /v1/tokenize (LLM, VLM, embeddings, rerank)
- N/A
- N/A
- N/A
Additional context
I have a patch with tests and docs and will open a PR.
- Lenguaje dominante
- C++
- Estrellas
- 952
- Forks
- 285
- Merge medio
- 3 d 5 h
- PR fusionados (30 d)
- 45
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openvinotoolkit/model_server
-
KServe REST parser drops requested outputs except the lastPosiblemente ocupada @YugShah1510 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
openvinotoolkit/model_server#4690 ·
Los mantenedores suelen responder en 2 días
-
KServe REST rejects INT64 and UINT64 values outside 32-bit rangePosiblemente ocupada @YugShah1510 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
openvinotoolkit/model_server#4688 ·
Los mantenedores suelen responder en 2 días
-
Preserve double precision when parsing FP64 REST inputsPosiblemente ocupada @YugShah1510 la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
openvinotoolkit/model_server#4686 ·
Los mantenedores suelen responder en 2 días
-
Rerank with an empty documents array or object documents fails with an internal tokenizer errorPosiblemente ocupada @Daksha1611 la tomó hace 4 días. Abierto
Dificultad 4/5 1-2 días Aptitud para principiantes 24/100
openvinotoolkit/model_server#4671 ·
Los mantenedores suelen responder en 2 días
-
Downloading an image from a URL has no timeoutPosiblemente ocupada @Daksha1611 la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
openvinotoolkit/model_server#4669 ·
Los mantenedores suelen responder en 2 días
Todos los issues de openvinotoolkit/model_server
Issues similares
-
[mimalloc] update to 3.6.0Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 2 días
-
MinGW build faillureAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
facebookresearch/faiss#5775 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Eval bug: minimax-m3: build_moe_ffn() drops the per-expert NVFP4 scale → garbled output (M3.1 Flash)Abiertobug-unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
secondlife/viewer#6507 ·
Los mantenedores suelen responder en 1 día
-
clang:frontend code-cleanup HLSL
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
llvm/llvm-project#235100 · 1 comentario ·
Los mantenedores suelen responder en 1 día