Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StableLM #28810

Merged
merged 11 commits into from
Feb 14, 2024
Prev Previous commit
Next Next commit
fix(tests): re-add @slow decorator to integration tests
  • Loading branch information
jon-tow committed Feb 13, 2024
commit fe0a498be2260dc00d113861301b49144dee3d97
6 changes: 3 additions & 3 deletions tests/models/stablelm/test_modeling_stablelm.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def test_model_rope_scaling(self, scaling_type):

@require_torch
class StableLmModelIntegrationTest(unittest.TestCase):
# @slow
@slow
def test_model_stablelm_3b_4e1t_logits(self):
input_ids = {"input_ids": torch.tensor([[510, 8588, 310, 1900, 9386]], dtype=torch.long, device=torch_device)}

Expand All @@ -399,7 +399,7 @@ def test_model_stablelm_3b_4e1t_logits(self):
EXPECTED_SLICE = torch.tensor([7.1030, -1.4195, 9.9206, 7.7008, 4.9891, 4.2169, 5.5426, 3.7878, 6.7593, 5.7360, 8.4691, 5.5448, 5.0544, 10.4129, 8.5573, 13.0405, 7.3265, 3.5868, 6.1106, 5.9406, 5.6376, 5.7490, 5.4850, 4.8124, 5.1991, 4.6419, 4.5719, 9.9588, 6.7222, 4.5070]).to(torch_device) # fmt: skip
self.assertTrue(torch.allclose(output[0, 0, :30], EXPECTED_SLICE, atol=1e-4, rtol=1e-4))

# @slow
@slow
def test_model_stablelm_3b_4e1t_generation(self):
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-3b-4e1t")
model = StableLmForCausalLM.from_pretrained("stabilityai/stablelm-3b-4e1t")
Expand All @@ -415,7 +415,7 @@ def test_model_stablelm_3b_4e1t_generation(self):
self.assertEqual(text, EXPECTED_TEXT_COMPLETION)

@require_bitsandbytes
# @slow
@slow
@require_flash_attn
def test_model_3b_long_prompt(self):
EXPECTED_OUTPUT_TOKEN_IDS = [3, 3, 3]
Expand Down