Create yaml.py
Browse files
yaml.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import yaml
|
2 |
+
|
3 |
+
# 定义模型卡元数据
|
4 |
+
model_card_metadata = {
|
5 |
+
"license": "apache-2.0",
|
6 |
+
"language": ["en"],
|
7 |
+
"metrics": ["accuracy", "bertscore"],
|
8 |
+
"library_name": ["adapter-transformers", "transformers"],
|
9 |
+
"model_name": "AutoModel",
|
10 |
+
"model_type": "multimodal-transformer",
|
11 |
+
"tags": ["multimodal", "transformer"],
|
12 |
+
"datasets": ["dataset1", "dataset2"],
|
13 |
+
"finetuned_from": "pretrained-model",
|
14 |
+
"config": {
|
15 |
+
"hidden_size": 768,
|
16 |
+
"num_attention_heads": 12,
|
17 |
+
"num_hidden_layers": 12,
|
18 |
+
"intermediate_size": 2048,
|
19 |
+
"hidden_dropout_prob": 0.1,
|
20 |
+
"attention_probs_dropout_prob": 0.1,
|
21 |
+
"image_size": 224,
|
22 |
+
"image_channels": 3,
|
23 |
+
"patch_size": 16,
|
24 |
+
"max_position_embeddings": 512,
|
25 |
+
"vocab_size": 30522,
|
26 |
+
"type_vocab_size": 2,
|
27 |
+
"audio_sample_rate": 16000,
|
28 |
+
"audio_frame_size": 1024,
|
29 |
+
"audio_hop_size": 512,
|
30 |
+
"enable_vqa": True,
|
31 |
+
"enable_caption": True,
|
32 |
+
"enable_retrieval": True,
|
33 |
+
"enable_asr": True,
|
34 |
+
"enable_realtime_asr": True,
|
35 |
+
"batch_size": 32,
|
36 |
+
"learning_rate": 0.0001,
|
37 |
+
"weight_decay": 0.01,
|
38 |
+
"warmup_steps": 10000,
|
39 |
+
"max_steps": 100000
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
# 打印模型卡元数据
|
44 |
+
print(yaml.dump(model_card_metadata, default_flow_style=False))
|