Fix #34494 assistant tokens when truncated (#34531)

* Fix assistant tokens when truncated

* fix test

* fix test

* step
This commit is contained in:
Yoni Gottesman
2024-11-05 17:10:15 +02:00
committed by GitHub
parent 74d3824cc0
commit 082e57e0d4
8 changed files with 129 additions and 1 deletions

View File

@@ -2497,3 +2497,7 @@ class LayoutLMv2TokenizationTest(TokenizerTesterMixin, unittest.TestCase):
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask(self):
pass
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask_truncated(self):
pass

View File

@@ -2450,3 +2450,7 @@ class LayoutLMv3TokenizationTest(TokenizerTesterMixin, unittest.TestCase):
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask(self):
pass
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask_truncated(self):
pass

View File

@@ -1991,3 +1991,7 @@ class LayoutXLMTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask(self):
pass
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask_truncated(self):
pass

View File

@@ -2330,3 +2330,7 @@ class MarkupLMTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask(self):
pass
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask_truncated(self):
pass

View File

@@ -1290,3 +1290,7 @@ class TapasTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask(self):
pass
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask_truncated(self):
pass

View File

@@ -1161,6 +1161,10 @@ class UdopTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
def test_chat_template_return_assistant_tokens_mask(self):
pass
@unittest.skip("Chat is not supported")
def test_chat_template_return_assistant_tokens_mask_truncated(self):
pass
@unittest.skip(reason="Chat template tests don't play well with table/layout models.")
def test_chat_template_batched(self):
pass