You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are specific details that are useful when you want to contribute to the BPE crates.
4
+
Make sure to read the repository's [contribution guidelines][contributing] as well.
5
+
6
+
## Project structure
7
+
8
+
This project has a slightly unusual structure to resolve some dependency issues.
9
+
10
+
- This directory contains `bpe`, the BPE code itself.
11
+
- A sibling directory contains `bpe-openai`, which exposes tokenizers for OpenAI token sets, and depends on `bpe`.
12
+
- Tests are located in the `tests` subdirectory, and benchmarks in the `benchmarks` subdirectory. Both of these are separate crates so they can depend on `bpe-openai` without causing a cyclic dependency.
13
+
14
+
Only the `bpe` and `bpe-openai` crates are meant to be published. The other ones are for development use only.
15
+
16
+
## Running benchmarks
17
+
18
+
Change the working directory to the `benchmarks` directory:
19
+
20
+
```sh
21
+
cd benchmarks
22
+
```
23
+
24
+
Run the benchmark as follows (required [cargo-criterion](https://crates.io/crates/cargo-criterion) installed):
25
+
26
+
```sh
27
+
cargo criterion
28
+
```
29
+
30
+
(Using `cargo bench` ignores the settings in `criterion.toml`!)
31
+
Open the full report which should be located in `target/criterion/reports/index.html`.
32
+
33
+
Update the figures in this repo as follows (requires `rsvg-convert` from `librsvg` installed):
0 commit comments