Skip to content
Snippets Groups Projects

Remove add_eot and add_sot parameters from training configuration

Merged Manon Blanco requested to merge remove-add-eot-and-add-sot into main
4 files
+ 6
14
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 2
4
@@ -174,11 +174,9 @@ class OCRDataset(GenericDataset):
sample["label"] = full_label
sample["token_label"] = token_to_ind(self.charset, full_label)
if "add_eot" in self.params["config"]["constraints"]:
sample["token_label"].append(self.tokens["end"])
sample["token_label"].append(self.tokens["end"])
sample["label_len"] = len(sample["token_label"])
if "add_sot" in self.params["config"]["constraints"]:
sample["token_label"].insert(0, self.tokens["start"])
sample["token_label"].insert(0, self.tokens["start"])
return sample
Loading