fdemelo commited on
Commit
a15cf60
·
verified ·
1 Parent(s): d24f008

Re-export wakehubert-tiny (loom-exporter 5790c6a)

Browse files
README.md CHANGED
@@ -43,7 +43,7 @@ the others are quantized from them (see Files).
43
  Run it with [loom-py](https://github.com/loom-ai-org/loom-py) -- `loom-py-rt` on PyPI:
44
 
45
  ```sh
46
- pip install -U "loom-py-rt[hub]"
47
  ```
48
 
49
  ```python
@@ -64,6 +64,18 @@ for start, row in zip(features.times[:3], features.rows[:3]):
64
  # on a window of these rows, and its decision rule is yours.
65
  ```
66
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  ### The layer underneath
68
 
69
  The call above is the high-level door: one per task, named for the modality pair it maps between, with
@@ -79,7 +91,7 @@ accepts for this model, and is the authority on it. See [loom-py](https://github
79
 
80
  **Needs loom 1.0.0-rc15 or later.** This file's embeddings are per FRAME: `model.speech2embeddings.infer(audio)` returns a `FrameEmbeddings` (`rows`, `times`, `dim`, `frame_rate`), cut by the width the file declares. rc14 and earlier refuse the file at that door with an error naming the granularity; there, `model.infer(waveform=audio)` returns the same frames as one flat row-major list, 128 values per frame.
81
 
82
- **One call is one whole clip, offline.** The model is strictly causal -- frame *t* depends only on audio before sample 320 x (t + 1), within a 2.5 s receptive field -- and it was trained to describe each HuBERT frame 100 ms late, so a detector built on it reacts about that long after the word ends. To stream it, call it on a sliding buffer that keeps 40,000 samples (2.5 s) of context and take the newest frames: those then equal the offline ones. A clip shorter than 320 samples gives no frames. Audio must be mono 16 kHz.
83
 
84
  **Every precision keeps the front end in F32.** The log-mel's DFT basis is the one weight this model cannot spare precision in: at F16 its rounding in the near-empty high bins of a loud frame is amplified by the log, which took the worst frame to cosine 0.976 before the basis was exempted. Upstream's own int8 file keeps its front end in float too.
85
 
 
43
  Run it with [loom-py](https://github.com/loom-ai-org/loom-py) -- `loom-py-rt` on PyPI:
44
 
45
  ```sh
46
+ pip install -U "loom-py-rt[hub]>=1.0.0"
47
  ```
48
 
49
  ```python
 
64
  # on a window of these rows, and its decision rule is yours.
65
  ```
66
 
67
+ ### Streaming
68
+
69
+ ```python
70
+ # Live: push audio as it arrives -- here a second at a time -- and read each frame's answer once its audio
71
+ # is in. The rows of every push joined are what one `infer` over the whole audio returns.
72
+ stream = model.speech2embeddings.stream()
73
+ step = 16000 # one second of audio
74
+ answers = [stream.push(audio[start:start + step]) for start in range(0, len(audio), step)]
75
+ answers.append(stream.finish())
76
+ print(sum(len(answer) for answer in answers), "rows,", stream.frame_rate, "per second")
77
+ ```
78
+
79
  ### The layer underneath
80
 
81
  The call above is the high-level door: one per task, named for the modality pair it maps between, with
 
91
 
92
  **Needs loom 1.0.0-rc15 or later.** This file's embeddings are per FRAME: `model.speech2embeddings.infer(audio)` returns a `FrameEmbeddings` (`rows`, `times`, `dim`, `frame_rate`), cut by the width the file declares. rc14 and earlier refuse the file at that door with an error naming the granularity; there, `model.infer(waveform=audio)` returns the same frames as one flat row-major list, 128 values per frame.
93
 
94
+ **`infer` is one whole clip; `stream()` is live.** The model is strictly causal -- frame *t* depends only on audio before sample 320 x (t + 1), within a 2.5 s receptive field -- and it was trained to describe each HuBERT frame 100 ms late, so a detector built on it reacts about that long after the word ends. `speech2embeddings.stream()` runs the one-pass graph over the last 122 frames (2.44 s) per push, as upstream advises (loom.cpp ADR-120): each frame's row as soon as its 320 samples are in, within 4.8e-06 of one call's. A clip shorter than 320 samples gives no frames. Audio must be mono 16 kHz.
95
 
96
  **Every precision keeps the front end in F32.** The log-mel's DFT basis is the one weight this model cannot spare precision in: at F16 its rounding in the near-empty high bins of a loud frame is amplified by the log, which took the worst frame to cosine 0.976 before the basis was exempted. Upstream's own int8 file keeps its front end in float too.
97
 
wakehubert-tiny-f16.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4b72969f17801569101c3fd6a5e4fbbc1aa36d0473b7dca185eede81398f029c
3
- size 1995264
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21139447ea4f01d2707321d15964cbbbac2ea516f910b6271b2e2f55bd0afe93
3
+ size 2001056
wakehubert-tiny-f32.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:366a4763e3282c079b09e937aade3d3ded05c672a667ec683637c54e9dd1f8d5
3
- size 3260928
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b3fa961b6751e78a0f4a55c0044c3434c29caacf7c1df2596bb8a0745e49bbf
3
+ size 3266720
wakehubert-tiny-q4_1.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fd0d17d7181196b45c1851e5f5c4099f5a0a870be06f54778c2cd9eee87f2bdf
3
- size 1159936
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d4885ba8300751bc029b601dc3264b3b4434b0b3cc843870f9e9ace939c6a49
3
+ size 1165728
wakehubert-tiny-q8_0.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:52b851f5a696b08b265275a02d2492fb03ef740522ba346854d51c7b60a855fa
3
- size 1432320
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0d664d0a62822d0784235b5e05bf839c009511edfa80a26f966af0a55efae734
3
+ size 1438112