Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
penguine-ip committed Jan 29, 2025
1 parent 106dad9 commit b8e3da5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions deepeval/models/openai_embedding_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,8 @@ def load_model(self):
self.model_name = KEY_FILE_HANDLER.fetch_data(
KeyValues.LOCAL_EMBEDDING_MODEL_NAME
)
if self.should_use_local_ollama():
return OpenAI(
base_url=base_url,
api_key=api_key
)
if self.should_use_local_ollama():
return OpenAI(base_url=base_url, api_key=api_key)
else:
return OpenAIEmbeddings(
model=self.model_name,
Expand Down Expand Up @@ -141,11 +138,11 @@ def should_use_local_ollama(self):
KeyValues.LOCAL_EMBEDDING_BASE_URL
)
return base_url == "http://localhost:11434/v1/"

def get_model_name(self):
if self.should_use_azure_openai():
return "azure openai"
elif self.should_use_local_embeddings():
return "local embeddings"
elif self.model_name:
return self.model_name
return self.model_name

0 comments on commit b8e3da5

Please sign in to comment.