Genuine question, whats the difference between your startup and just calling the below code with a different model on a cloud machine, other than some ML/Dev OP's engineer not knowing what they are doing...?
model = get_model(\*model_config)
state_dict = torch.load(model_path, weights_only=True)
new_state_dict = {k.replace('_orig_mod.', ''): v for k, v in state_dict.items()}
model.load_state_dict(new_state_dict)
model.eval()
with torch.no_grad():
output = model(torch.FloatTensor(X))
probabilities = torch.softmax(output, dim=X)
return probabilities.numpy()