Update README.md
Browse files
README.md
CHANGED
|
@@ -1,157 +1,22 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
-
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
Notes:
|
| 11 |
|
| 12 |
-
|
| 13 |
-
- Inference in the server scripts used in this repo typically runs in bfloat16 by default unless a different dtype is explicitly requested.
|
| 14 |
-
- This release does not include a `config.json`.
|
| 15 |
-
- When loading this checkpoint, pass `moshi_lm_kwargs.json` explicitly as `--config-path`.
|
| 16 |
-
- Tokenizer and Mimi assets are expected to come from `kyutai/moshiko-pytorch-bf16`.
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
```bash
|
| 23 |
-
cd /path/to/moshi
|
| 24 |
|
| 25 |
-
CHECKPOINT_DIR=/path/to/checkpoint
|
| 26 |
-
MODEL_WEIGHT=$CHECKPOINT_DIR/model.safetensors
|
| 27 |
-
MODEL_CONFIG=$CHECKPOINT_DIR/moshi_lm_kwargs.json
|
| 28 |
-
HF_REPO=kyutai/moshiko-pytorch-bf16
|
| 29 |
|
| 30 |
-
uv run python -m moshi.server_oracle \
|
| 31 |
-
--hf-repo "$HF_REPO" \
|
| 32 |
-
--moshi-weight "$MODEL_WEIGHT" \
|
| 33 |
-
--config-path "$MODEL_CONFIG" \
|
| 34 |
-
--device cuda
|
| 35 |
-
```
|
| 36 |
-
|
| 37 |
-
Make sure any required environment variables for your local setup are already set
|
| 38 |
-
before launching the server.
|
| 39 |
-
|
| 40 |
-
Then open:
|
| 41 |
-
|
| 42 |
-
- `http://localhost:8998`
|
| 43 |
-
|
| 44 |
-
If the GPU machine is remote and you need a public URL, add:
|
| 45 |
-
|
| 46 |
-
- `--gradio-tunnel`
|
| 47 |
-
|
| 48 |
-
---
|
| 49 |
-
|
| 50 |
-
Copy everything above this line into the Hugging Face repo `README.md`.
|
| 51 |
-
|
| 52 |
-
## Internal Notes
|
| 53 |
-
|
| 54 |
-
This section is for internal team use and can stay in the local copy of this directory.
|
| 55 |
-
|
| 56 |
-
Current local directory:
|
| 57 |
-
|
| 58 |
-
- `/home/manatoyaguchi_sakana_ai/kame_finetune_dev/output/moshiko-finetuned_all_en_oracle_emb_separate_copy_single_multi/step_6000_fp32_cleaned`
|
| 59 |
-
|
| 60 |
-
### Local Files
|
| 61 |
-
|
| 62 |
-
- `model.safetensors`: model weights
|
| 63 |
-
- `moshi_lm_kwargs.json`: model architecture/config used for this checkpoint
|
| 64 |
-
|
| 65 |
-
### Important
|
| 66 |
-
|
| 67 |
-
- This checkpoint is currently shared as `model.safetensors + moshi_lm_kwargs.json`.
|
| 68 |
-
- There is no `config.json` in this directory.
|
| 69 |
-
- When loading this checkpoint, pass `moshi_lm_kwargs.json` explicitly as `--config-path`.
|
| 70 |
-
- Tokenizer and Mimi assets are expected to come from `kyutai/moshiko-pytorch-bf16`.
|
| 71 |
-
- The weights are stored in fp32.
|
| 72 |
-
- In `server_oracle.py` and the evaluation scripts used in this repo, inference runs in bfloat16 by default unless a different dtype is explicitly requested.
|
| 73 |
-
|
| 74 |
-
### Quick Start
|
| 75 |
-
|
| 76 |
-
Use this checkpoint together with the base Moshi repo:
|
| 77 |
-
|
| 78 |
-
```bash
|
| 79 |
-
cd /home/manatoyaguchi_sakana_ai/kame_finetune_dev
|
| 80 |
-
|
| 81 |
-
MODEL_DIR=$PWD/output/moshiko-finetuned_all_en_oracle_emb_separate_copy_single_multi/step_6000_fp32_cleaned
|
| 82 |
-
MODEL_WEIGHT=$MODEL_DIR/model.safetensors
|
| 83 |
-
MODEL_CONFIG=$MODEL_DIR/moshi_lm_kwargs.json
|
| 84 |
-
HF_REPO=kyutai/moshiko-pytorch-bf16
|
| 85 |
-
```
|
| 86 |
-
|
| 87 |
-
### Main Use Case: UI Inference with `server_oracle.py`
|
| 88 |
-
|
| 89 |
-
The main intended use of this checkpoint is interactive inference through
|
| 90 |
-
`kame_dev/moshi/moshi/server_oracle.py`.
|
| 91 |
-
|
| 92 |
-
Start the server like this:
|
| 93 |
-
|
| 94 |
-
```bash
|
| 95 |
-
cd /home/manatoyaguchi_sakana_ai/kame_dev/moshi
|
| 96 |
-
|
| 97 |
-
set -a
|
| 98 |
-
source ../.env
|
| 99 |
-
set +a
|
| 100 |
-
|
| 101 |
-
MODEL_DIR=/home/manatoyaguchi_sakana_ai/kame_finetune_dev/output/moshiko-finetuned_all_en_oracle_emb_separate_copy_single_multi/step_6000_fp32_cleaned
|
| 102 |
-
MODEL_WEIGHT=$MODEL_DIR/model.safetensors
|
| 103 |
-
MODEL_CONFIG=$MODEL_DIR/moshi_lm_kwargs.json
|
| 104 |
-
HF_REPO=kyutai/moshiko-pytorch-bf16
|
| 105 |
-
|
| 106 |
-
uv run python -m moshi.server_oracle \
|
| 107 |
-
--hf-repo "$HF_REPO" \
|
| 108 |
-
--moshi-weight "$MODEL_WEIGHT" \
|
| 109 |
-
--config-path "$MODEL_CONFIG" \
|
| 110 |
-
--device cuda
|
| 111 |
-
```
|
| 112 |
-
|
| 113 |
-
Then open:
|
| 114 |
-
|
| 115 |
-
- `http://localhost:8998`
|
| 116 |
-
|
| 117 |
-
If the GPU machine is remote and you need a public URL, add:
|
| 118 |
-
|
| 119 |
-
- `--gradio-tunnel`
|
| 120 |
-
|
| 121 |
-
Notes:
|
| 122 |
-
|
| 123 |
-
- `moshi_lm_kwargs.json` must be passed explicitly as `--config-path`.
|
| 124 |
-
- `kyutai/moshiko-pytorch-bf16` provides the base tokenizer and Mimi assets.
|
| 125 |
-
- By default this runs in `bfloat16`. Add `--half` if you explicitly want `float16`.
|
| 126 |
-
|
| 127 |
-
### MT-Bench Evaluation (For Internal Use Only)
|
| 128 |
-
|
| 129 |
-
```bash
|
| 130 |
-
cd /home/manatoyaguchi_sakana_ai/kame_finetune_dev
|
| 131 |
-
|
| 132 |
-
set -a
|
| 133 |
-
source ../kame_dev/.env
|
| 134 |
-
set +a
|
| 135 |
-
|
| 136 |
-
INPUT_DIR=/home/shared/sokuroki_sakana_ai/moshi/yaguchi/mt_bench
|
| 137 |
-
MODEL_DIR=$PWD/output/moshiko-finetuned_all_en_oracle_emb_separate_copy_single_multi/step_6000_fp32_cleaned
|
| 138 |
-
MODEL_WEIGHT=$MODEL_DIR/model.safetensors
|
| 139 |
-
MODEL_CONFIG=$MODEL_DIR/moshi_lm_kwargs.json
|
| 140 |
-
HF_REPO=kyutai/moshiko-pytorch-bf16
|
| 141 |
-
|
| 142 |
-
uv run python -m experimental.mt_bench.run_model_eval \
|
| 143 |
-
--input-dir "$INPUT_DIR" \
|
| 144 |
-
--output-dir "$PWD/data/mt_bench_kame_step6000_smoke" \
|
| 145 |
-
--moshi-weight "$MODEL_WEIGHT" \
|
| 146 |
-
--config-path "$MODEL_CONFIG" \
|
| 147 |
-
--hf-repo "$HF_REPO" \
|
| 148 |
-
--backend openai \
|
| 149 |
-
--question-ids 106 \
|
| 150 |
-
--limit 1
|
| 151 |
-
```
|
| 152 |
-
|
| 153 |
-
### Additional Notes
|
| 154 |
-
|
| 155 |
-
- For shared use, the most important files are `model.safetensors` and `moshi_lm_kwargs.json`.
|
| 156 |
-
- If you upload this directory to Hugging Face as-is, downstream users should download both files and pass `moshi_lm_kwargs.json` explicitly when loading.
|
| 157 |
-
- `config.json` is not included here. This checkpoint is currently shared in a "documented artifact" style rather than as a standalone self-describing HF repo.
|
|
|
|
| 1 |
+
# KAME
|
| 2 |
|
| 3 |
+
## Links
|
| 4 |
|
| 5 |
+
* **Paper**: [arXiv: 2510.02327](https://arxiv.org/abs/2510.02327) (ICASSP 2026)
|
| 6 |
+
* **Inference code**: [SakanaAI/kame](https://github.com/SakanaAI/kame)
|
| 7 |
+
* **Finetuning code**: [SakanaAI/kame_finetune](https://github.com/SakanaAI/kame_finetune)
|
| 8 |
|
| 9 |
+
## Abstract
|
| 10 |
+
Real-time speech-to-speech (S2S) models excel at generating natural, low-latency conversational responses but often lack deep knowledge and semantic understanding. Conversely, cascaded systems combining automatic speech recognition, a text-based Large Language Model (LLM), and text-to-speech synthesis offer superior knowledge representation at the cost of high latency, which disrupts the flow of natural interaction.
|
| 11 |
+
This paper introduces a novel hybrid architecture that bridges the gap between these two paradigms. Our framework processes user speech through an S2S transformer for immediate responsiveness while concurrently relaying the query to a powerful back-end LLM. The LLM’s text-based response is then injected in real time to guide the S2S model’s speech generation, effectively infusing its output with rich knowledge without the full latency penalty of a cascaded system.
|
| 12 |
+
We evaluated our method using a speech-synthesized variant of the MT-Bench benchmark that consists of multi-turn question-answering sessions. The results demonstrate that our system substantially outperforms a baseline S2S model in response correctness, approaching that of a cascaded system, while maintaining a latency on par with the baseline.
|
| 13 |
|
|
|
|
| 14 |
|
| 15 |
+
## Base Model
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
The front-end S2S model is based on Moshi: a speech-text foundation model for real-time dialogue, a full-duplex speech-to-speech foundation model for real-time dialogue. ([arxiv.org][1])
|
| 18 |
|
| 19 |
+
[1]: https://arxiv.org/abs/2410.00037?utm_source=chatgpt.com "Moshi: a speech-text foundation model for real-time dialogue"
|
| 20 |
|
|
|
|
|
|
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|