maitrix-org/llm-reasoners

visualizer fails for gsm8k

chris-aeviator opened this issue · 3 comments

when trying to load a gsm8k run with the visualizer, the code fails

    import pickle
    from reasoners.visualization import visualize
    with open("logs/gsm8k/myfolder/1.pkl", 'rb') as f:
        mcts_result = pickle.load(f)
    visualize(mcts_result)
  llm-reasoners/reasoners/visualization/tree_log.py:52, in TreeLog.from_mcts_results.<locals>.default_node_data_factory(n)
       51 def default_node_data_factory(n: MCTSNode) -> NodeData:
  ---> 52     return NodeData(n.state._asdict() if n.state else {})
  
  AttributeError: 'list' object has no attribute '_asdict'

EDIT:

the json file works fine with the online visualizer upload

EDIT 2:

where can I find the code for the visualizer, I see the code here connecting to the llm-reasoners.net front & backend which is really not ideal as a dependency.

Ber666 commented

Hi, could you try following the jupyter notebook under the gsm8k folder? The state defined in gsm8k example is a list, which is not supported in default_node_factory. We will fix it soon.

thanks - I never saw this file! Feel free to keep open or close this issue as is most convenient to you for PM.

Ber666 commented

Fixed