cofe-ai / fast-gector

Apache License 2.0
54 stars 11 forks source link

Inference error #5

Closed damien2012eng closed 1 year ago

damien2012eng commented 1 year ago

Received the following error message wehn doing the inference: Looks like the MisMatchedTokenizer now takes three positional arguments here, only two are given in the predictor class here.

Traceback (most recent call last): File "/home/ec2-user/gector/fast-gector/predict.py", line 101, in main(args) File "/home/ec2-user/gector/fast-gector/predict.py", line 49, in main pred_batch, cnt = predictor.handle_batch(batch_text) File "/home/ec2-user/gector/fast-gector/src/predictor.py", line 76, in handle_batch batch_input_dict = self.preprocess(ori_batch) File "/home/ec2-user/gector/fast-gector/src/predictor.py", line 114, in preprocess input_ids, offsets = self.mismatched_tokenizer.encode(tokens) File "/home/ec2-user/gector/fast-gector/utils/mismatched_utils.py", line 22, in encode wordpiece_ids = [self.tokenizer_vocab[wordpiece] File "/home/ec2-user/gector/fast-gector/utils/mismatched_utils.py", line 22, in wordpiece_ids = [self.tokenizer_vocab[wordpiece] TypeError: 'int' object is not subscriptable

Jason3900 commented 1 year ago

I'll fix it later. Thanks for your suggestion.

Jason3900 commented 1 year ago

You can pull the codes and try again now.