Skip to content

Commit

Permalink
Activate CFG test for VLLM integration
Browse files Browse the repository at this point in the history
  • Loading branch information
miftahmoha committed Apr 11, 2024
1 parent 274e2f3 commit 778b581
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion outlines/generate/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

from outlines.fsm.guide import CFGGuide
from outlines.generate.api import SequenceGenerator, SequenceGeneratorAdapter
from outlines.integrations.vllm import CFGLogitsProcessor
from outlines.models import OpenAI
from outlines.models.llamacpp import LlamaCpp
from outlines.models.vllm import VLLM
from outlines.samplers import Sampler, multinomial
from outlines.integrations.vllm import CFGLogitsProcessor


@singledispatch
def cfg(model, cfg_str: str, sampler: Sampler = multinomial()) -> SequenceGenerator:
Expand Down
3 changes: 0 additions & 3 deletions tests/generate/test_integration_vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ def test_vllm_json_schema(model):
assert isinstance(result["bar"], str)


@pytest.mark.xfail(
reason="The CFG logits processor for vLLM has not been implemented yet."
)
def test_vllm_cfg(model):
prompt = "<|im_start|>user\nOutput a short and valid JSON object with two keys.<|im_end|>\n><|im_start|>assistant\n"
result = generate.cfg(model, grammars.arithmetic)(prompt, seed=11)
Expand Down

0 comments on commit 778b581

Please sign in to comment.