File size: 227 Bytes
7ebf53a
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import streamlit as st
import anthropic

text = st.text_area("Enter some text to tokenize using Anthropic's tokenizer: ", height=300)
if text:
    num_tokens = anthropic.count_tokens(text)
    f"Number of tokens: {num_tokens}"