From f02c4bdef843db5f22a1cbfc105f4e3c7273f6ac Mon Sep 17 00:00:00 2001 From: Marton Kardos Date: Fri, 10 Apr 2026 13:46:22 +0200 Subject: [PATCH 1/2] Fixed token encoding for GPUs --- turftopic/late.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/turftopic/late.py b/turftopic/late.py index cb140d6..40e13c5 100644 --- a/turftopic/late.py +++ b/turftopic/late.py @@ -63,6 +63,9 @@ def _encode_tokens( ): batch = texts[start_index : start_index + batch_size] features = self.tokenize(batch) + features = { + key: value.to(self.device) for key, value in features.items() + } with torch.no_grad(): output_features = self.forward(features) n_tokens = output_features["attention_mask"].sum(axis=1) From d2b4ce64841fd3ce11126408074e5548b69d7d4b Mon Sep 17 00:00:00 2001 From: Marton Kardos Date: Fri, 10 Apr 2026 13:47:11 +0200 Subject: [PATCH 2/2] Version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3a0d1fc..069aadb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ profile = "black" [project] name = "turftopic" -version = "0.25.0" +version = "0.25.1" description = "Topic modeling with contextual representations from sentence transformers." authors = [ { name = "Márton Kardos ", email = "martonkardos@cas.au.dk" }