Skip to content

Commit

Permalink
FIx #7
Browse files Browse the repository at this point in the history
Fix #7

This was a fun one, had a missing len() which caused relation candidates to be 0 when candidates are trimmed due to max_length. Due to an older version of pytorch having issues with 0 dimensional tensors with einsum, it cause issues to some people on Colab.
  • Loading branch information
LittlePea13 authored Sep 23, 2024
1 parent 345672e commit 48e9b54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion relik/reader/data/relik_reader_re_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def flip_cands(flip_candidates, candidates):

candidates_encoding_result = (
candidates_encoding_result[:i]
+ candidates_encoding_result[len(sample.span_candidates) : i]
+ candidates_encoding_result[len(sample.span_candidates) : len(sample.span_candidates) + i]
)
if len(self.special_symbols_types) > 0:
candidates_entities_symbols = candidates_entities_symbols[:i]
Expand Down

0 comments on commit 48e9b54

Please sign in to comment.