lucidrains / toolformer-pytorch

Implementation of Toolformer, Language Models That Can Use Tools, by MetaAI
MIT License
1.94k stars 124 forks source link

TypeError: 'type' object is not subscriptable #8

Closed ck-unifr closed 1 year ago

ck-unifr commented 1 year ago

Description

After installing toolformer with "$ pip install toolformer-pytorch", I tried to run the example. When I call "from toolformer_pytorch import Toolformer, PaLM", I have got a type error.

Screenshots

import torch from toolformer_pytorch import Toolformer, PaLM Traceback (most recent call last): File "", line 1, in File "/home/memect/ck/workspace/toolformer-pytorch/toolformer_pytorch/init.py", line 3, in from toolformer_pytorch.toolformer_pytorch import ( File "/home/memect/ck/workspace/toolformer-pytorch/toolformer_pytorch/toolformer_pytorch.py", line 110, in registry: dict[str, Callable], TypeError: 'type' object is not subscriptable

masfumy commented 1 year ago

Which version of python interpreter are you using? I resolved the problem by updating from 3.8 to 3.9. https://stackoverflow.com/questions/59101121/type-hint-for-a-dict-gives-typeerror-type-object-is-not-subscriptable

ck-unifr commented 1 year ago

Which version of python interpreter are you using? I resolved the problem by updating from 3.8 to 3.9. https://stackoverflow.com/questions/59101121/type-hint-for-a-dict-gives-typeerror-type-object-is-not-subscriptable

Thanks. The version of python was 3.8.