PRM / upload_huggingface.py
JiantaoLin
new
2fe3da0
raw
history blame
1.09 kB
from huggingface_hub import HfApi, HfFolder, Repository, create_repo, upload_file
import os
# 登录到 Hugging Face
from huggingface_hub import login
login()
# 创建或指定现有的 Repository
repo_name = "PRM"
username = "LTT"
repo_id = f"{username}/{repo_name}"
# 创建仓库(如果它不存在)
create_repo(repo_id, exist_ok=True)
# 上传模型文件
model_path = "/hpc2hdd/home/jlin695/code/For_debug/intrinsic-LRM/new_ckpt/camera_random_step=00006400-nerf-12wdata.ckpt"
upload_file(path_or_fileobj=model_path, path_in_repo="final_ckpt.ckpt", repo_id=repo_id)
# # 上传数据文件
data_path = "/hpc2hdd/home/jlin695/data/pretrained_model/models--TencentARC--InstantMesh/diffusion_pytorch_model.bin"
upload_file(path_or_fileobj=data_path, path_in_repo="diffusion_pytorch_model.bin", repo_id=repo_id)
# # 上传数据文件
# data_path = "/hpc2hdd/home/jlin695/data/env_map/data/env_map_light_large.tar.gz"
# upload_file(path_or_fileobj=data_path, path_in_repo="env_map_light_large.tar.gz", repo_id=repo_id)
print("模型和数据文件已上传到 Hugging Face。")