Views
No views yet
iic/speech_campplus_sv_zh_en_16k-common_advanced1from huggingface_hub import snapshot_download
2import mlx.core as mx
3import sys
4
5# Download model
6model_path = snapshot_download("mlx-community/campp-mlx")
7sys.path.append(model_path)
8
9from model import CAMPPModel
10import json
11
12# Load model
13with open(f"{model_path}/config.json") as f:
14 config = json.load(f)
15
16model = CAMPPModel(
17 input_dim=config["input_dim"],
18 embedding_dim=config["embedding_dim"],
19 input_channels=config.get("input_channels", 64)
20)
21weights = mx.load(f"{model_path}/weights.npz")
22model.load_weights(weights)
23
24# Use model
25audio_features = mx.random.normal((1, 80, 200)) # Your audio features
26embedding = model(audio_features)