b274db161929f34024c254dc5b78603abbeb855a,service/server.py,BertSink,run,#BertSink#,135

Before Change


        self.receiver.bind(SINK_ADDR)
        while not self.exit_flag.is_set():
            resp = self.receiver.recv_multipart()
            print(len(resp))
            for j in resp:
                print(j)
                input()

After Change


        while not self.exit_flag.is_set():
            msg = self.receiver.recv_multipart()
            client_id = msg[0]
            arr_info, arr_val = jsonapi.loads(msg[2]), msg[4]
            X = np.frombuffer(memoryview(arr_val), dtype=arr_info["dtype"])
            X = X.reshape(arr_info["shape"])
            self.logger.info("received %s of client %s" % (X.shape, client_id))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: hanxiao/bert-as-service
Commit Name: b274db161929f34024c254dc5b78603abbeb855a
Time: 2018-11-15
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertSink
Method Name: run


Project Name: ray-project/ray
Commit Name: 0ba777af99e2d9dd8adf543f31860ea48f1acc05
Time: 2020-11-02
Author: swang@cs.berkeley.edu
File Name: python/ray/workers/default_worker.py
Class Name:
Method Name:


Project Name: hanxiao/bert-as-service
Commit Name: d973eef6473d7b3292cff3b1069e0da08bb401da
Time: 2018-11-13
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertServer
Method Name: run