Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,8 @@ encodings = tiktoken.list_encoding_names()
|
|
5 |
encodings.reverse()
|
6 |
|
7 |
def function(input, encoding):
|
8 |
-
|
|
|
9 |
return len(tokens)
|
10 |
|
11 |
value1 = gr.Textbox(lines=6, label="Input", placeholder="Input the text...")
|
|
|
5 |
encodings.reverse()
|
6 |
|
7 |
def function(input, encoding):
|
8 |
+
tokenizer = tiktoken.get_encoding(encoding)
|
9 |
+
tokens = tokenizer.encode(input)
|
10 |
return len(tokens)
|
11 |
|
12 |
value1 = gr.Textbox(lines=6, label="Input", placeholder="Input the text...")
|