Skip to content

Commit

Permalink
test with outfile parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran committed Apr 26, 2024
1 parent b57c38b commit e273bde
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_mock_run_quantize(m_check_output: mock.Mock):
sys.platform != "darwin" and platform.machine() != "arm64",
reason="binary is Apple M1-only",
)
def test_run_quantize():
def test_run_quantize(tmp_path: pathlib.Path):
with pytest.raises(subprocess.CalledProcessError) as exc_info:
instructlab_quantize.run_quantize("--help", stderr=subprocess.STDOUT, text=True)

Expand All @@ -43,7 +43,10 @@ def test_run_quantize():
assert exc.returncode == 1

quant_type = "Q4_K_M"
outfile = tmp_path / "ggml-vocab-{quant_type}.gguf"
instructlab_quantize.run_quantize(
"llama.cpp/models/ggml-vocab-llama.gguf", quant_type
"llama.cpp/models/ggml-vocab-llama.gguf",
os.fspath(outfile),
quant_type,
)
assert os.path.isfile(f"llama.cpp/models/ggml-model-{quant_type}.gguf")
assert outfile.is_file()

0 comments on commit e273bde

Please sign in to comment.