File size: 529 Bytes
b0387c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from huggingface_hub import HfApi
from transformers import TrOCRProcessor, VisionEncoderDecoderModel

# Define your Hugging Face API token and repo ID
hf_token = "your_huggingface_token"
repo_id = "your_username/trocr-finetuned-funsd"

# Initialize HfApi
api = HfApi()
api.login(hf_token)

# Define the folder path
folder_path = "./trocr-finetuned-funsd"

# Upload the model
api.upload_folder(
    folder_path=folder_path,
    repo_id=repo_id,
    repo_type="model",
    path_in_repo=".",
)

print(f"Model uploaded to {repo_id}")