microsoft / JARVIS

JARVIS, a system to connect LLMs with ML community. Paper: https://arxiv.org/pdf/2303.17580.pdf
MIT License
23.68k stars 1.97k forks source link

`<GENERATED>` tag without dep fails #142

Open emillykkejensen opened 1 year ago

emillykkejensen commented 1 year ago

So I might have pulled your code apart, but anyway I found what I believe is a bug. What happens, if the task is returned with a <GENERATED> tag without dep? I presume that would make sense for the first task, as it doesn't rely on anything?

Anyways - I think a simple regex could do:

def fix_dep(tasks):
    for task in tasks:
        args = task["args"]
        task["dep"] = []
        for k, v in args.items():
            if re.match(r'<GENERATED>.+', v): # Do nothing if there is no dependency
                dep_task_id = int(v.split("-")[1])
                if dep_task_id not in task["dep"]:
                    task["dep"].append(dep_task_id)
        if len(task["dep"]) == 0:
            task["dep"] = [-1]
    return tasks

https://github.com/microsoft/JARVIS/blob/8d925aa33ff058375d1c891fffc63a65150d5009/server/awesome_chat.py#L245

827648313 commented 11 months ago

What does "dep=[-1]" mean ?