Skip to content

Commit

Permalink
use model_name in embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
seehi committed May 24, 2024
1 parent db26406 commit 5f1ca3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions metagpt/rag/factories/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def _create_ollama(self) -> OllamaEmbedding:
return OllamaEmbedding(**params)

def _try_set_model_and_batch_size(self, params: dict):
"""Set the model and embed_batch_size only when they are specified."""
"""Set the model_name and embed_batch_size only when they are specified."""
if config.embedding.model:
params["model"] = config.embedding.model
params["model_name"] = config.embedding.model

if config.embedding.embed_batch_size:
params["embed_batch_size"] = config.embedding.embed_batch_size
Expand Down
2 changes: 1 addition & 1 deletion tests/metagpt/rag/factories/test_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_get_rag_embedding_default(self, mocker, mock_config):

@pytest.mark.parametrize(
"model, embed_batch_size, expected_params",
[("test_model", 100, {"model": "test_model", "embed_batch_size": 100}), (None, None, {})],
[("test_model", 100, {"model_name": "test_model", "embed_batch_size": 100}), (None, None, {})],
)
def test_try_set_model_and_batch_size(self, mock_config, model, embed_batch_size, expected_params):
# Mock
Expand Down

0 comments on commit 5f1ca3c

Please sign in to comment.