bhoov commited on
Commit
fad2f31
1 Parent(s): 688966f
Files changed (1) hide show
  1. server/model_api.py +3 -2
server/model_api.py CHANGED
@@ -53,8 +53,9 @@ class ModelDetails:
53
  bost = self.tok.bos_token_id
54
  clst = self.tok.cls_token_id
55
  sept = self.tok.sep_token_id
56
- if (bost is not None) and (bost != clst) and (clst != sept) and add_special_tokens:
57
- ids.insert(0, bost)
 
58
 
59
  inputs = self.tok.prepare_for_model(ids, add_special_tokens=add_special_tokens, return_tensors="pt")
60
  parsed_input = self.parse_inputs(inputs, mask_attentions=mask_attentions)
 
53
  bost = self.tok.bos_token_id
54
  clst = self.tok.cls_token_id
55
  sept = self.tok.sep_token_id
56
+ if (bost is not None) and (bost != clst)and add_special_tokens:
57
+ if (clst is not None and clst != sept):
58
+ ids.insert(0, bost)
59
 
60
  inputs = self.tok.prepare_for_model(ids, add_special_tokens=add_special_tokens, return_tensors="pt")
61
  parsed_input = self.parse_inputs(inputs, mask_attentions=mask_attentions)