Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lapp authored and lapp0 committed May 17, 2024
1 parent e3045d1 commit 4e84812
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tests/generate/test_integration_llamacpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,22 @@ def test_llamacpp_cfg(model):


@pytest.mark.parametrize(
"repo,model_path",
"repo,model_path,hf_tokenizer_uri",
[
("Qwen/Qwen1.5-0.5B-Chat-GGUF", "*q2*.gguf"),
("QuantFactory/Meta-Llama-3-8B-Instruct-GGUF", "*Q2*.gguf"),
("TheBloke/phi-2-GGUF", "*Q2*.gguf"),
("QuantFactory/Phi-3-mini-4k-instruct-GGUF-v2", "*Q2*.gguf"),
("Qwen/Qwen1.5-0.5B-Chat-GGUF", "*q2*.gguf", "Qwen/Qwen1.5-0.5B-Chat"),
("TheBloke/phi-2-GGUF", "*Q2*.gguf", "microsoft/phi-2"),
],
)
def test_byte_tokenizer_regression(repo, model_path):
def test_byte_tokenizer_regression(repo, model_path, hf_tokenizer_uri):
"""Reproduce https://github.com/outlines-dev/outlines/issues/820"""
model = models.llamacpp(repo, model_path)
import llama_cpp

model = models.llamacpp(
repo,
model_path,
tokenizer=llama_cpp.llama_tokenizer.LlamaHFTokenizer.from_pretrained(
hf_tokenizer_uri
),
)
generator = generate.choice(model, ["skirt", "dress", "pen", "jacket"])
generator("Pick the odd word out: skirt, dress, pen, jacket")

0 comments on commit 4e84812

Please sign in to comment.