mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-03-11 11:39:52 -04:00
18 lines
607 B
Python
Executable File
18 lines
607 B
Python
Executable File
#!/usr/bin/env python3
|
|
from __future__ import annotations
|
|
import importlib
|
|
import itertools
|
|
from pathlib import Path
|
|
|
|
_client_all = Path(__file__).parent.parent/"src"/"openllm"/"client.py"
|
|
|
|
def main() -> int:
|
|
mod = importlib.import_module("openllm.client")
|
|
_all = [f'"{i}"' for i in itertools.chain.from_iterable(mod._import_structure.values())]
|
|
with _client_all.open("r") as f: processed = f.readlines()
|
|
processed = processed[:-1] + [f"__all__=[{','.join(sorted(_all))}]\n"]
|
|
with _client_all.open("w") as f: f.writelines(processed)
|
|
return 0
|
|
|
|
if __name__ == "__main__": raise SystemExit(main())
|