tky823 commited on
Commit
84d6ca2
·
verified ·
1 Parent(s): a6e1426

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +18 -0
README.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MusicFM
2
+
3
+ - MusicFM that supports `transformers.AutoModel`.
4
+ - Original repository: https://github.com/minzwon/musicfm
5
+ - See https://github.com/minzwon/musicfm/blob/master/README.md for details.
6
+
7
+ ```python
8
+ >>> import torch
9
+ >>> from transformers import AutoModel
10
+ >>> torch.manual_seed(0)
11
+ >>> wav = (torch.rand(4, 24000 * 30) - 0.5) * 2
12
+ >>> model = AutoModel.from_pretrained("tky823/MusicFM", trust_remote_code=True)
13
+ #>>> get embeddings
14
+ >>> model.eval()
15
+ >>> emb = model.get_latent(wav, layer_ix=7)
16
+ >>> emb.size()
17
+ torch.Size([4, 750, 1024])
18
+ ```