提交 768e4969 编写于 作者: W wangguibao

Elastic CTR

上级 114ad427
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import json import json
import httplib import httplib
import sys import sys
...@@ -28,7 +29,7 @@ SLOTS = [] ...@@ -28,7 +29,7 @@ SLOTS = []
def data_reader(data_file, samples, labels): def data_reader(data_file, samples, labels):
if not os.path.exists(data_file): if not os.path.exists(data_file):
print "Path %s not exist" % data_file print("Path %s not exist" % data_file)
return -1 return -1
with open(data_file, "r") as f: with open(data_file, "r") as f:
...@@ -59,7 +60,9 @@ if __name__ == "__main__": ...@@ -59,7 +60,9 @@ if __name__ == "__main__":
""" main """ main
""" """
if len(sys.argv) != 5: if len(sys.argv) != 5:
print "Usage: python elastic_ctr.py SERVING_IP SERVING_PORT SLOT_CONF_FILE DATA_FILE" print(
"Usage: python elastic_ctr.py SERVING_IP SERVING_PORT SLOT_CONF_FILE DATA_FILE"
)
sys.exit(-1) sys.exit(-1)
samples = [] samples = []
...@@ -86,5 +89,5 @@ if __name__ == "__main__": ...@@ -86,5 +89,5 @@ if __name__ == "__main__":
api.add_slot(instance, k, v) api.add_slot(instance, k, v)
ret = api.inference() ret = api.inference()
print ret print(ret)
sys.exit(0) sys.exit(0)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册