RS2002 commited on
Commit
0597d3d
·
verified ·
1 Parent(s): e715770

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +94 -9
README.md CHANGED
@@ -1,9 +1,94 @@
1
- ---
2
- tags:
3
- - model_hub_mixin
4
- - pytorch_model_hub_mixin
5
- ---
6
-
7
- This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
8
- - Library: [More Information Needed]
9
- - Docs: [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PianoBART
2
+
3
+ The description is generated by Grok3.
4
+
5
+ ## Model Details
6
+
7
+ - **Model Name**: PianoBART
8
+
9
+ - **Model Type**: Transformer-based model (BART architecture) for symbolic piano music generation and understanding
10
+
11
+ - **Version**: 1.0
12
+
13
+ - **Release Date**: August 2025
14
+
15
+ - **Developers**: Zijian Zhao, Weichao Zeng, Yutong He, Fupeng He, Yiyi Wang
16
+
17
+ - **Organization**: SYSU
18
+
19
+ - **License**: Apache License 2.0
20
+
21
+ - **Paper**: [PianoBART: Symbolic Piano Music Generation and Understanding with Large-Scale Pre-Training](https://ieeexplore.ieee.org/document/10688332), ICME 2024
22
+
23
+ - Citation:
24
+
25
+ ```
26
+ @INPROCEEDINGS{10688332,
27
+ author={Liang, Xiao and Zhao, Zijian and Zeng, Weichao and He, Yutong and He, Fupeng and Wang, Yiyi and Gao, Chengying},
28
+ booktitle={2024 IEEE International Conference on Multimedia and Expo (ICME)},
29
+ title={PianoBART: Symbolic Piano Music Generation and Understanding with Large-Scale Pre-Training},
30
+ year={2024},
31
+ volume={},
32
+ number={},
33
+ pages={1-6},
34
+ doi={10.1109/ICME57554.2024.10688332}
35
+ }
36
+ ```
37
+
38
+ - **Contact**: [email protected]
39
+
40
+ - **Repository**: https://github.com/RS2002/PianoBart
41
+
42
+ ## Model Description
43
+
44
+ PianoBART is a transformer-based model built on the Bidirectional and Auto-Regressive Transformers (BART) architecture, designed for symbolic piano music generation and understanding. It leverages large-scale pre-training to perform tasks such as music generation, composer classification, emotion classification, velocity prediction, and melody prediction. The model processes symbolic music data in an octuple format and is inspired by frameworks like [MusicBERT](https://github.com/microsoft/muzic/tree/main/musicbert) and [MidiBERT-Piano](https://github.com/wazenmai/MIDI-BERT).
45
+
46
+ - **Architecture**: BART (encoder-decoder transformer)
47
+ - **Input Format**: Octuple representation of symbolic music (batch_size, sequence_length, 8) for both encoder and decoder
48
+ - **Output Format**: Hidden states of dimension [batch_size, sequence_length, 1024]
49
+ - **Hidden Size**: 1024
50
+ - **Training Objective**: Pre-training with large-scale datasets followed by task-specific fine-tuning
51
+ - **Tasks Supported**: Music generation, composer classification, emotion classification, velocity prediction, melody prediction
52
+
53
+ ## Training Data
54
+
55
+ The model was pre-trained and fine-tuned on the following datasets:
56
+
57
+ - **Pre-training**: POP1K7, ASAP, POP909, Pianist8, EMOPIA
58
+ - **Generation**: Maestro, GiantMIDI
59
+ - **Composer Classification**: ASAP, Pianist8
60
+ - **Emotion Classification**: EMOPIA
61
+ - **Velocity Prediction**: GiantMIDI
62
+ - **Melody Prediction**: POP909
63
+
64
+ For dataset preprocessing and organization, refer to the [MusicBERT](https://github.com/microsoft/muzic/tree/main/musicbert) and [MidiBERT-Piano](https://github.com/wazenmai/MIDI-BERT) repositories.
65
+
66
+ ## Usage
67
+
68
+ ### Installation
69
+
70
+ ```shell
71
+ git clone https://huggingface.co/RS2002/PianoBART
72
+ ```
73
+
74
+ Please ensure that the `model.py` and `Octuple.pkl` files are located in the same folder.
75
+
76
+ ### Example Code
77
+
78
+ ```python
79
+ import torch
80
+ from model import PianoBART
81
+
82
+ # Load the model
83
+ model = PianoBART.from_pretrained("RS2002/PianoBART")
84
+
85
+ # Example input
86
+ input_ids_encoder = torch.randint(1, 10, (2, 1024, 8))
87
+ input_ids_decoder = torch.randint(1, 10, (2, 1024, 8))
88
+ encoder_attention_mask = torch.zeros((2, 1024))
89
+ decoder_attention_mask = torch.zeros((2, 1024))
90
+
91
+ # Forward pass
92
+ output = model(input_ids_encoder, input_ids_decoder, encoder_attention_mask, decoder_attention_mask)
93
+ print(output.last_hidden_state.size()) # Output: [2, 1024, 1024]
94
+ ```