🚨🚨🚨 Fix sdpa in SAM and refactor relative position embeddings (#36422)

* fall back to eager if output_attentions

* improve relative position embeddings

* run modular on got_ocr2

* run-slow: sam

* fix run-length encoding

* fix tf processor errors

* update tf_sam

* fix compile error

* re-run tests
This commit is contained in:
Armaghan Shakir
2025-03-17 14:39:52 +05:00
committed by GitHub
parent fc8764c9a6
commit c53d53da89
6 changed files with 62 additions and 103 deletions

View File

@@ -312,7 +312,7 @@ class TFSamProcessorTest(unittest.TestCase):
# This is shape (1, 2, 2).
# Flattened in Fortran order -> [0, 1, 1, 1].
# The RLE for [0,1,1,1] is [1, 3].
input_mask = tf.tensor([[[0, 1], [1, 1]]], dtype=tf.int64)
input_mask = tf.constant([[[0, 1], [1, 1]]], dtype=tf.int64)
rle = _mask_to_rle_tf(input_mask)
self.assertEqual(len(rle), 1)