Skip to content

The best ChatGPT that $100 can buy.

Python

Fix MockModel's device definition (#535)

Sofie Van Landeghem4800c62f6ed5
diff --git a/tests/test_engine.py b/tests/test_engine.py
index 0159111..784ffcb 100644
--- a/tests/test_engine.py
+++ b/tests/test_engine.py
@@ -31,7 +31,7 @@ class MockModel:
def __init__(self, vocab_size=262): # 256 bytes + 6 special tokens
self.vocab_size = vocab_size
self.config = MockConfig()
- self._device = "cpu"
+ self._device = torch.device("cpu")
def get_device(self):
return self._device