|
Download README.md from yujiepan/haru-tiny-random: direct link, hf CLI and curl.
- Browser
- Download file 2.87 kB
-
https://huggingface.co/yujiepan/haru-tiny-random/resolve/main/README.md
- Command line
-
hf download hf://yujiepan/haru-tiny-random/README.md
-
curl -L -o README.md https://huggingface.co/yujiepan/haru-tiny-random/resolve/main/README.md
2.87 kB
| library_name: haru | |
| pipeline_tag: audio-to-audio | |
| base_model: | |
| - higurashi-ai/Haru-4B | |
| This is a randomly initialized tiny model based on [higurashi-ai/Haru-4B](https://huggingface.co/higurashi-ai/Haru-4B) for testing and debugging. | |
| | Feature | Source | Tiny | | |
| |---|---|---| | |
| | Checkpoint tensor elements | 5.27B BF16 | 8.36M BF16 | | |
| | Safetensors weight files | 10.54 GB (model.safetensors) | 16.74 MB (model.safetensors) | | |
| | Language model | Qwen3.5-4B, 32 layers | Qwen3.5, 8 layers | | |
| | Attention cadence | 3 linear + 1 full | Same; two complete cycles | | |
| | Hidden / MLP width | 2,560 / 9,216 | 32 / 64 | | |
| | Q heads / KV heads / head dimension | 16 / 4 / 256 | 4 / 1 / 16 | | |
| | Vocabulary / tied embeddings | 248,320 / true | 248,320 / true | | |
| | Codec | VibeVoice, base 32, depths 3-8 | VibeVoice, base 1, depth 1 | | |
| | Audio latents | 64 dims at 7.5 Hz | 64 dims at 7.5 Hz | | |
| | MeanFlow head layers / steps | 4 / 1 | 1 / 1 | | |
| | File path | Size | | |
| |------|------| | |
| | model.safetensors | 16.7MB | | |
| ### Example usage | |
| #### Haru duplex session (✅ verified) | |
| Install with `pip install 'git+https://github.com/higurashi-ai/Haru#subdirectory=haru'`. Runs six 133 ms frames with a synthetic reference voice; only the language model's linear-attention layers need CUDA, the codec and head also run on CPU. | |
| ```python | |
| def run_haru(model_id: str) -> None: | |
| import numpy as np | |
| import torch | |
| from haru import DuplexConfig, DuplexSession, HaruModel | |
| device = "cuda" if torch.cuda.is_available() else "cpu" | |
| model = HaruModel.from_pretrained(model_id, device=device) | |
| seconds = np.arange(24_000) / 24_000 | |
| voice = (0.2 * np.sin(2 * np.pi * 150 * seconds)).astype(np.float32) | |
| config = DuplexConfig(seed=7, speak_first=True, max_frames=6) | |
| session = DuplexSession(model, "You are Haru. Greet the other person.", voice, config) | |
| frames = [session.start()] | |
| while not frames[-1].done and len(frames) < config.max_frames: | |
| frames.append(session.step(np.zeros(3200, dtype=np.float32))) | |
| assert len(frames) == 6 | |
| assert all(frame.audio.shape == (3200,) and frame.audio.dtype == np.float32 for frame in frames) | |
| assert all(np.isfinite(frame.audio).all() and np.abs(frame.audio).max() <= 1.0 for frame in frames) | |
| assert all(0 <= frame.token < 248320 for frame in frames) | |
| assert frames[1].token not in (248076, 248071) | |
| print("frames", len(frames), "text", repr("".join(frame.text for frame in frames)[:80])) | |
| if __name__ == "__main__": | |
| run_haru(model_id="tiny-random/haru") | |
| ``` | |
| ### Creating this repo | |
| - Code: [.meta/create_model.py](.meta/create_model.py) | |
| - Model structure: [.meta/model.log](.meta/model.log) | |
| - Environment: [.meta/env.json](.meta/env.json) | |
| ### Change log | |
| - 2026-11-15: Tiny Haru full-duplex checkpoint with a shrunken Qwen3.5 backbone, codec and MeanFlow head. | |
| *This repo is generated by GPT-6.1-Sol* |