Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-4.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-4.0
|
| 3 |
---
|
| 4 |
+
# tokenspace directory
|
| 5 |
+
|
| 6 |
+
This directory contains utilities for the purpose of browsing the
|
| 7 |
+
"token space" of CLIP ViT-L/14
|
| 8 |
+
|
| 9 |
+
Long term goal is to be able to literally browse from word to
|
| 10 |
+
"nearby" word
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
## generate-embeddings.py
|
| 15 |
+
|
| 16 |
+
Generates the "embeddings.safetensor" file!
|
| 17 |
+
|
| 18 |
+
Basically goes through the fullword.json file, and
|
| 19 |
+
generates a standalone embedding object for each word.
|
| 20 |
+
Shape of the embeddings tensor, is
|
| 21 |
+
[number-of-words][768]
|
| 22 |
+
|
| 23 |
+
## fullword.json
|
| 24 |
+
|
| 25 |
+
This file contains a collection of "one word, one CLIP token id" pairings.
|
| 26 |
+
The file was taken from vocab.sdturbo.json
|
| 27 |
+
First all the non-</w> entries were stripped out.
|
| 28 |
+
Then all the garbage punctuation and foreign characters were stripped out.
|
| 29 |
+
Finally, the actual </w> was stripped out, for ease of use.
|