File size: 721 Bytes
4e5049e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
license:
  - mit
  - apache-2.0
tags:
  - musicfm
---

# MusicFM

- MusicFM that supports `transformers.AutoModel`.
- See https://github.com/minzwon/musicfm/blob/master/README.md for details.

```python
>>> import torch
>>> from transformers import AutoModel
>>> torch.manual_seed(0)
>>> wav = (torch.rand(4, 24000 * 30) - 0.5) * 2
>>> model = AutoModel.from_pretrained("tky823/MusicFMInferece",  trust_remote_code=True)
>>> # get embeddings
>>> model.eval()
>>> emb = model(wav)
>>> emb.size()
torch.Size([4, 750, 1024])
```

## Ackowledgement

Most of the source code in this repository is based on code from @minzwon's repository https://github.com/minzwon/musicfm. We gratefully acknowledge their excellent work.