Skip to content

Commit

Permalink
fix azure model support and scores in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-risch committed Dec 28, 2023
1 parent 5ad8ecf commit 0739c48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions e2e/pipelines/test_pipeline_topologies.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,7 @@ def test_join_with_rrf(docs):
results = p.run(query=query)

# list of precalculated expected results
expected_scores = [
0.03278688524590164,
0.03200204813108039,
0.03200204813108039,
0.031009615384615385,
0.031009615384615385,
]
expected_scores = [1.0, 0.9684979838709676, 0.9684979838709676, 0.9533577533577533, 0.9533577533577533]
assert all(
doc.score == pytest.approx(expected_scores[idx], abs=1e-3) for idx, doc in enumerate(results["documents"])
)
2 changes: 1 addition & 1 deletion haystack/nodes/prompt/invocation_layer/azure_open_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def supports(cls, model_name_or_path: str, **kwargs) -> bool:
Ensures Azure OpenAI Invocation Layer is selected when `azure_base_url` and `azure_deployment_name` are provided in
addition to a list of supported models.
"""
valid_model = model_name_or_path in ["ada", "babbage", "davinci", "curie"] or any(
valid_model = model_name_or_path in ["ada", "babbage", "davinci", "curie", "gpt-3.5-turbo-instruct"] or any(
m in model_name_or_path for m in ["-ada-", "-babbage-", "-davinci-", "-curie-"]
)
return valid_model and has_azure_parameters(**kwargs)

0 comments on commit 0739c48

Please sign in to comment.