Files
OpenLLM/gen_readme.py
Sherlock Xu 7c8e79c632 docs: Fix deploy command (#1147)
* docs: Fix deploy command

Signed-off-by: Sherlock Xu <65327072+Sherlock113@users.noreply.github.com>

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Signed-off-by: Sherlock Xu <65327072+Sherlock113@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-23 22:28:39 -05:00

37 lines
993 B
Python

# /// script
# requires-python = ">=3.11"
# dependencies = [
# "jinja2",
# "uv",
# ]
# ///
import subprocess, sys, pathlib, json, jinja2
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()
)
)
)