Skip to content
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

Circular import error when using data/packing.py #137

Closed
Paladiamors opened this issue May 16, 2023 · 2 comments · Fixed by #175
Closed

Circular import error when using data/packing.py #137

Paladiamors opened this issue May 16, 2023 · 2 comments · Fixed by #175
Assignees

Comments

@Paladiamors
Copy link

Paladiamors commented May 16, 2023

Hello,

Getting the following circular import error when trying to run the data/packing.py script

using the command below:

python llmfoundry/data/packing.py --yaml-path /home/justin/code/ai/llm-foundry/scripts/train/yamls/finetune/mpt-7b_dolly_sft.yaml

probably worth looking at llm-foundry/llmfoundry/data/__init__.py as this might be the cause of the error

Error:

Traceback (most recent call last):
  File "/home/justin/home/ai/llm-foundry/llmfoundry/data/packing.py", line 264, in <module>
    from llmfoundry import (build_finetuning_dataloader,
  File "/home/justin/home/ai/llm-foundry/llmfoundry/__init__.py", line 8, in <module>
    from llmfoundry.data import (ConcatTokensDataset,
  File "/home/justin/home/ai/llm-foundry/llmfoundry/data/__init__.py", line 7, in <module>
    from llmfoundry.data.finetuning import (Seq2SeqFinetuningCollator,
  File "/home/justin/home/ai/llm-foundry/llmfoundry/data/finetuning/__init__.py", line 5, in <module>
    from llmfoundry.data.finetuning.dataloader import build_finetuning_dataloader
  File "/home/justin/home/ai/llm-foundry/llmfoundry/data/finetuning/dataloader.py", line 14, in <module>
    from llmfoundry.data.finetuning.tasks import dataset_constructor
  File "/home/justin/home/ai/llm-foundry/llmfoundry/data/finetuning/tasks.py", line 38, in <module>
    import datasets
  File "/home/justin/home/ai/llm-foundry/llmfoundry/data/datasets.py", line 15, in <module>
    class NoConcatDataset(IterableDataset):
  File "/home/justin/home/ai/llm-foundry/llmfoundry/data/datasets.py", line 22, in NoConcatDataset
    hf_datasets.Dataset]):
AttributeError: partially initialized module 'datasets' has no attribute 'Dataset' (most likely due to a circular import)

Probably similar error to the following issue: #127

@hanlint
Copy link
Collaborator

hanlint commented May 19, 2023

Thanks @Paladiamors , I am able to reproduce this issue on our side. We will push out a fix.

@hanlint
Copy link
Collaborator

hanlint commented May 19, 2023

Hello, we pushed a fix in #175 . Closing for now, please re-open if you run into the same issue again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants