Skip to content

Commit

Permalink
add new OpenAI model names (#7297)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Mar 4, 2024
1 parent 5b59fcb commit d03d5b5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions haystack/nodes/retriever/dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -1895,9 +1895,14 @@ def _preprocess_documents(self, docs: List[Document]) -> List[Document]:
@staticmethod
def _infer_model_format(model_name_or_path: str, use_auth_token: Optional[Union[str, bool]]) -> str:
# pylint: disable=too-many-return-statements
valid_openai_model_name = model_name_or_path in ["ada", "babbage", "davinci", "curie"] or any(
m in model_name_or_path for m in ["-ada-", "-babbage-", "-davinci-", "-curie-"]
)
valid_openai_model_name = model_name_or_path in [
"ada",
"babbage",
"davinci",
"curie",
"text-embedding-3-small",
"text-embedding-3-large",
] or any(m in model_name_or_path for m in ["-ada-", "-babbage-", "-davinci-", "-curie-"])
if valid_openai_model_name:
return "openai"
if model_name_or_path in COHERE_EMBEDDING_MODELS:
Expand Down

0 comments on commit d03d5b5

Please sign in to comment.