File size: 424 Bytes
61a1270
 
 
 
 
 
 
 
 
a8c5296
 
61a1270
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from huggingface_hub import HfApi
import os

api = HfApi(token=os.getenv("HF_TOKEN"))

def download():
    api.hf_hub_download(
        repo_type="dataset",
        repo_id="xcx0902/database",
        filename="database.db",
        local_dir="."
    )

def upload():
    api.upload_folder(
        folder_path=".",
        repo_type="dataset",
        repo_id="xcx0902/database",
        allow_patterns="database.db"
    )