Monkey455's picture
Upload folder using huggingface_hub
6a3f585 verified
Raw
History Blame Contribute Delete
771 Bytes
from huggingface_hub import HfApi
import os
api = HfApi()
# Correct path - use either format:
folder_path = r"D:\python all collection\my-portfolio-site\llama3-customerbot"
# OR:
# folder_path = "D:/python all collection/my-portfolio-site/llama3-customerbot"
# Verify the folder exists
if not os.path.isdir(folder_path):
print(f"Error: Folder not found at {folder_path}")
exit()
print("Folder found, proceeding with upload...")
try:
api.upload_folder(
folder_path=folder_path, # Make sure this matches the variable above
repo_id="Monkey455/llama3-customerbot",
repo_type="model",
allow_patterns=["*"],
)
print("Upload successful!")
except Exception as e:
print(f"Upload failed: {e}")