Create write_model_card.py
Browse files- write_model_card.py +24 -0
write_model_card.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
|
3 |
+
# Nội dung của model card ở định dạng JSON
|
4 |
+
model_card = {
|
5 |
+
"model_name": "ViSD-TDNM",
|
6 |
+
"model_description": "Model tạo ảnh dựa trên ổn định Diffusion với checkpoint phiên bản 1.5.",
|
7 |
+
"task": "Tạo ảnh từ văn bản",
|
8 |
+
"data": "Tập dữ liệu đào tạo bao gồm các cặp văn bản-hình ảnh.",
|
9 |
+
"metrics": {"mAP": 0.85, "Precision": 0.92},
|
10 |
+
"checkpoint": {
|
11 |
+
"path": "path/to/your/checkpoint/file.ckpt",
|
12 |
+
"version": "1.5"
|
13 |
+
},
|
14 |
+
"tags": ["tạo ảnh", "ổn định Diffusion", "model tạo ảnh"]
|
15 |
+
}
|
16 |
+
|
17 |
+
# Đường dẫn đến file JSON để lưu
|
18 |
+
model_card_path = "model_card.json"
|
19 |
+
|
20 |
+
# Lưu model card vào file JSON
|
21 |
+
with open(model_card_path, "w") as file:
|
22 |
+
json.dump(model_card, file, indent=4)
|
23 |
+
|
24 |
+
print(f"Model card đã được lưu vào {model_card_path}")
|