"src/vscode:/vscode.git/clone" did not exist on "b7ca02c7b339b18333d77caf08e356b69e9cde11"
Unverified Commit d16f0abc authored by Fanli Lin's avatar Fanli Lin Committed by GitHub
Browse files

[tests] add `require_bitsandbytes` marker (#30116)

* add bnb flag

* move maker

* add accelerator maker
parent 5e673ed2
......@@ -23,6 +23,7 @@ from parameterized import parameterized
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,
......@@ -465,6 +466,8 @@ class PersimmonModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTester
@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]
model = PersimmonForCausalLM.from_pretrained(
......@@ -492,6 +495,7 @@ class PersimmonIntegrationTest(unittest.TestCase):
@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:"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment