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

deepseek r1 1.5 can not output json format vs gemma 2b and llama 1b can #284

Open
HuaizhengZhang opened this issue Feb 3, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@HuaizhengZhang
Copy link
Contributor

HuaizhengZhang commented Feb 3, 2025

Image

Image

Image

@HuaizhengZhang HuaizhengZhang added the bug Something isn't working label Feb 3, 2025
Copy link

dosubot bot commented Feb 3, 2025

To resolve the TypeError: 'NoneType' object is not iterable in the process_plan function, you can modify the function to handle cases where plan_dict.get('tasks') returns None. Use a default empty list if tasks is not found:

def process_plan(plan_dict: dict):
    plan_str = ""
    tasks = plan_dict.get('tasks', [])
    for task in tasks:
        plan_str += f"[green][Task]:[/green] {task.get('task')}\n[green][Description]:[/green] {task.get('description')}\n\n"

    return plan_str

This change ensures that if plan_dict.get('tasks') returns None, an empty list is used instead, preventing the TypeError [1].

Regarding the JSON output issue with DeepSeek R1 1.5, ensure that the model's response adheres to the JSON format specified in the PlanAgent class. The class includes a JSON mode prompt with an example JSON output format. If the response is not in JSON format, the plan method attempts to parse it as JSON and uses the clean_json_string function if a JSONDecodeError occurs [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@HuaizhengZhang HuaizhengZhang changed the title deepseek r1 1.5 can not output json format vs gemma 2b can output deepseek r1 1.5 can not output json format vs gemma 2b and llama 1b can Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants