File size: 620 Bytes
7cf8751
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1447d68
22b128b
 
7cf8751
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()