RuntimeError: stack expects a non-empty TensorList when try to use clip_api
Traceback (most recent call last):
File "/mnt/data/hsz/transplant/llamafactory/data/mire/apiprompt.py", line 8, in
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hsz/miniconda3/envs/clip_api/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/hsz/miniconda3/envs/clip_api/lib/python3.11/site-packages/apiprompting/api_clip/hook.py", line 77, in finalize
self.attentions = torch.stack(self.attentions, axis=1) # [b, 1, n, d]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: stack expects a non-empty TensorList
@yu-rp Sorry to bother you. Can you help fix this?
Hi @Huangsz2021 , Thank you for your issue.
I believe this might be due to the limited number of layers in the Base model. You may consider using earlier layers by adjusting the --layer_index parameter.