wikiembed.py / upload.py
brittlewis12's picture
Upload folder using huggingface_hub
22b128b verified
from os import environ
from huggingface_hub import create_repo, HfApi
def upload():
token = environ.get('HF_TOKEN')
api = HfApi(token=token)
repo_id = f"{environ.get('HF_USER')}/wikiembed.py"
create_repo(
repo_id = repo_id,
repo_type="dataset",
exist_ok=True,
token=token
)
result = api.upload_folder(
folder_path="./",
repo_type="dataset",
repo_id=repo_id,
allow_patterns=["README.md", "*.py", "*.bz2", "*.br", "requirements.txt"],
ignore_patterns=["scraps/*"],
delete_patterns=["*.bz2", "*.br"]
)
upload()