How to access relative file when building a datasets

I am trying to create a custom dataset and upload it to HF. The data is put into the same git repo on HF space.

However, when writing the _split_generators method for the dataset, I’m having trouble accessing the file.

For example, how can I access and load action_effect_sentence_phrase.txt that is in the root of the HF repo from the _split_generators method?

The datasets can be found here

Hi! In the linked repo, os.path.join needs to be used instead of string concatenation to build the valid image paths. In addition, a ZIP archive is required to support referencing image files inside of it using os.path.join (TAR/TAR.GZ only allows sequential access).

To address these issues, I’ve opened a PR here.

Thank you so much! It solved my problem.