Seungbeom Ha
09/09/2024, 11:47 PMChaoyu
09/10/2024, 12:44 AM@task abstraction for this. https://docs.bentoml.com/en/latest/guides/services.html#tasks
You may also want to limit the concurrency to 1 in case of OOM issues. https://docs.bentoml.com/en/latest/bentocloud/how-tos/autoscaling.html#concurrencySeungbeom Ha
09/10/2024, 12:51 AMimport bentoml
@bentoml.service(
traffic={
"concurrency": 1,
}
)
class MachineLearningService:
@bentoml.task
def get_train_data_train_model(self, data: dict) -> dict:
# Process training
return data
@bentoml.api
def predict(self, data: dict) -> dict:
# Process predict
return dataChaoyu
09/10/2024, 5:55 AM