@@ -465,6 +466,8 @@ class PersimmonModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTester
...
@@ -465,6 +466,8 @@ class PersimmonModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTester
@require_torch
@require_torch
classPersimmonIntegrationTest(unittest.TestCase):
classPersimmonIntegrationTest(unittest.TestCase):
@slow
@slow
@require_torch_accelerator
@require_bitsandbytes
deftest_model_8b_chat_logits(self):
deftest_model_8b_chat_logits(self):
input_ids=[1,306,4658,278,6593,310,2834,338]
input_ids=[1,306,4658,278,6593,310,2834,338]
model=PersimmonForCausalLM.from_pretrained(
model=PersimmonForCausalLM.from_pretrained(
...
@@ -492,6 +495,7 @@ class PersimmonIntegrationTest(unittest.TestCase):
...
@@ -492,6 +495,7 @@ class PersimmonIntegrationTest(unittest.TestCase):
@slow
@slow
@require_torch_accelerator
@require_torch_accelerator
@require_torch_fp16
@require_torch_fp16
@require_bitsandbytes
deftest_model_8b_chat_greedy_generation(self):
deftest_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."""
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:"
prompt="human: Simply put, the theory of relativity states that?\n\nadept:"