Skip to content

Commit

Permalink
rm onnxruntime, no longer used in 2+
Browse files Browse the repository at this point in the history
  • Loading branch information
sdan committed Apr 25, 2024
1 parent ddbf16b commit 4ae161f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ vlite uses the CTX (Context) file format for efficient storage and retrieval of

The CTX file format is designed to be memory-efficient and allows for fast loading and saving of embeddings and associated data.

| Section | Byte Size | Example |
|---------------|-------------|----------------------------------------------------------------------------------------------|
| Magic Number | 4 bytes | `b"CTXF"` |
| Version | 4 bytes | `1` which results in something like `b'\x01\x00\x00\x00'` |
| Header | Variable | JSON string of the header dict, encoded in UTF-8 and prefixed with its length in bytes. |
| | | Example JSON: `{"embedding_model": "default", "embedding_size": 64, "embedding_dtype": "float32", "context_length": 512}` |
| Embeddings | Variable | Each embedding is 64 dimensions of `float32`. 64 floats * 4 bytes each = 256 bytes. |
| | | An embedding example might look like a sequence of 256 bytes after packing. |
| Contexts | Variable | Prefixed with the length of the string in bytes followed by the string encoded in UTF-8. |
| | | Example: A context string with its length prefix. |
| Metadata | Variable | JSON string of the metadata dict, encoded in UTF-8 and prefixed with its length in bytes. |
| | | Example JSON: `{"created_at": "2024-04-18", ...}` |


### Creating a CTX File
To create a new CTX file, use the `create` method of the `Ctx` class:
```python
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Requests
beautifulsoup4
huggingface_hub
tiktoken
onnxruntime==1.17.1
tokenizers==0.15.2
tokenizers==0.15.2

0 comments on commit 4ae161f

Please sign in to comment.