MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / count_tokens

Function count_tokens

codewiki/src/be/utils.py:53–59  ·  view source on GitHub ↗

Count the number of tokens in a text.

(text: str)

Source from the content-addressed store, hash-verified

51 result = len(files) > 1
52
53 return result
54
55
56# ------------------------------------------------------------
57# ---------------------- Token Counting ---------------------
58# ------------------------------------------------------------
59
60enc = tiktoken.encoding_for_model("gpt-4")
61
62

Callers 4

cluster_modulesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected