Spaces:
Runtime error
Runtime error
Fix begin notes
Browse files
app.py
CHANGED
@@ -82,13 +82,14 @@ def process_relevances(input_tokens, all_relevances, generated_tokens):
|
|
82 |
current_width = 0
|
83 |
return best_width, best_patch_start
|
84 |
|
85 |
-
output_with_notes = [
|
86 |
-
for row in range(
|
87 |
-
best_width, best_patch_start = find_largest_contiguous_patch(significant_areas[row
|
88 |
if best_width is not None:
|
89 |
output_with_notes.append((generated_tokens[row], (best_width, best_patch_start)))
|
90 |
else:
|
91 |
output_with_notes.append((generated_tokens[row], None))
|
|
|
92 |
|
93 |
# Fuse the notes for consecutive output tokens if necessary
|
94 |
for i in range(len(output_with_notes)):
|
|
|
82 |
current_width = 0
|
83 |
return best_width, best_patch_start
|
84 |
|
85 |
+
output_with_notes = []
|
86 |
+
for row in range(len(generated_tokens)-kernel_width+1):
|
87 |
+
best_width, best_patch_start = find_largest_contiguous_patch(significant_areas[row])
|
88 |
if best_width is not None:
|
89 |
output_with_notes.append((generated_tokens[row], (best_width, best_patch_start)))
|
90 |
else:
|
91 |
output_with_notes.append((generated_tokens[row], None))
|
92 |
+
output_with_notes += [(el, None) for el in generated_tokens[-kernel_width+1:]]
|
93 |
|
94 |
# Fuse the notes for consecutive output tokens if necessary
|
95 |
for i in range(len(output_with_notes)):
|