Instructions to use nikraf/directionality_probe with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nikraf/directionality_probe with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="nikraf/directionality_probe", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nikraf/directionality_probe", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 893 Bytes
714cf46 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | import pytest
try:
from modal_utils import parse_modal_api_key
except ImportError:
from ..modal_utils import parse_modal_api_key
def test_parse_modal_api_key_success() -> None:
token_id, token_secret = parse_modal_api_key("abc123:def456")
assert token_id == "abc123"
assert token_secret == "def456"
def test_parse_modal_api_key_strips_whitespace() -> None:
token_id, token_secret = parse_modal_api_key(" abc123 : def456 ")
assert token_id == "abc123"
assert token_secret == "def456"
def test_parse_modal_api_key_requires_separator() -> None:
with pytest.raises(AssertionError):
parse_modal_api_key("missing_separator")
def test_parse_modal_api_key_rejects_empty_parts() -> None:
with pytest.raises(AssertionError):
parse_modal_api_key(":secret")
with pytest.raises(AssertionError):
parse_modal_api_key("token:")
|