From e49c437551c6125e9085482576cab01691f26114 Mon Sep 17 00:00:00 2001 From: Wang Bo Date: Mon, 16 Sep 2024 17:04:10 +0200 Subject: [PATCH 1/2] refactor: rename task_type to task for jina embeddings v3 --- .../model_providers/jina/text_embedding/text_embedding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py b/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py index 5033f0f748a396..53979e04c428bd 100644 --- a/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py +++ b/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py @@ -57,7 +57,7 @@ def transform_jina_input_text(model, text): data = {"model": model, "input": [transform_jina_input_text(model, text) for text in texts]} if model == "jina-embeddings-v3": - data["task_type"] = "retrieval.passage" + data["task"] = "retrieval.passage" try: response = post(url, headers=headers, data=dumps(data)) From 142c5db4bd96090fbd5ef9b638c4109116a694bb Mon Sep 17 00:00:00 2001 From: Wang Bo Date: Tue, 17 Sep 2024 09:34:35 +0200 Subject: [PATCH 2/2] refactor: set default task type to text matching --- .../model_providers/jina/text_embedding/text_embedding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py b/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py index 53979e04c428bd..ceb79567d54ca2 100644 --- a/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py +++ b/api/core/model_runtime/model_providers/jina/text_embedding/text_embedding.py @@ -57,7 +57,7 @@ def transform_jina_input_text(model, text): data = {"model": model, "input": [transform_jina_input_text(model, text) for text in texts]} if model == "jina-embeddings-v3": - data["task"] = "retrieval.passage" + data["task"] = "text-matching" try: response = post(url, headers=headers, data=dumps(data))