diff --git a/python/examples/bert/bert_web_service.py b/python/examples/bert/bert_web_service.py index 8db64e5eb792a7365ed739bbfb05bf38fd8a0da1..6a5830ea179b033f9f761010d8cf9213d9b1e40b 100644 --- a/python/examples/bert/bert_web_service.py +++ b/python/examples/bert/bert_web_service.py @@ -23,10 +23,10 @@ class BertService(WebService): def load(self): self.reader = BertReader(vocab_file="vocab.txt", max_seq_len=128) - def preprocess(self, feed={}, fetch=[]): - feed_res = [{ - "words": self.reader.process(ins["words"].encode("utf-8")) - } for ins in feed] + def preprocess(self, feed=[], fetch=[]): + feed_res = [ + self.reader.process(ins["words"].encode("utf-8")) for ins in feed + ] return feed_res, fetch