From 2d8cf5d80d42748e88f82e5c5db569e99cc626a3 Mon Sep 17 00:00:00 2001 From: davidmezzetti <561939+davidmezzetti@users.noreply.github.com> Date: Mon, 6 Jan 2025 20:33:44 -0500 Subject: [PATCH] Add vectors argument to Model2Vec vectors, closes #846 --- src/python/txtai/vectors/m2v.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/python/txtai/vectors/m2v.py b/src/python/txtai/vectors/m2v.py index a6b435690..f46903d00 100644 --- a/src/python/txtai/vectors/m2v.py +++ b/src/python/txtai/vectors/m2v.py @@ -59,4 +59,8 @@ def loadmodel(self, path): return StaticModel.from_pretrained(path) def encode(self, data): - return self.model.encode(data, batch_size=self.encodebatch) + # Additional model arguments + modelargs = self.config.get("vectors", {}) + + # Encode data + return self.model.encode(data, batch_size=self.encodebatch, **modelargs)