Repository navigation
Commit 58544a7
authored
Honor generation config token IDs in ORT GenAI export (#521)
## Summary
- load optional Hugging Face `generation_config.json` when writing ORT
GenAI artifacts
- prefer generation-config BOS/EOS/PAD IDs over model-config values
- preserve multi-EOS stop tokens such as Qwen3.6's `[<|im_end|>,
<|endoftext|>]`
Qwen3.6 defines scalar EOS `248044` in its text model config but
`[248046, 248044]` in its generation config. Ignoring the latter causes
generated ORT GenAI packages to miss `<|im_end|>` as a stopping token.
## Testing
- `python -m pytest -q
src/mobius/integrations/ort_genai/auto_export_test.py` (112 passed)
- `ruff check src/mobius/integrations/ort_genai/auto_export.py
src/mobius/integrations/ort_genai/auto_export_test.py`
- `ruff format --check src/mobius/integrations/ort_genai/auto_export.py
src/mobius/integrations/ort_genai/auto_export_test.py`
Copilot-Session: e10674c1-6909-4b09-9f5a-d41b28c89d2d1 parent 34e622b commit 58544a7
2 files changed
Lines changed: 83 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
191 | 204 | | |
192 | 205 | | |
193 | 206 | | |
| |||
1270 | 1283 | | |
1271 | 1284 | | |
1272 | 1285 | | |
| 1286 | + | |
| 1287 | + | |
1273 | 1288 | | |
1274 | 1289 | | |
1275 | 1290 | | |
| |||
1401 | 1416 | | |
1402 | 1417 | | |
1403 | 1418 | | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
1404 | 1433 | | |
1405 | 1434 | | |
1406 | 1435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1017 | 1021 | | |
1018 | 1022 | | |
1019 | 1023 | | |
| |||
1468 | 1472 | | |
1469 | 1473 | | |
1470 | 1474 | | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1471 | 1479 | | |
1472 | 1480 | | |
1473 | 1481 | | |
| |||
1488 | 1496 | | |
1489 | 1497 | | |
1490 | 1498 | | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1491 | 1503 | | |
1492 | 1504 | | |
1493 | 1505 | | |
| |||
1501 | 1513 | | |
1502 | 1514 | | |
1503 | 1515 | | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
1504 | 1554 | | |
1505 | 1555 | | |
1506 | 1556 | | |
| |||
2649 | 2699 | | |
2650 | 2700 | | |
2651 | 2701 | | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
2652 | 2706 | | |
2653 | 2707 | | |
2654 | 2708 | | |
| |||
0 commit comments