facebookresearch / fairseq

Facebook AI Research Sequence-to-Sequence Toolkit written in Python.
MIT License
30.58k stars 6.41k forks source link

It seems there's a minor error in 'fairseq/fairseq/dataclass /configs.py Line1103 #5509

Open fangzuli opened 5 months ago

fangzuli commented 5 months ago

🐛 Bug

To Reproduce

Steps to reproduce the behavior (always include the command you ran):

  1. run pyinstaller exe on win10
  2. File "fairseq\dataclass\configs.py", line 1103, in EMAConfig default=False, metadata={help: "store exponential moving average shadow model"} NameError: name 'help' is not defined
  3. you can check out on https://github.com/facebookresearch/fairseq/blob/main/fairseq/dataclass/configs.py Line 1103
yukozh commented 3 months ago

I'm also encountering this issue. Without pyinstaller, everything worked as expected. However if the project published by pyinstaller, an NameError has been thrown.

yukozh commented 3 months ago
Traceback (most recent call last):
  File "app.py", line 97, in modelAnalysis
  File "inference\infer_tool.py", line 166, in __init__
  File "utils.py", line 113, in get_speech_encoder
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
    exec(bytecode, module.__dict__)
  File "vencoder\ContentVec768L12.py", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
    exec(bytecode, module.__dict__)
  File "fairseq\__init__.py", line 20, in <module>
    from fairseq.distributed import utils as distributed_utils
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
    exec(bytecode, module.__dict__)
  File "fairseq\distributed\__init__.py", line 7, in <module>
    from .fully_sharded_data_parallel import (
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
    exec(bytecode, module.__dict__)
  File "fairseq\distributed\fully_sharded_data_parallel.py", line 10, in <module>
    from fairseq.dataclass.configs import DistributedTrainingConfig
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
    exec(bytecode, module.__dict__)
  File "fairseq\dataclass\__init__.py", line 6, in <module>
    from .configs import FairseqDataclass
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
    exec(bytecode, module.__dict__)
  File "fairseq\dataclass\configs.py", line 1078, in <module>
    class EMAConfig(FairseqDataclass):
  File "fairseq\dataclass\configs.py", line 1080, in EMAConfig
    default=False, metadata={"help": "store exponential moving average shadow model"}
NameError: name 'help' is not defined