mirror of
https://github.com/bentoml/OpenLLM.git
synced 2025-12-23 23:57:46 -05:00
40 lines
871 B
Python
40 lines
871 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()
|
|
)
|
|
)
|
|
)
|