Replies: 1 comment 4 replies
-
Hi @mxab - by For example, you can do something like this: models = [model_with_corpus1, model_with_corpus2, ...]
bento_artifacts = [PickleArtifact(f"model_{i}" for i in range(len(models)))]
@artifacts(bento_artifacts)
class MyService(BentoService)
@api(input=JsonInput())
def predict(self, json_array):
results = []
for i in range(len(self.artifacts)):
results.append(self.artifacts[f"model_{i}"].predict(json_array))
return results
my_service = MyService()
for index, model in models.enumerate():
my_service.pack(f"model_{index}", model)
my_service.save() |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
what is the best approach to publish and version a Service that is packed with models that have the same shape but are trained on different corpuses
something like this:
all models will be used in parallel, therefore the a "latest" model does not exists more like several latest ?
Beta Was this translation helpful? Give feedback.
All reactions