guidance icon indicating copy to clipboard operation
guidance copied to clipboard

Compatibility of Mock LLM on the #Select feature

Open AndyJZhao opened this issue 1 year ago • 0 comments

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'

AndyJZhao avatar Jun 16 '23 13:06 AndyJZhao