Upload folder using huggingface_hub
Browse files- README.md +6 -6
- index.html +1 -0
- pika-jsonp.js +0 -0
- script.js +11 -0
README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
---
|
| 2 |
title: Tinybpe
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version: 6.8.0
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
title: Tinybpe
|
| 3 |
+
emoji: 😻
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: yellow
|
| 6 |
+
sdk: static
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
+
license: cc0-1.0
|
| 9 |
+
short_description: A very tiny codegolf toy greedy tokenizer
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
<html><head><script src="script.js"></script></head><body><p>tinybpe</p><input><button></button><script src="pika-jsonp.js"></script></body></html>
|
pika-jsonp.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
script.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
q=(x)=>document.querySelector(x)
|
| 2 |
+
function h(i){q("button").onclick=()=>{
|
| 3 |
+
v=Object.entries(i).sort((e,f)=>f[0].length-e[0].length).map(e=>[e[0].replace("Ġ"," "),e[1]])
|
| 4 |
+
s=q("input").value
|
| 5 |
+
t=[]
|
| 6 |
+
while(s){w=v.find(u=>s.startsWith(u[0]))
|
| 7 |
+
if(w){s=s.slice(w[0].length)
|
| 8 |
+
t.push(w[1])}
|
| 9 |
+
else{t.push(-1)
|
| 10 |
+
break}}
|
| 11 |
+
document.write(t)}}
|