4b5b11dfd79fdf0dd0fb268808f3efcbeb9e0021,server.py,ServerWorker,run,#ServerWorker#,52

Before Change


            start_t = time.time()
            msg = pickle.loads(msg)
            if self.is_valid_input(msg):
                worker.send_multipart([ident, pickle.dumps(model.predict(msg))])
                logger.info("worker %d: encoding %d strings in %.4fs speed: %d/s" % (self.id,
                                                                                     len(msg), time.time() - start_t,
                                                                                     int(len(msg) / (

After Change


                features = convert_lst_to_features(msg, self.max_seq_len, self.tokenizer)
                input_fn = input_fn_builder(features, self.max_seq_len, self.batch_size)

                result = []
                for r in Estimator(self.model_fn).predict(input_fn):
                    result.append([round(float(x), 8) for x in r["pooled"].flat])

                worker.send_multipart([ident, pickle.dumps(result)])
                logger.info("worker %d: encoding %d strings in %.4fs speed: %d/s" % (self.id,
                                                                                     len(msg), time.time() - start_t,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: hanxiao/bert-as-service
Commit Name: 4b5b11dfd79fdf0dd0fb268808f3efcbeb9e0021
Time: 2018-11-08
Author: hanhxiao@tencent.com
File Name: server.py
Class Name: ServerWorker
Method Name: run


Project Name: ClimbsRocks/auto_ml
Commit Name: e2ad21ebac23581bf78422ec85b88fdec8d4c1cf
Time: 2016-08-07
Author: climbsbytes@gmail.com
File Name: test_script.py
Class Name:
Method Name:


Project Name: keras-team/autokeras
Commit Name: f4503bb3a3be014b452f54d8e2d187bb6419f627
Time: 2018-08-01
Author: jhfjhfj1@gmail.com
File Name: autokeras/classifier.py
Class Name: ImageClassifier
Method Name: predict