From 4a522ab6d92d00a8375cdabf4469b25733a2868d Mon Sep 17 00:00:00 2001 From: Maarten Grootendorst Date: Mon, 25 Mar 2024 11:55:35 +0100 Subject: [PATCH] Fix #1856 by assigning param to attribute (#1870) --- bertopic/representation/_textgeneration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bertopic/representation/_textgeneration.py b/bertopic/representation/_textgeneration.py index 87e0a367..f2620e89 100644 --- a/bertopic/representation/_textgeneration.py +++ b/bertopic/representation/_textgeneration.py @@ -91,6 +91,7 @@ def __init__(self, doc_length: int = None, tokenizer: Union[str, Callable] = None ): + self.random_state = random_state set_seed(random_state) if isinstance(model, str): self.model = pipeline("text-generation", model=model)