TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Calculate the number of language model tokens for a string

17 pointsby waldekm3 months ago

1 comment

sva_3 months ago
<p><pre><code> import tiktoken enc = tiktoken.encoding_for_model(&#x27;o1-mini&#x27;) len(enc.encode(&#x27;some string&#x27;))</code></pre>
评论 #42948671 未加载