Skip to content

Commit

Permalink
Outline support added
Browse files Browse the repository at this point in the history
  • Loading branch information
staru09 committed Nov 13, 2024
1 parent 1642624 commit 99fc20b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion docetl/operations/cpp_outlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def __init__(self, *args, **kwargs):
verbose=False
)

# Initialize the processor based on output schema
output_model = BaseModel.model_validate(self.config["output_schema"])
self.processor = generate.json(
self.model,
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cpp_outlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_syntax_check(sample_config):
with patch('llama_cpp.llama_tokenizer.LlamaHFTokenizer.from_pretrained'), \
patch('outlines.models.llamacpp'):
operation = LlamaCppMapOperation(sample_config)
operation.syntax_check() # Should not raise error
operation.syntax_check()

@pytest.mark.parametrize("missing_field", [
"model_path",
Expand Down Expand Up @@ -126,7 +126,6 @@ def test_batch_processing(sample_config, sample_input_data):
operation = LlamaCppMapOperation(sample_config)
operation.process_item = Mock(return_value={"processed": True})

# Test with different batch sizes
sample_config["batch_size"] = 1
results1, _ = operation.execute(sample_input_data)
assert len(results1) == len(sample_input_data)
Expand Down

0 comments on commit 99fc20b

Please sign in to comment.