提交 17cfb897 编写于 作者: B barrierye

update code

上级 d78b235e
......@@ -26,7 +26,7 @@ public class PredictFuture {
try {
resp = callFuture_.get();
} catch (Exception e) {
System.out.format("grpc failed: %s\n", e.toString());
System.out.format("predict failed: %s\n", e.toString());
return null;
}
Map<String, HashMap<String, INDArray>> ensemble_result
......@@ -35,7 +35,7 @@ public class PredictFuture {
= new ArrayList<Map.Entry<String, HashMap<String, INDArray>>>(
ensemble_result.entrySet());
if (list.size() != 1) {
System.out.format("grpc failed: please use get_ensemble impl.\n");
System.out.format("predict failed: please use get_ensemble impl.\n");
return null;
}
return list.get(0).getValue();
......@@ -46,7 +46,7 @@ public class PredictFuture {
try {
resp = callFuture_.get();
} catch (Exception e) {
System.out.format("grpc failed: %s\n", e.toString());
System.out.format("predict failed: %s\n", e.toString());
return null;
}
return callBackFunc_.apply(resp);
......
......@@ -30,8 +30,6 @@ imdb_dataset.load_resource('imdb.vocab')
for i in range(3):
line = 'i am very sad | 0'
word_ids, label = imdb_dataset.get_words_and_label(line)
print(type(word_ids[0]))
print(word_ids)
feed = {"words": word_ids}
fetch = ["prediction"]
fetch_maps = client.predict(feed=feed, fetch=fetch)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册