Custom inference endpoint with multiple models

I would like to deploy an inference endpoint based on a combination of multiple models.
Here is the repository structure


What will be the value of path here? Adding a few prints in the handler tells me that it is set to /repository/.
However, it also looks like /repository/ does not contain and
Is this on purpose? How can I update the code below to access and

class EndpointHandler:
    def __init__(self, path=""):
        self.model1 = torch.load('')
        self.model2 = torch.load('')

    def __call__(self, data):

the torch load should be `os.path.join(path,“”). The path var provided in the init points to where your files are.


The problem was that, for some reason, not all files are pulled from the model repository.

For instance, files with .ckpt extension (it was the case for me) are not available in path directory. I had to change the extension of the model files for them to be downloaded.

This behavior is probably documented somewhere but I could not find it.

The problem is now solved. os.path.join(path, "") does the trick.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.