Skip to content

Support for images_root field for multimodal training data #7814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
tianbinli opened this issue Apr 22, 2025 · 3 comments
Open
1 task done

Support for images_root field for multimodal training data #7814

tianbinli opened this issue Apr 22, 2025 · 3 comments
Labels
solved This problem has been already solved

Comments

@tianbinli
Copy link

Reminder

  • I have read the above rules and searched the existing issues.

Description

Hi, thanks for the great repo!

Could you consider adding support for an images_root field in multimodal training? This would allow specifying a common root directory for image paths, so we can use relative paths in the dataset.

It would simplify data management and improve portability.

Thanks!

Pull Request

No response

@tianbinli tianbinli added enhancement New feature or request pending This problem is yet to be addressed labels Apr 22, 2025
@hiyouga
Copy link
Owner

hiyouga commented Apr 22, 2025

Please use

media_dir: Optional[str] = field(
default=None,
metadata={"help": "Path to the folder containing the images, videos or audios. Defaults to `dataset_dir`."},
)

@hiyouga hiyouga added solved This problem has been already solved and removed enhancement New feature or request pending This problem is yet to be addressed labels Apr 22, 2025
@tianbinli
Copy link
Author

Thank you for the quick response! I’ve figured it out — it's possible to set a media_dir for overall datasets, which is really helpful. However, if there are many datasets with different root paths, it seems like this setup doesn’t fully support that scenario yet.

Please use

LLaMA-Factory/src/llamafactory/hparams/data_args.py

Lines 42 to 45 in 2b7d564

media_dir: Optional[str] = field(
default=None,
metadata={"help": "Path to the folder containing the images, videos or audios. Defaults to dataset_dir."},
)

@hiyouga
Copy link
Owner

hiyouga commented Apr 22, 2025

make sense, we'll add some features in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

No branches or pull requests

2 participants