### Install dependencies for HotPotQA Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md Installs the Python module dependencies listed in requirements.txt for the HotPotQA setup. ```bash pip install -r requirements.txt ``` -------------------------------- ### Sanity-check example samples Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Evaluates the provided example samples, expecting a pass@1 of 0.5. Uses the --problem_file flag to specify the problem file. ```bash $ evaluate_functional_correctness data/example_samples.jsonl --problem_file=data/example_problem.jsonl Reading samples... 6it [00:00, 3397.11it/s] Running example suites... 100%|...| 6/6 [00:03<00:00, 1.96it/s] Writing results to data/example_samples.jsonl_results.jsonl... 100%|...| 6/6 [00:00<00:00, 6148.50it/s] {'pass@1': 0.4999999999999999} ``` -------------------------------- ### Clone and install HumanEval repository Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Clones the human-eval repository from GitHub and installs it in editable mode using pip. ```bash $ git clone https://github.com/openai/human-eval $ pip install -e human-eval ``` -------------------------------- ### Create conda environment for HumanEval Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Creates a conda environment named 'codex' with Python 3.7 and activates it. Required before installing the repository. ```bash $ conda create -n codex python=3.7 $ conda activate codex ``` -------------------------------- ### Generate completions and save to samples.jsonl Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Reads problems, generates 200 completions per task, and writes them to samples.jsonl. Requires implementing generate_one_completion. ```python from human_eval.data import write_jsonl, read_problems problems = read_problems() num_samples_per_task = 200 samples = [ dict(task_id=task_id, completion=generate_one_completion(problems[task_id]["prompt"])) for task_id in problems for _ in range(num_samples_per_task) ] write_jsonl("samples.jsonl", samples) ``` -------------------------------- ### Clone repo and enter WebShop directory Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md Clones the LATS repository and changes into the 'webshop' directory for the WebShop decision-making experiments. ```bash git clone https://github.com/andyz245/LanguageAgentTreeSearch && cd LanguageAgentTreeSearch/webshop ``` -------------------------------- ### Clone repo and enter HotPotQA directory Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md Clones the LATS repository and changes into the 'hotpot' directory for the HotPotQA reasoning + acting experiments. ```bash git clone https://github.com/andyz245/LanguageAgentTreeSearch && cd LanguageAgentTreeSearch/hotpot ``` -------------------------------- ### Clone repo and enter programming directory Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md Clones the LATS repository and changes into the 'programming' directory for the programming reasoning experiments. ```bash git clone https://github.com/andyz245/LanguageAgentTreeSearch && cd LanguageAgentTreeSearch/programming ``` -------------------------------- ### Show evaluate_functional_correctness help Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Displays the help message for the evaluation script, listing available options such as --k. ```bash $ evaluate_functional_correctness --help ``` -------------------------------- ### JSON Lines format for samples Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Each sample must be a single line in JSON Lines format with 'task_id' and 'completion' fields. The completion should contain only the completion without the prompt. ```json {"task_id": "Corresponding HumanEval task ID", "completion": "Completion only without the prompt"} ``` -------------------------------- ### Evaluate samples with evaluate_functional_correctness Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Runs the evaluation script on samples.jsonl, showing progress and final pass@k metrics. The script writes detailed results to samples.jsonl_results.jsonl. ```bash $ evaluate_functional_correctness samples.jsonl Reading samples... 32800it [00:01, 23787.50it/s] Running test suites... 100%|...| 32800/32800 [16:11<00:00, 33.76it/s] Writing results to samples.jsonl_results.jsonl... 100%|...| 32800/32800 [00:00<00:00, 42876.84it/s] {'pass@1': ..., 'pass@10': ..., 'pass@100': ...} ``` -------------------------------- ### Run HotPotQA experiments Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md Executes the shell script 'lats.sh' to run the paper experiments for HotPotQA. The script uses flags like --n_generate_sample, --n_evaluate_sample, and --iterations. ```bash sh lats.sh ``` -------------------------------- ### Run programming experiments Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md Executes the shell script 'run_lats.sh' to run the paper experiments for programming. Code adapted from https://github.com/noahshinn024/reflexion/tree/main. ```bash sh run_lats.sh ``` -------------------------------- ### Set OPENAI_API_KEY for HotPotQA Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md Sets the OPENAI_API_KEY environment variable to your OpenAI API key, required for running the HotPotQA experiments. ```bash export OPENAI_API_KEY= ``` -------------------------------- ### Memory allocation error message Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md Error message that may appear when the system is running out of RAM during evaluation. Recommended to free memory and retry. ```text malloc: can't allocate region ``` -------------------------------- ### BibTeX citation for LATS paper Source: https://github.com/andyz245/languageagenttreesearch/blob/main/README.md BibTeX entry for citing the Language Agent Tree Search paper in academic work. ```bibtex @misc{zhou2023language, title={Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models}, author={Andy Zhou and Kai Yan and Michal Shlapentokh-Rothman and Haohan Wang and Yu-Xiong Wang}, year={2023}, eprint={2310.04406}, archivePrefix={arXiv}, primaryClass={cs.AI} } ``` -------------------------------- ### BibTeX citation for HumanEval paper Source: https://github.com/andyz245/languageagenttreesearch/blob/main/programming/human-eval/README.md BibTeX entry for citing the paper 'Evaluating Large Language Models Trained on Code'. ```bibtex @article{chen2021codex, title={Evaluating Large Language Models Trained on Code}, author={Mark Chen and Jerry Tworek and Heewoo Jun and Qiming Yuan and Henrique Ponde de Oliveira Pinto and Jared Kaplan and Harri Edwards and Yuri Burda and Nicholas Joseph and Greg Brockman and Alex Ray and Raul Puri and Gretchen Krueger and Michael Petrov and Heidy Khlaaf and Girish Sastry and Pamela Mishkin and Brooke Chan and Scott Gray and Nick Ryder and Mikhail Pavlov and Alethea Power and Lukasz Kaiser and Mohammad Bavarian and Clemens Winter and Philippe Tillet and Felipe Petroski Such and Dave Cummings and Matthias Plappert and Fotios Chantzis and Elizabeth Barnes and Herbert-Voss and William Hebgen Guss and Alex Nichol and Alex Paino and Nikolas Tezak and Jie Tang and Igor Babuschkin and Suchir Balaji and Shantanu Jain and William Saunders and Christopher Hesse and Andrew N. Carr and Jan Leike and Josh Achiam and Vedant Misra and Evan Morikawa and Alec Radford and Matthew Knight and Miles Brundage and Mira Murati and Katie Mayer and Peter Welinder and Bob McGrew and Dario Amodei and Sam McCandlish and Ilya Sutskever and Wojciech Zaremba}, year={2021}, eprint={2107.03374}, archivePrefix={arXiv}, primaryClass={cs.LG} } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.