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

TypeError: Subscripted generics cannot be used with class and instance checks #236

Closed
iGangao opened this issue Feb 19, 2024 · 1 comment

Comments

@iGangao
Copy link

iGangao commented Feb 19, 2024

Traceback (most recent call last):
File "/home/agl/.local/bin/alpaca_eval", line 8, in
sys.exit(main())
File "/home/agl/.local/lib/python3.9/site-packages/alpaca_eval/main.py", line 468, in main
fire.Fire(ALL_FUNCTIONS)
File "/usr/local/conda/lib/python3.9/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/usr/local/conda/lib/python3.9/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/usr/local/conda/lib/python3.9/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/home/agl/.local/lib/python3.9/site-packages/alpaca_eval/main.py", line 106, in evaluate
leaderboard = utils.get_precomputed_leaderboard(precomputed_leaderboard, reference_outputs, annotators_config)
File "/home/agl/.local/lib/python3.9/site-packages/alpaca_eval/utils.py", line 391, in get_precomputed_leaderboard
leaderboard = load_or_convert_to_dataframe(precomputed_leaderboard).to_dict(orient="index")
File "/home/agl/.local/lib/python3.9/site-packages/alpaca_eval/utils.py", line 264, in load_or_convert_to_dataframe
if isinstance(df, AnyPath):
File "/usr/local/conda/lib/python3.9/typing.py", line 720, in instancecheck
return self.subclasscheck(type(obj))
File "/usr/local/conda/lib/python3.9/typing.py", line 723, in subclasscheck
raise TypeError("Subscripted generics cannot be used with"
TypeError: Subscripted generics cannot be used with class and instance checks

I get the above error when i run alpaca_eval evaluate --model_outputs 'example/outputs.json'.Can you tell me why this is?

@iGangao iGangao closed this as completed Feb 19, 2024
@Chirobocea
Copy link

Chirobocea commented Mar 22, 2024

For me, switching from python 3.9 to 3.11 did the trick.

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

No branches or pull requests

2 participants