Download inference/preflight.py from FlyaiLab/FlyAI-Decision-27B: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/FlyaiLab/FlyAI-Decision-27B/resolve/main/inference/preflight.py
- Command line
-
hf download hf://FlyaiLab/FlyAI-Decision-27B/inference/preflight.py
-
curl -L -o preflight.py https://huggingface.co/FlyaiLab/FlyAI-Decision-27B/resolve/main/inference/preflight.py
1.1 kB
| """Validate the complete vLLM engine configuration before loading weights.""" | |
| import argparse | |
| import json | |
| import os | |
| from pathlib import Path | |
| from decision_vllm_engine import llm_options | |
| def main() -> None: | |
| """Resolve model metadata and engine arguments using the inference configuration.""" | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('model') | |
| parser.add_argument('--output', type=Path) | |
| args = parser.parse_args() | |
| os.environ['VLLM_ENABLE_V1_MULTIPROCESSING'] = '0' | |
| from vllm.engine.arg_utils import EngineArgs | |
| config = EngineArgs(**llm_options(args.model)).create_engine_config() | |
| if config.model_config.hf_text_config.is_causal is not False: | |
| raise ValueError('Full-attention configuration must be bidirectional') | |
| report = {'stage': 'engine_configuration_verified', 'passed': True, | |
| 'is_causal': False, 'max_model_len': config.model_config.max_model_len} | |
| if args.output: | |
| args.output.write_text(json.dumps(report, indent=2) + '\n') | |
| print(json.dumps(report), flush=True) | |
| if __name__ == '__main__': | |
| main() | |