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

[example] fix: fix math circular dependency #31

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

eric-haibin-lin
Copy link
Collaborator

Avoid using file name math since it may lead to circular dependency due to file name conflict


Traceback (most recent call last):
  File "/teamspace/studios/this_studio/verl/examples/data_preprocess/gsm8k.py", line 20, in <module>
    import datasets
  File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/datasets/__init__.py", line 17, in <module>
    from .arrow_dataset import Dataset
  File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 23, in <module>
    import math
  File "/teamspace/studios/this_studio/verl/examples/data_preprocess/math.py", line 21, in <module>
    from verl.utils.hdfs_io import copy, makedirs
  File "/teamspace/studios/this_studio/verl/verl/__init__.py", line 22, in <module>
    from .protocol import DataProto
  File "/teamspace/studios/this_studio/verl/verl/protocol.py", line 19, in <module>
    import numpy as np
  File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/numpy/__init__.py", line 157, in <module>
    from . import random
  File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/numpy/random/__init__.py", line 180, in <module>
    from . import _pickle
  File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/site-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
  File "numpy/random/mtrand.pyx", line 1, in init numpy.random.mtrand
  File "bit_generator.pyx", line 40, in init numpy.random.bit_generator
  File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/secrets.py", line 19, in <module>
    from random import SystemRandom
  File "/home/zeus/miniconda3/envs/cloudspace/lib/python3.10/random.py", line 49, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: cannot import name 'log' from partially initialized module 'math' (most likely due to a circular import) (/teamspace/studios/this_studio/verl/examples/data_preprocess/math.py)


@eric-haibin-lin eric-haibin-lin merged commit 292b60b into volcengine:main Dec 2, 2024
2 checks passed
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 this pull request may close these issues.

1 participant