We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e42bcb6 commit 9b7ef17Copy full SHA for 9b7ef17
graphgen/bases/base_llm_client.py
@@ -59,6 +59,8 @@ async def generate_inputs_prob(
59
60
def count_tokens(self, text: str) -> int:
61
"""Count the number of tokens in the text."""
62
+ if self.tokenizer is None:
63
+ raise ValueError("Tokenizer is not set. Please provide a tokenizer to use count_tokens.")
64
return len(self.tokenizer.encode(text))
65
66
@staticmethod
0 commit comments