Skip to content

Commit

Permalink
style fixes by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitvj authored and github-actions[bot] committed Mar 24, 2024
1 parent b90a882 commit 14ca30d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/tests/quantize/quantize_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@
quantize_model,
)

root_path = Path(__file__).parent / 'test_data'
root_path = Path(__file__).parent / "test_data"
os.makedirs(root_path, exist_ok=True)


def test_get_llamacpp_repo():
get_llamacpp_repo(root_path)
repo_path = root_path / 'llama.cpp' / '.git'
repo_path = root_path / "llama.cpp" / ".git"
assert os.path.exists(repo_path)


def test_build_llamacpp():
building_llamacpp(root_path)
bin_path = root_path / 'llama.cpp' / 'quantize'
bin_path = root_path / "llama.cpp" / "quantize"
assert os.path.exists(bin_path)


def test_fetch_model_repo():
fetch_model_repo('meta-llama/Llama-2-7b-chat', root_path)
model_dir_path = root_path / 'llama.cpp' / 'models' / 'Llama-2-7b-chat'
fetch_model_repo("meta-llama/Llama-2-7b-chat", root_path)
model_dir_path = root_path / "llama.cpp" / "models" / "Llama-2-7b-chat"
assert os.path.exists(model_dir_path)


def test_quantize_model():
model_dir_path = root_path / 'llama.cpp' / 'models' / 'Llama-2-7b-chat'
quantize_model(model_dir_path, 'Q3_K_M', root_path, output_dir=model_dir_path.parent)
model_dir_path = root_path / "llama.cpp" / "models" / "Llama-2-7b-chat"
quantize_model(
model_dir_path, "Q3_K_M", root_path, output_dir=model_dir_path.parent
)
gguf_file_path = model_dir_path / "ggml-model-Q3_K_M.gguf"
assert os.path.exists(gguf_file_path)

0 comments on commit 14ca30d

Please sign in to comment.