Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update pooling mode check

davidmezzettid9d6a1cbb103
diff --git a/src/python/txtai/models/pooling/factory.py b/src/python/txtai/models/pooling/factory.py
index 2bfa8e1b..59cc777a 100644
--- a/src/python/txtai/models/pooling/factory.py
+++ b/src/python/txtai/models/pooling/factory.py
@@ -87,7 +87,7 @@ class PoolingFactory:
# Models trained with Sentence Transformers v5.4+ use `pooling_mode` parameter
# Support both the new and legacy parameters
- mode = config.get("pooling_mode")
+ mode = config.get("pooling_mode") if config else None
# Set to CLS pooling if it's enabled and mean pooling is disabled
if config and config.get("pooling_mode_cls_token", mode == "cls") and not config.get("pooling_mode_mean_tokens", mode == "mean"):