Skip to content

Commit

Permalink
Adjust two cross-tests for changes in HF transformers (#367)
Browse files Browse the repository at this point in the history
* Fix `test_rotary_embeddings_against_hf` for latest transformers

* xfail test because HfFileSystem is currently broken
  • Loading branch information
danieldk committed Apr 2, 2024
1 parent afbdf60 commit 2d4dfef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion curated_transformers/tests/layers/test_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def test_rotary_embeddings_against_hf(device):

X = torch.rand(16, 12, 64, 768, device=device)
Y = re(X)
hf_re_cos, hf_re_sin = hf_re(X, seq_len=X.shape[-2])
positions = torch.arange(X.shape[2], device=device).view([1, -1])
hf_re_cos, hf_re_sin = hf_re(X, positions)
Y_hf = hf_re_cos * X + hf_re_sin * rotate_half(X)

torch_assertclose(Y, Y_hf)
Expand Down
1 change: 1 addition & 0 deletions curated_transformers/tests/tokenizers/test_hf_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_from_hf_hub_to_cache_legacy():
)


@pytest.mark.xfail(reason="HfFileSystem calls safetensors with incorrect arguments")
@pytest.mark.skipif(not has_hf_transformers, reason="requires huggingface transformers")
def test_fsspec(sample_texts):
# We only test one model, since using fsspec downloads the model
Expand Down

0 comments on commit 2d4dfef

Please sign in to comment.