Closed zgimszhd61 closed 7 months ago
Hey, thanks for raising this issue! Sorry you're having trouble.
That specific line:
_REGISTRY: dict[str, DatasetConfig] = {}
Is actually only compatible with Python 3.9+, since before Python 3.9 you needed to do:
from typing import Dict
_REGISTRY: Dict[str, DatasetConfig] = {}
in order to specify type hints like that. After Python 3.9 you could directly specify type hints like we see in the datasets.py file, but before that you get the error TypeError: 'type' object is not subscriptable
which you're experiencing.
I recommend updating to Python 3.9 or higher using https://www.python.org/downloads/ or your preferred package manager and trying it again, that should fix this problem.
File "/Users/admin/mywork/weak-to-strong/weak_to_strong/datasets.py", line 19, in
_REGISTRY: dict[str, DatasetConfig] = {}
TypeError: 'type' object is not subscriptable
how to solve this problem ?