You can use relative paths to your data files

#2
by albertvillanova HF staff - opened

@tbrugger : do you know you can use relative paths to your data files, instead of using hf_hub_url?

You can replace your code line:

filepaths.append(download_url(f'{language}_{type}_{shard}'))

with

filepaths.append(dl_manager.download(f'data/{language}_{type}_{shard}.jsonl.xz'))

Also note that in your code you kept the old name of your repo ("tbrugger/Multilingual-SBD") instead of the current one ("rcds/MultiLegalSBD"):

url = hf_hub_url(
    repo_id="tbrugger/Multilingual-SBD",
    filename = f'data/{filename}.jsonl.xz',
    repo_type='dataset'
)
Research Center for Digital Sustainability org

I didn't know that, thanks for the heads up.
I implemented both.

tbrugger changed discussion status to closed

Sign up or log in to comment