Views
No views yet
1import torch
2from transformers import AutoTokenizer, AutoModel
3from huggingface_hub import hf_hub_download
4
5# Download model
6model_path = hf_hub_download(
7 repo_id="george121212afasf/model",
8 filename="best_model.pt"
9)
10
11# Load checkpoint
12checkpoint = torch.load(model_path, map_location='cpu')
13
14# Get tokenizer
15tokenizer = AutoTokenizer.from_pretrained("indobenchmark/indobert-base-p1")
16
17# Your model class and inference code here