You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 170f28a
Browse filesBrowse the repository at this point in the historyBrowse files
fix: --config mode model_type and token ID propagation (#152)
Fixes model.type=unknown and missing bos/eos token IDs when using local
--config path. Addresses Issues 1 and 2 from Edge LLM evaluation.
## Problem
When building with `--config <local_dir>` instead of a HuggingFace model
ID:
1. **Issue 1**: `genai_config.json` always contained `"type": "unknown"`
because `ArchitectureConfig` had no `model_type` field — it was read
from the HF config but never stored.
2. **Issue 2**: `bos_token_id` / `eos_token_id` were absent from
`genai_config.json` because token IDs were only fetched via
`AutoConfig.from_pretrained()`, which is skipped when
`hf_model_id=None`.
## Fix
- Added `model_type`, `bos_token_id`, `eos_token_id` fields to
`ArchitectureConfig`
- Populated them in `from_transformers()` (called by the `--config`
path)
- In `write_ort_genai_config()`, the `else` branch (no `hf_model_id`)
now reads all three from `ArchitectureConfig` instead of leaving them as
`None`
## Tests
- `_configs_test.py`: verifies `from_transformers()` stores the new
fields
- `auto_export_test.py`: two new tests —
`test_config_mode_model_type_propagated` and
`test_config_mode_token_ids_propagated`
---------
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot <[email protected]>
0 commit comments