import json | |
# Nội dung của model card ở định dạng JSON | |
model_card = { | |
"model_name": "ViSD-TDNM", | |
"model_description": "Model tạo ảnh dựa trên ổn định Diffusion với checkpoint phiên bản 1.5.", | |
"task": "Tạo ảnh từ văn bản", | |
"data": "Tập dữ liệu đào tạo bao gồm các cặp văn bản-hình ảnh.", | |
"metrics": {"mAP": 0.85, "Precision": 0.92}, | |
"checkpoint": { | |
"path": "path/to/your/checkpoint/file.ckpt", | |
"version": "1.5" | |
}, | |
"tags": ["tạo ảnh", "ổn định Diffusion", "model tạo ảnh"] | |
} | |
# Đường dẫn đến file JSON để lưu | |
model_card_path = "model_card.json" | |
# Lưu model card vào file JSON | |
with open(model_card_path, "w") as file: | |
json.dump(model_card, file, indent=4) | |
print(f"Model card đã được lưu vào {model_card_path}") |