Skip to content

Commit 9f53c44

Browse files
committed
Fixs to tidy integration tests
1 parent 6e1cacb commit 9f53c44

4 files changed

Lines changed: 178 additions & 252 deletions

File tree

deepfabric/llm/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ def make_outlines_model(provider: str, model_name: str, **kwargs) -> Any:
7979
if provider == "ollama":
8080
# Use OpenAI-compatible endpoint for Ollama
8181
base_url = kwargs.get("base_url", "http://localhost:11434/v1")
82+
client_kwargs = kwargs.copy()
83+
client_kwargs.pop("base_url", None)
8284
client = openai.OpenAI(
8385
base_url=base_url,
8486
api_key="ollama", # Dummy key for Ollama
85-
**{k: v for k, v in kwargs.items() if k != "base_url"},
87+
**client_kwargs,
8688
)
8789
return outlines.from_openai(client, model_name)
8890

@@ -93,10 +95,12 @@ def make_outlines_model(provider: str, model_name: str, **kwargs) -> Any:
9395
_raise_api_key_error("GITHUB_TOKEN or MODELS_TOKEN")
9496

9597
base_url = kwargs.get("base_url", "https://models.github.ai/inference")
98+
client_kwargs = kwargs.copy()
99+
client_kwargs.pop("base_url", None)
96100
client = openai.OpenAI(
97101
base_url=base_url,
98102
api_key=api_key,
99-
**{k: v for k, v in kwargs.items() if k != "base_url"},
103+
**client_kwargs,
100104
)
101105
return outlines.from_openai(client, model_name)
102106

tests/integration/fixtures/graph_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ dataset:
2828
creation:
2929
num_steps: 5
3030
batch_size: 2
31-
save_as: "test_dataset.jsonl"
31+
save_as: "test_dataset.jsonl"

0 commit comments

Comments
 (0)