forked from luopingyi/xc_agent_platform_demo
27 lines
926 B
Python
27 lines
926 B
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""Generate config only; never creates a task or prints returned YAML/secrets."""
|
||
|
|
import argparse
|
||
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||
|
|
from src.build_config_client import build_config, BuildConfigError
|
||
|
|
|
||
|
|
|
||
|
|
def main():
|
||
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
||
|
|
parser.add_argument('--gpu-type', default='Sunrise_pt-200-x1')
|
||
|
|
parser.add_argument('--framework', default='vllm')
|
||
|
|
parser.add_argument('--task-type', default='text-generation')
|
||
|
|
args = parser.parse_args()
|
||
|
|
try:
|
||
|
|
yaml = build_config(args.gpu_type, args.framework, args.task_type)
|
||
|
|
except BuildConfigError as error:
|
||
|
|
print(str(error), file=sys.stderr)
|
||
|
|
return 1
|
||
|
|
print(f'configParams_source=build-config; generated YAML characters={len(yaml)}; no task submitted')
|
||
|
|
return 0
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
sys.exit(main())
|