a9c930430636e79853203ab9fd921c33855d8ea1,fairseq/data/encoders/gpt2_bpe.py,GPT2BPE,decode,#GPT2BPE#Any#,42
Before Change
return " ".join(map(str, self.bpe.encode(x)))
def decode(self, x: str) -> str:
return self.bpe.decode(map(int, x.split()))
def is_beginning_of_word(self, x: str) -> bool:
return self.decode(x).startswith(" ")
After Change
def decode(self, x: str) -> str:
return self.bpe.decode([
int(tok) if tok not in {"<unk>"} else tok
for tok in x.split()
])
def is_beginning_of_word(self, x: str) -> bool:
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: pytorch/fairseq
Commit Name: a9c930430636e79853203ab9fd921c33855d8ea1
Time: 2019-12-16
Author: myleott@fb.com
File Name: fairseq/data/encoders/gpt2_bpe.py
Class Name: GPT2BPE
Method Name: decode
Project Name: biolab/orange3
Commit Name: 532c5db2b1520bc7422fa106576b11e36f4721ab
Time: 2015-08-06
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/canvas/help/manager.py
Class Name:
Method Name: create_html_inventory_provider
Project Name: biolab/orange3
Commit Name: 532c5db2b1520bc7422fa106576b11e36f4721ab
Time: 2015-08-06
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/canvas/help/manager.py
Class Name:
Method Name: create_html_provider