mirror of
https://git.isriupjv.fr/ISRI/ai-server
synced 2025-04-24 10:08:11 +02:00
added support for tags to categorise the models
This commit is contained in:
parent
b89fafdc96
commit
c6d779f591
3 changed files with 9 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"type": "python",
|
||||
"tags": ["dummy"],
|
||||
"file": "model.py",
|
||||
|
||||
"inputs": {
|
||||
|
|
|
@ -68,7 +68,12 @@ class PythonModel(base.BaseModel):
|
|||
infer_api.__signature__ = inspect.Signature(parameters=parameters)
|
||||
|
||||
# add the inference endpoint on the API
|
||||
self.manager.application.add_api_route(f"/models/{self.name}/infer", infer_api, methods=["POST"])
|
||||
self.manager.application.add_api_route(
|
||||
f"/models/{self.name}/infer",
|
||||
infer_api,
|
||||
methods=["POST"],
|
||||
tags=self.tags,
|
||||
)
|
||||
|
||||
def _load(self) -> None:
|
||||
return self.module.load(self)
|
||||
|
|
|
@ -18,6 +18,8 @@ class BaseModel(abc.ABC):
|
|||
self.manager = manager
|
||||
# the mimetype of the model responses
|
||||
self.output_type: str = configuration.get("output_type", "application/json")
|
||||
# get the tags of the model
|
||||
self.tags = configuration.get("tags", [])
|
||||
|
||||
self._loaded = False
|
||||
|
||||
|
|
Loading…
Reference in a new issue