Views
No views yet
iic/speech_campplus_sv_zh-cn_16k-common1from 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(config["input_dim"], config["embedding_dim"])
17weights = mx.load(f"{model_path}/weights.npz")
18model.load_weights(weights)
19
20# Use model
21audio_features = mx.random.normal((1, 80, 200)) # Your audio features
22embedding = model(audio_features)