Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Name the encoding when the offload test reads llama.py (#10039)

Daniel Handa3c85c05f99
diff --git a/tests/test_offload_frozen_module_device.py b/tests/test_offload_frozen_module_device.py
index de263f38231..068c8dd60f0 100644
--- a/tests/test_offload_frozen_module_device.py
+++ b/tests/test_offload_frozen_module_device.py
@@ -37,7 +37,7 @@ def _load_helper():
import pathlib
root = pathlib.Path(__file__).resolve().parents[1]
- src = (root / "unsloth" / "models" / "llama.py").read_text()
+ src = (root / "unsloth" / "models" / "llama.py").read_text(encoding = "utf-8")
tree = ast.parse(src)
fn = next(
node
@@ -251,7 +251,7 @@ def test_the_continued_pretraining_call_sites_pass_the_recorded_device():
import pathlib
root = pathlib.Path(__file__).resolve().parents[1]
- tree = ast.parse((root / "unsloth" / "models" / "llama.py").read_text())
+ tree = ast.parse((root / "unsloth" / "models" / "llama.py").read_text(encoding = "utf-8"))
checked = 0
for node in ast.walk(tree):