Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

done_callback: Callable[[dict[str, Any]], None] = lambda x: None TypeError: 'type' object is not subscriptable #3

Open
tanshuai opened this issue Mar 17, 2023 · 3 comments

Comments

@tanshuai
Copy link

tanshuai commented Mar 17, 2023

Screenshot 2023-03-17 at 12 09 15 PM

No *.pth models found in the `models` folder, downloading...
 -> RAM: 64264081408
 -> VRAM: 16945709056
Downloading model RWKV-4-Pile-7B-ctx4096
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.8G/13.8G [04:00<00:00, 61.5MB/s]
Verifying file integrity...
-> Using model models/RWKV-4-Pile-7B-ctx4096.pth
init RWKVOPS, from super
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 582/582 [00:03<00:00, 154.73it/s]
Traceback (most recent call last):
  File "main.py", line 25, in <module>
    import model
  File "/home/ubuntu/RWKV/WebChatRWKVstic/model.py", line 186, in <module>
    class Task:
  File "/home/ubuntu/RWKV/WebChatRWKVstic/model.py", line 190, in Task
    done_callback: Callable[[dict[str, Any]], None] = lambda x: None
TypeError: 'type' object is not subscriptable
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla V100-SXM2...  On   | 00000000:00:1E.0 Off |                    0 |
| N/A   40C    P0    50W / 300W |      0MiB / 16384MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
@Starrylun
Copy link

我的这个问题解决了,把dict变成Dict,并在typing 中导入 Dict

@Starrylun
Copy link

另外补充一下,我的是3.8.16版本的python。
顺便问一下:
queue.Queue那行代码也是这个错误,怎么解决?是不同python版本的问题吗?

@Starrylun
Copy link

自己过来回答一下,
Q: queue.Queue那行代码也是这个错误,怎么解决?
A: 这是因为 python3.8 和 python3.10 在queue 上的区别造成的,因此要运行这个仓库需要配置好python版本3.10

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants