Created
July 7, 2025 17:56
-
-
Save dyigitpolat/20f7d1c1930301f20f72f306a83447b6 to your computer and use it in GitHub Desktop.
rough token count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def estimate_token_count(text): | |
return int(len(text.split()) * 1.33 + len(text) * 0.25) * 0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment