guidance
guidance copied to clipboard
Compatibility of Mock LLM on the #Select feature
The bug The current implementation of Mock LLM use #select.
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.
import guidance
default_ans = ['C' for _ in range(200000)] # Choose C for default
llm = guidance.llms.Mock(default_ans)
program = guidance(""""ANSWER: {{#select 'answer'}}A{{or}}B{{or}}C{{or}}D{{/select}}""", llm=llm)
program()
It will raise: AttributeError: 'Mock' object has no attribute 'end_of_text'
System info (please complete the following information):
- OS (e.g. Ubuntu, Windows 11, Mac OS, etc.): tested on Linux and MacOS
- Guidance Version (
guidance.__version__
): '0.0.63'