Closed jvhoffbauer closed 1 year ago
Thanks! OPT handles the position ID alignment with the KV cache internally, so we can just skip that step if there are no position ids. Just pushed a fix.
Reopening as a similar issue is back in 0.1.10
:
Code:
from guidance import models, select
gpt = models.Transformers('facebook/opt-125m')
prompt = "X"
labels = ['a', 'b']
gpt + prompt + select(labels)
Output:
TypeError: OPTForCausalLM.forward() got an unexpected keyword argument 'position_ids'
.
@slundberg Let me know if I can help by making a PR or if this can be quickly fixed on your end
It seems bug still exists?
The bug I get a
KeyError: 'position_ids'
when usingfacebook/opt-350m
which is a LLM available via the Huggingface model hub.To Reproduce Give a full working code snippet that can be pasted into a notebook cell or python file. Make sure to include the LLM load step so we know which model you are using.
System info (please complete the following information):
guidance.__version__
): 0.0.55The full error is