Spaces:
Runtime error
Runtime error
kevinlu1248
commited on
Commit
•
7ebf53a
1
Parent(s):
5f60ee6
init
Browse files
app.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import anthropic
|
3 |
+
|
4 |
+
text = st.text_area("Enter some text to tokenize using Anthropic's tokenizer: ", height=300)
|
5 |
+
if text:
|
6 |
+
num_tokens = anthropic.count_tokens(text)
|
7 |
+
f"Number of tokens: {num_tokens}"
|