pass in direction
This commit is contained in:
@@ -15,7 +15,7 @@ class QwenEmbeddings(Embeddings):
|
|||||||
model: str = "text-embedding-v4",
|
model: str = "text-embedding-v4",
|
||||||
max_workers: int = 5,
|
max_workers: int = 5,
|
||||||
embedding_dimension: int = 512,
|
embedding_dimension: int = 512,
|
||||||
batch_size: int = 10, # DashScope supports up to 10 texts per batch
|
batch_size: int = 10, # NOTE: DashScope supports up to 10 texts per batch
|
||||||
rate_limit_delay: float = 0.00001):
|
rate_limit_delay: float = 0.00001):
|
||||||
"""
|
"""
|
||||||
Initialize Qwen embeddings
|
Initialize Qwen embeddings
|
||||||
@@ -45,7 +45,8 @@ class QwenEmbeddings(Embeddings):
|
|||||||
# DashScope supports batch processing natively
|
# DashScope supports batch processing natively
|
||||||
response = TextEmbedding.call(
|
response = TextEmbedding.call(
|
||||||
model=self.model,
|
model=self.model,
|
||||||
input=texts # Pass list directly
|
input=texts, # Pass list directly
|
||||||
|
dimension=self.embedding_dimension
|
||||||
)
|
)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
|
|||||||
Reference in New Issue
Block a user