From bf36eaf88f1f98c6eaa43048eb729f1d5e1f2026 Mon Sep 17 00:00:00 2001 From: "Lin, Fanli" Date: Mon, 8 Apr 2024 02:03:05 -0700 Subject: [PATCH 1/3] add bnb flag --- tests/models/persimmon/test_modeling_persimmon.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/models/persimmon/test_modeling_persimmon.py b/tests/models/persimmon/test_modeling_persimmon.py index 79cee8a64863cb..35d5801a42a024 100644 --- a/tests/models/persimmon/test_modeling_persimmon.py +++ b/tests/models/persimmon/test_modeling_persimmon.py @@ -23,6 +23,7 @@ from transformers import PersimmonConfig, is_torch_available, set_seed from transformers.testing_utils import ( backend_empty_cache, + require_bitsandbytes, require_torch, require_torch_accelerator, require_torch_fp16, @@ -463,6 +464,7 @@ def test_model_rope_scaling(self): @require_torch +@require_bitsandbytes class PersimmonIntegrationTest(unittest.TestCase): @slow def test_model_8b_chat_logits(self): @@ -492,6 +494,7 @@ def test_model_8b_chat_logits(self): @slow @require_torch_accelerator @require_torch_fp16 + @require_bitsandbytes def test_model_8b_chat_greedy_generation(self): EXPECTED_TEXT_COMPLETION = """human: Simply put, the theory of relativity states that?\n\nadept: The theory of relativity states that the laws of physics are the same for all observers, regardless of their relative motion.""" prompt = "human: Simply put, the theory of relativity states that?\n\nadept:" From 4417ece7bb22e6dc60a127a3d58d475fefed33c6 Mon Sep 17 00:00:00 2001 From: "Lin, Fanli" Date: Mon, 8 Apr 2024 02:13:22 -0700 Subject: [PATCH 2/3] move maker --- tests/models/persimmon/test_modeling_persimmon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/models/persimmon/test_modeling_persimmon.py b/tests/models/persimmon/test_modeling_persimmon.py index 35d5801a42a024..d3eb4bbeb3ffd5 100644 --- a/tests/models/persimmon/test_modeling_persimmon.py +++ b/tests/models/persimmon/test_modeling_persimmon.py @@ -464,9 +464,9 @@ def test_model_rope_scaling(self): @require_torch -@require_bitsandbytes class PersimmonIntegrationTest(unittest.TestCase): @slow + @require_bitsandbytes def test_model_8b_chat_logits(self): input_ids = [1, 306, 4658, 278, 6593, 310, 2834, 338] model = PersimmonForCausalLM.from_pretrained( From 016ef075fa2356c37fdeed7ad574fbff63fecc3b Mon Sep 17 00:00:00 2001 From: "Lin, Fanli" Date: Mon, 8 Apr 2024 02:15:13 -0700 Subject: [PATCH 3/3] add accelerator maker --- tests/models/persimmon/test_modeling_persimmon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/models/persimmon/test_modeling_persimmon.py b/tests/models/persimmon/test_modeling_persimmon.py index d3eb4bbeb3ffd5..86a69d774f1681 100644 --- a/tests/models/persimmon/test_modeling_persimmon.py +++ b/tests/models/persimmon/test_modeling_persimmon.py @@ -466,6 +466,7 @@ def test_model_rope_scaling(self): @require_torch class PersimmonIntegrationTest(unittest.TestCase): @slow + @require_torch_accelerator @require_bitsandbytes def test_model_8b_chat_logits(self): input_ids = [1, 306, 4658, 278, 6593, 310, 2834, 338]