trocr-finetuned-funsd / publish.py
alikayh's picture
Create publish.py
b0387c6 verified
raw
history blame contribute delete
529 Bytes
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}")