Buckets:

Hooshaai/RL_AEGIS / tests /test_device.py
tahamajs's picture
download
raw
807 Bytes
"""Device-resolution regressions for local and GPU execution paths."""
import pytest
import torch
from aegis.configs.dataclasses import EvidenceConfig
from aegis.models.nli_model import NliModel
from aegis.utils.device import get_device
def test_cpu_device_is_always_explicitly_resolvable():
assert get_device("cpu") == torch.device("cpu")
def test_nli_model_honors_evidence_device_config():
model = NliModel(EvidenceConfig(device="cpu", is_mock=True))
assert model.device == torch.device("cpu")
def test_cuda_request_fails_clearly_when_unavailable():
if torch.cuda.is_available():
pytest.skip("CUDA is available; the unavailable-device guard is not applicable")
with pytest.raises(RuntimeError, match="CUDA was requested but is unavailable"):
get_device("cuda")

Xet Storage Details

Size:
807 Bytes
·
Xet hash:
a995b099c1a5b8043c1ee88a8c2c4aec937c15cea591ca672031db44fd945bda

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.