Instructions to use KeisukeMiyamoto/lfm2.5-230m-cpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KeisukeMiyamoto/lfm2.5-230m-cpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KeisukeMiyamoto/lfm2.5-230m-cpt") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KeisukeMiyamoto/lfm2.5-230m-cpt") model = AutoModelForCausalLM.from_pretrained("KeisukeMiyamoto/lfm2.5-230m-cpt", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KeisukeMiyamoto/lfm2.5-230m-cpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KeisukeMiyamoto/lfm2.5-230m-cpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KeisukeMiyamoto/lfm2.5-230m-cpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KeisukeMiyamoto/lfm2.5-230m-cpt
- SGLang
How to use KeisukeMiyamoto/lfm2.5-230m-cpt with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "KeisukeMiyamoto/lfm2.5-230m-cpt" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KeisukeMiyamoto/lfm2.5-230m-cpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "KeisukeMiyamoto/lfm2.5-230m-cpt" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KeisukeMiyamoto/lfm2.5-230m-cpt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use KeisukeMiyamoto/lfm2.5-230m-cpt with Docker Model Runner:
docker model run hf.co/KeisukeMiyamoto/lfm2.5-230m-cpt
LFM2.5-230M-CPT
LFM2.5-230M-CPT is a Japanese text continuation model obtained by continued pretraining of LiquidAI/LFM2.5-230M-Base on speech transcripts. It models the wording and style of Japanese spoken language. Despite the transcript source, this checkpoint has no audio input or audio encoder and cannot transcribe speech by itself. It is a base model for further adaptation, not an instruction-tuned assistant.
Model Details
| Item | Value |
|---|---|
| Architecture | Lfm2ForCausalLM, decoder-only LFM2 hybrid |
| Parameters | 229,693,184 serialized parameters (about 230M) |
| Layers | 14: 8 causal-convolution blocks and 6 grouped-query attention blocks |
| Hidden size | 1,024 |
| Feed-forward intermediate size | 2,560 |
| Attention heads / key-value heads | 16 / 8 |
| Model vocabulary capacity | 65,536 token IDs |
| Tokenizer | Original LFM2.5-230M-Base tokenizer, unchanged |
| Base-model advertised context length | 32,768 tokens |
| Maximum sequence length used in continued pretraining | 512 tokens, including the end-of-sequence token |
| Weight format | BF16 Safetensors (model.safetensors, about 459 MB) |
| Framework | Hugging Face Transformers |
The configuration retains the base model's positional-embedding setting, but this continued-pretraining run used sequences of at most 512 tokens. Performance on longer contexts has not been evaluated for this checkpoint.
Training Data
The continued-pretraining corpus is the text field of KeisukeMiyamoto/audio-transcript, a Japanese text-only dataset assembled from NHK radio news, NHK Archives, and technology podcasts. The source transcripts include machine-generated text and corrections. No audio, prev_text, token-count columns, or other dataset fields were supplied to the model.
| Split | Role | Transcript rows | Dataset text_token total |
|---|---|---|---|
train |
Continued pretraining | 1,143,151 | 70,156,912 |
validation |
Checkpoint selection | 63,260 | 3,897,592 |
test |
Not used in training or checkpoint selection | 63,253 | 3,897,621 |
The dataset token totals exclude special tokens. Each transcript was tokenized with the base-model tokenizer and followed by one end-of-sequence token for training. Transcripts were packed into training sequences. Dataset splits are separated by row, not by recording, episode, or speaker; related segments may appear in different splits. See the dataset card for construction details and source-rights information.
Training Configuration
| Item | Value |
|---|---|
| Method | Full-parameter causal language-model continued pretraining |
| Objective | Next-token prediction on transcript text |
| Epochs completed | 3 |
| Optimizer | Fused AdamW |
| Peak learning rate | 5 ร 10โปโต |
| Learning-rate schedule | Cosine decay with 10% warmup |
| Per-device batch size | 72 configured; automatic batch-size adjustment enabled |
| Gradient accumulation | 2 steps |
| Precision during training | BF16 mixed precision |
| Gradient checkpointing | Enabled |
| Validation frequency | Once per epoch |
| Optimizer steps completed | 23,817 |
| Published checkpoint | Best validation checkpoint at step 15,878 (end of epoch 2) |
The selected checkpoint was saved in BF16 for distribution. The published configuration enables generation caching (use_cache=true). The tokenizer and model architecture remain compatible with standard Transformers from_pretrained() loading.
Evaluation
Validation loss is token-weighted next-token cross-entropy on the validation split. Lower is better.
| Epoch | Step | Validation loss |
|---|---|---|
| 1 | 7,939 | 3.0819 |
| 2 | 15,878 | 2.9808 |
| 3 | 23,817 | 2.9848 |
The epoch-2 checkpoint was selected because it had the lowest validation loss. This is a text language-modeling measurement, not an ASR metric. No audio-to-text evaluation, word error rate, character error rate, or standardized language-model benchmark is reported for this checkpoint.
Usage
Tested with Transformers 5.17.0, PyTorch 2.14.0, and python-dotenv 1.2.3. Set HF_TOKEN in a local .env file. The example performs greedy continuation on a CUDA device:
import torch
from dotenv import dotenv_values
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "KeisukeMiyamoto/lfm2.5-230m-cpt"
token = dotenv_values(".env")["HF_TOKEN"]
tokenizer = AutoTokenizer.from_pretrained(model_id, token=token)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, token=token).to("cuda")
inputs = tokenizer("ไปๆฅใฏๅคฉๆฐใ่ฏใใฎใงใ", return_tensors="pt").to("cuda")
with torch.inference_mode():
output = model.generate(**inputs, max_new_tokens=48, do_sample=False)
continuation = tokenizer.decode(
output[0, inputs["input_ids"].shape[1] :], skip_special_tokens=True
)
print(continuation)
This model repository is private at the time of writing. Authorized users must authenticate with Hugging Face before loading it. The included chat template is inherited from the base model; the continued-pretraining data contained plain transcripts, not chat instruction/response pairs.
Example Outputs
These are illustrative greedy continuations from the published BF16 checkpoint with max_new_tokens=48; they are not benchmark results.
| Prompt | Generated continuation |
|---|---|
ไปๆฅใฏๅคฉๆฐใ่ฏใใฎใงใ |
ใกใใฃใจใไผใฟใใใฆใใใ ใใพใใ |
ใใฎๅ้กใซใคใใฆใ็งใฏ |
ใใฎๅ้กใ่งฃๆฑบใใใซใฏใฉใใใใใใใใจใใใใจใ่ใใฆใ |
Limitations
- No audio support: an audio encoder and paired audio-text training would be required for speech recognition.
- The dataset concentrates on Japanese broadcast and podcast speech. It is not representative of all Japanese domains or writing styles.
- Transcripts may contain recognition errors, omissions, unusual punctuation, and content or speaker biases inherited from the sources.
- Text may end abruptly, repeat phrases, or produce plausible but unsupported continuations. The end-of-sequence token can cause short or empty outputs.
- The model has not been instruction-tuned or safety-aligned. Do not assume chat behavior from the inherited chat template.
- Related recordings can span dataset splits, so the reported validation loss should not be interpreted as a source-independent generalization score.
License and Source Rights
The model inherits the base model's LFM 1.0 license. The transcript dataset and its source collections have separate rights and use conditions. Consult their dataset cards and underlying content owners before reusing or redistributing the training text. This model card does not grant rights to the source recordings or transcripts.
- Downloads last month
- 190