Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: No valid option generated in #select! Please post a GitHub issue since this should not happen :) #123

Open
zxfpro opened this issue May 28, 2024 · 1 comment

Comments

@zxfpro
Copy link

zxfpro commented May 28, 2024

I meeting this error when to run examples/classification_skill_with_CoT.ipynb

import pandas as pd
df = pd.DataFrame([
{"text": "Apple product with a sleek design.", "category": "Electronics"},
{"text": "Laptop stand for the kitchen.", "category": "Furniture/Home Decor"},
{"text": "Chocolate leather boots.", "category": "Footwear/Clothing"},
{"text": "Wooden cream for surfaces.", "category": "Furniture/Home Decor"},
{"text": "Natural finish for your lips.", "category": "Beauty/Personal Care"}
])
df

from adala.agents import Agent
from adala.skills import ClassificationSkill

agent = Agent(
skills=ClassificationSkill(
name='product_category_classification',
instructions='Categorize text into different product categories.',
input_template='Text: {text}',
output_template='Thoughts: {thoughts}\n\nClassification: {predicted_class}',
labels={'predicted_class': [
"Footwear/Clothing",
"Electronics",
"Food/Beverages",
"Furniture/Home Decor",
"Beauty/Personal Care"
]},
)
)

agent.run(df)

Applying skill: product_category_classification
60%|████████████████████████████████████ | 3/5 [00:05<00:04, 2.04s/it]
Traceback (most recent call last):
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 109, in run
await self.visit(self.parse_tree, VariableStack([self.program._variables], self))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 186, in visit
out = await self.visit(tree, variable_stack)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in visit
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 379, in visit
command_output = await command_function(*positional_args, **named_args)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/library/_select.py", line 177, in select
raise ValueError("No valid option generated in #select! Please post a GitHub issue since this should not happen :)")
ValueError: No valid option generated in #select! Please post a GitHub issue since this should not happen :)

Error in program: No valid option generated in #select! Please post a GitHub issue since this should not happen :)
100%|████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 4.03s/it]
Traceback (most recent call last):
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 109, in run
await self.visit(self.parse_tree, VariableStack([self.program._variables], self))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 186, in visit
out = await self.visit(tree, variable_stack)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 559, in visit
visited_children.append(await self.visit(child, variable_stack, inner_next_node, inner_next_next_node, inner_prev_node, node, parent_node))
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in visit
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 266, in
visited_children = [await self.visit(child, variable_stack, next_node, next_next_node, prev_node, node, parent_node) for child in node]
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/_program_executor.py", line 379, in visit
command_output = await command_function(*positional_args, **named_args)
File "/Users/zhaoxuefeng/opt/miniconda3/envs/adala/lib/python3.10/site-packages/guidance/library/_select.py", line 177, in select
raise ValueError("No valid option generated in #select! Please post a GitHub issue since this should not happen :)")
ValueError: No valid option generated in #select! Please post a GitHub issue since this should not happen :)

Error in program: No valid option generated in #select! Please post a GitHub issue since this should not happen :)

@ConstantinHvber
Copy link

I got the same error with the same example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants