mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-01-22 22:39:47 -05:00
docs(codegen): make sure the generated dostring is correct
Signed-off-by: aarnphm-ec2-dev <29749331+aarnphm@users.noreply.github.com> Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
@@ -28,13 +28,14 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def write_service(model_name: str, target_path: str, llm_fs: FS):
|
||||
logger.debug("Generating service for %s to %s", model_name, target_path)
|
||||
service_file = Path(__file__).parent.parent / "_service.py"
|
||||
with open(service_file.__fspath__(), "rb") as f:
|
||||
node = ast.parse(f.read())
|
||||
generator = ServiceGenerator(model_name)
|
||||
generator.visit(node)
|
||||
llm_fs.writetext(
|
||||
target_path, f"# GENERATED BY 'openllm build {model_name}'. DO NOT EDIT\n" + "".join(generator.result)
|
||||
target_path, f"# GENERATED BY 'openllm bundle {model_name}'. DO NOT EDIT\n" + "".join(generator.result)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user