Files
OpenLLM/gen_readme.py
Aaron Pham d8fb4ae4a5 chore: cleanup code and env requirements
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
2025-04-09 21:36:46 -04:00

39 lines
864 B
Python

# /// script
# requires-python = ">=3.11"
# dependencies = [
# "jinja2",
# "pre-commit",
# "uv",
# ]
# ///
import subprocess, sys, pathlib, json, jinja2
if __name__ == '__main__':
with (pathlib.Path('.').parent / 'README.md').open('w') as f:
f.write(
jinja2.Environment(loader=jinja2.FileSystemLoader('.'))
.get_template('README.md.tpl')
.render(
model_dict=json.loads(
subprocess.run(
[
sys.executable,
'-m',
'uv',
'run',
'--with-editable',
'.',
'openllm',
'model',
'list',
'--output',
'readme',
],
text=True,
check=True,
capture_output=True,
).stdout.strip()
)
)
)