r/SelfHostedAI • u/AdvanceFront6536 • 5d ago
LingSante-Pulse's MIT waveform encoder has a local CPU smoke test
LingSante-Pulse-1.0 has released waveform-encoder weights and inference code under MIT. The repository documents CPU inference with synthetic examples, so there is a concrete way to check that the feature extractor loads before connecting real ECG, EEG, PPG or EMG data.
From a clone of `inclusionAI/LingSante-Pulse`, install the documented dependencies with `python -m pip install -r requirements.txt` and then `python -m pip install . --no-deps`. The model card's single-lead ECG example is:
- import numpy as np
- from lingsante_pulse import LingSantePulse
- model = LingSantePulse.from_pretrained()
- x = np.random.default_rng(42).normal(size=(2, 1, 1280)).astype(np.float32)
- f = model.encode(x, sample_rate=128, channels=[{"modality": "ECG", "lead": "II"}])
- print(f["cls"].shape, f["patch_mean"].shape)
torch.Size([2, 256]) torch.Size([2, 256])
The first load downloads the public weights; a cached local model directory can be loaded with `local_files_only=True` for an offline repeat. The code handles observed-sample information and storage-padding masks separately. This example proves the interface returns embeddings; it is not a throughput benchmark or a disease classifier. Those need separate evaluation on real data and hardware.