Error: No valid option generated in #select!
Message continues: Please post a GitHub issue since this should not happen :)
So here I am.
Raised from:
File "[..]\guidance\_program_executor.py", line 94, in run
await self.visit(self.parse_tree)
File "[..]\guidance\_program_executor.py", line 423, in visit
visited_children.append(await self.visit(child, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "[..]\guidance\_program_executor.py", line 423, in visit
visited_children.append(await self.visit(child, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "[..]\guidance\_program_executor.py", line 390, in visit
command_output = await command_function(*positional_args, **named_args)
File "[..]\guidance\library\_select.py", line 138
Running the following from tutorial.ipynb:
import guidance
guidance.llm = guidance.llms.OpenAI("text-davinci-003")
prompt = guidance('''Is the following sentence offensive? Please answer with a single word, either "Yes", "No", or "Maybe".
Sentence: {{example}}
Answer:{{#select "answer" logprobs='logprobs'}} Yes{{or}} No{{or}} Maybe{{/select}}''')
prompt = prompt(example="I hate pineapple on pizza, so that I am ready to kill because of it") //not my actual opinion, was trying to get it to reply "Yes".
print(prompt)
option_logprobs is:
{' Yes': -1000, ' No': -1000, ' Maybe': -1000}
Can you share the version you are using? I fix went out recently for this, and I can't reproduce it right now:
https://github.com/microsoft/guidance/issues/36#issuecomment-1553723123
@slundberg installed today.
Version: 0.0.47
and the with 0.0.48
It is an issue regarding whitespace looks like https://github.com/microsoft/guidance/issues/53
Thanks for reporting this! This should now be fixed in 0.0.49 :)