[Bugfix] Fix various bugs in multi-modal processor (#12031)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -421,6 +421,8 @@ def test_find_replace_tokens(
|
||||
"pattern_1": [32000, 32000],
|
||||
"pattern_2": [],
|
||||
"pattern_3": [1550, 918, 1550],
|
||||
# Test different modalities having the same tokens (32000)
|
||||
"pattern_4": [32000],
|
||||
},
|
||||
],
|
||||
)
|
||||
@@ -438,6 +440,14 @@ def test_find_replace_tokens(
|
||||
replacement=[32000, 32000],
|
||||
),
|
||||
],
|
||||
"pattern_4": [
|
||||
PlaceholderInfo(
|
||||
modality="pattern_4",
|
||||
item_idx=0,
|
||||
start_idx=3,
|
||||
replacement=[32000],
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
),
|
||||
@@ -466,6 +476,7 @@ def test_find_replace_tokens(
|
||||
replacement=[1550, 918, 1550],
|
||||
),
|
||||
],
|
||||
# No match for pattern_4 as it has lower priority than pattern_1
|
||||
}
|
||||
),
|
||||
(
|
||||
@@ -485,6 +496,14 @@ def test_find_replace_tokens(
|
||||
replacement=[32000, 32000],
|
||||
),
|
||||
],
|
||||
"pattern_4": [
|
||||
PlaceholderInfo(
|
||||
modality="pattern_4",
|
||||
item_idx=0,
|
||||
start_idx=5,
|
||||
replacement=[32000],
|
||||
),
|
||||
],
|
||||
"pattern_3": [
|
||||
PlaceholderInfo(
|
||||
modality="pattern_3",
|
||||
|
||||
Reference in New Issue
Block a user