Spaces:
Build error
Build error
File size: 1,072 Bytes
b51df68 | 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 27 28 29 30 31 32 33 34 35 36 | from huggingface_hub import HfApi, create_repo, upload_file
# -------------------------------------------
# CONFIGURAÇÕES
# -------------------------------------------
REPO_NAME = "ChristianSardo/bimboca-dataset" # Ex: christian-sardo/bimboca-dataset
LOCAL_FILE_PATH = r"C:\Users\christian_sardo\Documents\ra\bimboca.csv"
REMOTE_PATH = "bimboca.csv" # Nome do arquivo no hub
# -------------------------------------------
# EXECUÇÃO
# -------------------------------------------
api = HfApi()
# Criar repo se não existir
try:
create_repo(repo_id=REPO_NAME, token=HF_TOKEN, repo_type="dataset")
print(f"Repositório criado: https://huggingface.co/datasets/{REPO_NAME}")
except Exception as e:
print(f"Repo já existe ou outro aviso: {e}")
# Upload do arquivo
upload_file(
token=HF_TOKEN,
path_or_fileobj=LOCAL_FILE_PATH,
repo_id=REPO_NAME,
repo_type="dataset",
path_in_repo=REMOTE_PATH
)
print("Upload completo!")
print(f"Dataset disponível em: https://huggingface.co/datasets/{REPO_NAME}")
|