mammoth-eu / mammoth-commons

Contains modules with the project's research results
Other
0 stars 6 forks source link

running demonsrtator/app.py error (model card) #18

Closed gsarridis closed 1 week ago

gsarridis commented 1 week ago

Traceback (most recent call last): File "/fssd2/user-data/gsarridis/mammoth-commons/demonstrator/app.py", line 3, in from demonstrator.backend.routes import initialize_routes File "/fssd2/user-data/gsarridis/mammoth-commons/demonstrator/backend/routes.py", line 3, in from demonstrator.backend.handlers.handle_fairness_analysis import File "/fssd2/user-data/gsarridis/mammoth-commons/demonstrator/backend/handlers/handle_fairness_analysis.py", line 2, in from demonstrator.backend.loaders import ( File "/fssd2/user-data/gsarridis/mammoth-commons/demonstrator/backend/loaders.py", line 20, in from catalogue.metrics.model_card import model_card File "/fssd2/user-data/gsarridis/mammoth-commons/catalogue/metrics/model_card.py", line 10, in def model_card( File "/fssd2/user-data/gsarridis/mammoth-commons/mammoth/integration.py", line 60, in wrapper type_hints = get_type_hints(method) File "/mnt/cephfs/home/gsarridis/anaconda3/envs/dl310/lib/python3.10/typing.py", line 1873, in get_type_hints value = Optional[value] File "/mnt/cephfs/home/gsarridis/anaconda3/envs/dl310/lib/python3.10/typing.py", line 312, in inner return func(args, **kwds) File "/mnt/cephfs/home/gsarridis/anaconda3/envs/dl310/lib/python3.10/typing.py", line 403, in getitem return self._getitem(self, parameters) File "/mnt/cephfs/home/gsarridis/anaconda3/envs/dl310/lib/python3.10/typing.py", line 529, in Optional arg = _type_check(parameters, f"{self} requires a single type.") File "/mnt/cephfs/home/gsarridis/anaconda3/envs/dl310/lib/python3.10/typing.py", line 176, in _type_check raise TypeError(f"{msg} Got {arg!r:.100}.") TypeError: typing.Optional requires a single type. Got <mammoth.integration.Options object at 0x7f84c3321300>.

maniospas commented 1 week ago

Managed to replicate. It seems I accidentally used features from newer Python versions that are not backwards compatible with 3.10. Working on creating compatibility with older versions.

Temporary fix: upgrade to Python 3.12.

maniospas commented 1 week ago

Update: it runs properly in my local Python 3.10 now. Can you please pull and check that it runs in yours too @gsarridis ? If so, please close this issue.