-
Notifications
You must be signed in to change notification settings - Fork 702
/
Copy pathgen_readme.py
38 lines (37 loc) · 1.12 KB
/
gen_readme.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# /// 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()
)
)
)