Safetensors
Kuroki1931 commited on
Commit
ee7919c
·
verified ·
1 Parent(s): 6e7a0fd

Add files using upload-large-folder tool

Browse files
Files changed (3) hide show
  1. README.md +157 -0
  2. model.safetensors +3 -0
  3. moshi_lm_kwargs.json +48 -0
README.md ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # KAME Finetuned Moshi Checkpoint
2
+
3
+ This checkpoint contains a cleaned KAME finetuned Moshi model.
4
+
5
+ Files:
6
+
7
+ - `model.safetensors`: model weights
8
+ - `moshi_lm_kwargs.json`: model architecture/config for this checkpoint
9
+
10
+ Notes:
11
+
12
+ - The weights are stored in fp32.
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
+ ## Quick Start
19
+
20
+ Example with `server_oracle.py`:
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.
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29ff0aefb06307100183d60da7667d27f7fd6f039fc23115dca37675bcd0fc7a
3
+ size 31275273448
moshi_lm_kwargs.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dim": 4096,
3
+ "text_card": 32000,
4
+ "existing_text_padding_id": 3,
5
+ "n_q": 16,
6
+ "dep_q": 8,
7
+ "card": 2048,
8
+ "num_heads": 32,
9
+ "num_layers": 32,
10
+ "hidden_scale": 4.125,
11
+ "causal": true,
12
+ "layer_scale": null,
13
+ "context": 3000,
14
+ "max_period": 10000,
15
+ "gating": "silu",
16
+ "norm": "rms_norm_f32",
17
+ "positional_embedding": "rope",
18
+ "depformer_dim": 1024,
19
+ "depformer_dim_feedforward": 4224,
20
+ "depformer_num_heads": 16,
21
+ "depformer_num_layers": 6,
22
+ "depformer_layer_scale": null,
23
+ "depformer_multi_linear": true,
24
+ "depformer_context": 8,
25
+ "depformer_max_period": 10000,
26
+ "depformer_gating": "silu",
27
+ "depformer_pos_emb": "none",
28
+ "depformer_weights_per_step": true,
29
+ "delays": [
30
+ 0,
31
+ 0,
32
+ 1,
33
+ 1,
34
+ 1,
35
+ 1,
36
+ 1,
37
+ 1,
38
+ 1,
39
+ 0,
40
+ 1,
41
+ 1,
42
+ 1,
43
+ 1,
44
+ 1,
45
+ 1,
46
+ 1
47
+ ]
48
+ }