| import os | |
| # Kiểm tra xem file checkpoint có tồn tại hay không | |
| checkpoint_path = "path/to/your/checkpoint/file.ckpt" | |
| if not os.path.exists(checkpoint_path): | |
| print("File checkpoint không tồn tại.") | |
| exit() | |
| # Tải model và tokenizer từ Hugging Face | |
| from transformers import AutoModelForGenerativePreTraining, AutoTokenizer | |
| model = AutoModelForGenerativePreTraining.from_pretrained(checkpoint_path) | |
| tokenizer = AutoTokenizer.from_pretrained("visd-tdnm") | |
| print("Model và tokenizer đã được tải thành công.") |