@@ -431,7 +431,7 @@ def deploy_model(self,
431431 ----------
432432 name : str
433433 The name to assign this model.
434- version : int
434+ version : Any object with a string representation (with __str__ implementation)
435435 The version to assign this model.
436436 model_data : str or BaseEstimator
437437 The trained model to add to Clipper. This can either be a
@@ -470,6 +470,7 @@ def deploy_model(self,
470470 warn ("%s is invalid model format" % str (type (model_data )))
471471 return False
472472
473+ version = str (version )
473474 vol = "{model_repo}/{name}/{version}" .format (
474475 model_repo = MODEL_REPO , name = name , version = version )
475476 # publish model to Clipper and verify success before copying model
@@ -509,13 +510,14 @@ def register_external_model(self,
509510 ----------
510511 name : str
511512 The name to assign this model.
512- version : int
513+ version : Any object with a string representation (with __str__ implementation)
513514 The version to assign this model.
514515 input_type : str
515516 One of "integers", "floats", "doubles", "bytes", or "strings".
516517 labels : list of str, optional
517518 A list of strings annotating the model.
518519 """
520+ version = str (version )
519521 return self ._publish_new_model (name , version , labels , input_type ,
520522 EXTERNALLY_MANAGED_MODEL ,
521523 EXTERNALLY_MANAGED_MODEL )
@@ -586,7 +588,7 @@ def deploy_pyspark_model(self,
586588 ----------
587589 name : str
588590 The name to assign this model.
589- version : int
591+ version : Any object with a string representation (with __str__ implementation)
590592 The version to assign this model.
591593 predict_function : function
592594 A function that takes three arguments, a SparkContext, the ``model`` parameter and
@@ -679,7 +681,7 @@ def deploy_predict_function(self,
679681 ----------
680682 name : str
681683 The name to assign this model.
682- version : int
684+ version : Any object with a string representation (with __str__ implementation)
683685 The version to assign this model.
684686 predict_function : function
685687 The prediction function. Any state associated with the function should be
@@ -766,7 +768,7 @@ def get_model_info(self, model_name, model_version):
766768 ----------
767769 model_name : str
768770 The name of the model to look up
769- model_version : int
771+ model_version : Any object with a string representation (with __str__ implementation)
770772 The version of the model to look up
771773
772774 Returns
@@ -776,6 +778,7 @@ def get_model_info(self, model_name, model_version):
776778 If no model with name `model_name@model_version` is
777779 registered with Clipper, None is returned.
778780 """
781+ model_version = str (model_version )
779782 url = "http://%s:1338/admin/get_model" % self .host
780783 req_json = json .dumps ({
781784 "model_name" : model_name ,
@@ -826,7 +829,7 @@ def get_container_info(self, model_name, model_version, replica_id):
826829 ----------
827830 model_name : str
828831 The name of the container to look up
829- model_version : int
832+ model_version : Any object with a string representation (with __str__ implementation)
830833 The version of the container to look up
831834 replica_id : int
832835 The container replica to look up
@@ -837,6 +840,7 @@ def get_container_info(self, model_name, model_version, replica_id):
837840 A dictionary with the specified container's info.
838841 If no corresponding container is registered with Clipper, None is returned.
839842 """
843+ model_version = str (model_version )
840844 url = "http://%s:1338/admin/get_container" % self .host
841845 req_json = json .dumps ({
842846 "model_name" : model_name ,
@@ -970,7 +974,7 @@ def add_container(self, model_name, model_version):
970974 ----------
971975 model_name : str
972976 The name of the model
973- model_version : int
977+ model_version : Any object with a string representation (with __str__ implementation)
974978 The version of the model
975979
976980 Returns
@@ -979,6 +983,7 @@ def add_container(self, model_name, model_version):
979983 True if the container was added successfully and False
980984 if the container could not be added.
981985 """
986+ model_version = str (model_version )
982987 with hide ("warnings" , "output" , "running" ):
983988 # Look up model info in Redis
984989 if self .redis_ip == DEFAULT_REDIS_IP :
@@ -1024,7 +1029,7 @@ def add_container(self, model_name, model_version):
10241029 mv = model_version ,
10251030 mip = model_input_type ,
10261031 clipper_label = CLIPPER_DOCKER_LABEL ,
1027- mv_label = "%s=%s:%d " % (CLIPPER_MODEL_CONTAINER_LABEL ,
1032+ mv_label = "%s=%s:%s " % (CLIPPER_MODEL_CONTAINER_LABEL ,
10281033 model_name , model_version ),
10291034 restart_policy = restart_policy ))
10301035 result = self ._execute_root (add_container_cmd )
@@ -1101,14 +1106,16 @@ def set_model_version(self, model_name, model_version, num_containers=0):
11011106 ----------
11021107 model_name : str
11031108 The name of the model
1104- model_version : int
1109+ model_version : Any object with a string representation (with __str__ implementation)
11051110 The version of the model. Note that `model_version`
11061111 must be a model version that has already been deployed.
11071112 num_containers : int
11081113 The number of new containers to start with the newly
11091114 selected model version.
11101115
11111116 """
1117+ model_version = str (model_version )
1118+
11121119 url = "http://%s:%d/admin/set_model_version" % (
11131120 self .host , CLIPPER_MANAGEMENT_PORT )
11141121 req_json = json .dumps ({
0 commit comments