princeton-nlp / tree-of-thought-llm

[NeurIPS 2023] Tree of Thoughts: Deliberate Problem Solving with Large Language Models

Home Page:https://arxiv.org/abs/2305.10601

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use custom inputs?

ViperVille007 opened this issue · comments

Is it possible to test out any of the tasks on custom input?
Say, for the Game24 task, I don't wish to use any of the records in the index but want to feed a set of 4 numbers of my choice. How to execute that?

Simplest hack:

from tot.methods.bfs import solve
from tot.tasks.game24 import Game24Task

args = argparse.Namespace(backend='gpt-4', temperature=0.7, task='game24', naive_run=False, prompt_sample=None, method_generate='propose', method_evaluate='value', method_select='greedy', n_generate_sample=1, n_evaluate_sample=3, n_select_sample=5)

task = Game24Task()
task.data.append("1 2 3 4")
ys, infos = solve(args, task, -1)
print(ys[0])