lklimkiewicz
commited on
Upload OPTForMusicGeneration
Browse files- config.json +1 -1
- model.py +4 -0
config.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
],
|
9 |
"attention_dropout": 0.0,
|
10 |
"auto_map": {
|
11 |
-
"
|
12 |
},
|
13 |
"bos_token_id": 1,
|
14 |
"do_layer_norm_before": true,
|
|
|
8 |
],
|
9 |
"attention_dropout": 0.0,
|
10 |
"auto_map": {
|
11 |
+
"AutoModelForCausalLM": "model.OPTForMusicGeneration"
|
12 |
},
|
13 |
"bos_token_id": 1,
|
14 |
"do_layer_norm_before": true,
|
model.py
CHANGED
@@ -4,6 +4,9 @@ import torch
|
|
4 |
from miditok import TokSequence
|
5 |
|
6 |
|
|
|
|
|
|
|
7 |
class OPTForMusicGeneration(OPTForCausalLM):
|
8 |
|
9 |
def generate_music(self, **kwargs):
|
@@ -14,3 +17,4 @@ class OPTForMusicGeneration(OPTForCausalLM):
|
|
14 |
|
15 |
|
16 |
OPTForMusicGeneration.register_for_auto_class("AutoModel")
|
|
|
|
4 |
from miditok import TokSequence
|
5 |
|
6 |
|
7 |
+
# class OPTForMusicGenerationConfig(OPTConfig):
|
8 |
+
|
9 |
+
|
10 |
class OPTForMusicGeneration(OPTForCausalLM):
|
11 |
|
12 |
def generate_music(self, **kwargs):
|
|
|
17 |
|
18 |
|
19 |
OPTForMusicGeneration.register_for_auto_class("AutoModel")
|
20 |
+
OPTForMusicGeneration.register_for_auto_class("AutoModelForCausalLM")
|