Skip to content

Commit

Permalink
feat: AutoFlow on TravelPlanner
Browse files Browse the repository at this point in the history
  • Loading branch information
lzl65825 committed Jul 1, 2024
1 parent 246b274 commit bba9e79
Show file tree
Hide file tree
Showing 34 changed files with 2,717 additions and 111 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,6 @@ cython_debug/
log
openagi_data
travel_database
results

.DS_Store
62 changes: 56 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,90 @@ conda install pytorch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 pytorch-cuda=

```
pip install -r requirements.txt
pip install -r requirements_travel.txt
```

3. Download the OpenAGI data from this [Google Drive link](https://drive.google.com/drive/folders/1AjT6y7qLIMxcmHhUBG5IE1_5SnCPR57e?usp=share_link), unzip it to the `AutoFlow` directory and rename it as `openagi_data`.

4. Make sure you are in the *AutoFlow/src* folder before running the codes. Otherwise,
4. Download the [database](https://drive.google.com/file/d/1pF1Sw6pBmq2sFkJvm-LzJOqrmfWoQgxE/view?usp=drive_link) and unzip it to the `AutoFlow` directory (i.e., `your/path/AutoFlow`) and rename it as `travel_database`.

5. Make sure you are in the *AutoFlow/src* folder before running the codes. Otherwise,

```
cd src
```

## Running Command Examples

OpenAGI on gpt-4-1106-preview:
(Notice that --model_name can be different from --auto_model_name)

OpenAGI task when using gpt-4-1106-preview as the workflow interpreter LLM:
```commandline
python auto_agi.py
python auto_main.py
--flow_name=OpenAGI_Flow.txt
--task=OpenAGI
--model_name="gpt-4-1106-preview"
--auto_model_name="gpt-4-1106-preview"
--log_file_name=../log/autoagi_gpt4gpt.txt
--output_dir=./gpt4gpt
--auto_flow_name="autoagi_gpt4gpt_Flow.txt"
--auto_epoch=30
--openai_key="YOUR OPENAI KEY"
--max_round=20
```

OpenAGI on TheBloke/Mixtral-8x7B-Instruct-v0.1-GPTQ:
OpenAGI task when using TheBloke/Mixtral-8x7B-Instruct-v0.1-GPTQ as the workflow interpreter LLM:
```commandline
python auto_agi.py
python auto_main.py
--flow_name=OpenAGI_Flow.txt
--task=OpenAGI
--model_name="TheBloke/Mixtral-8x7B-Instruct-v0.1-GPTQ"
--auto_model_name="mistralai/Mixtral-8x7B-Instruct-v0.1"
--log_file_name=../log/autoagi_mixtral4mixtral.txt
--output_dir=./mixtral4mixtral
--auto_flow_name="autoagi_mixtral4mixtral_Flow.txt"
--auto_epoch=30
--openai_key="YOUR OPENAI KEY"
--max_round=20
```

TravelPlanner task when using gpt-4-1106-preview as the workflow interpreter LLM:
```commandline
python auto_main.py
--flow_name=TravelPlanner_Flow_manual.txt
--tool_name=tools.txt
--task=TravelPlanner
--model_name="gpt-4-1106-preview"
--auto_model_name="gpt-4-1106-preview"
--log_file_name=../log/auto_travel_gpt4gpt.txt
--auto_flow_name=TravelPlanner_Flow_gpt4gpt.txt
--auto_epoch=30
--openai_key="YOUR OPENAI KEY"
--max_round=100
```

TravelPlanner task when using TheBloke/Mixtral-8x7B-Instruct-v0.1-GPTQ as the workflow interpreter LLM:
```commandline
python auto_main.py
--flow_name=TravelPlanner_Flow_manual.txt
--tool_name=tools.txt
--task=TravelPlanner
--auto_model_name=gpt-4-1106-preview
--model_name=TheBloke/Mixtral-8x7B-Instruct-v0.1-GPTQ
--log_file_name=../log/auto_travel_gpt4mixtral.txt
--auto_flow_name=TravelPlanner_Flow_gpt4mixtral.txt
--auto_epoch=30
--max_round=100
```

## Known Issues

[PPOTrainer](https://huggingface.co/docs/trl/main/en/ppo_trainer) class in the latest version of [trl](https://github.com/huggingface/trl) package (==0.9.4) has a known [issue](https://github.com/huggingface/trl/issues/1691) when using multiple GPUs for reinforcement learning.

## Generated Workflow

In the `AutoFlow/src/info/OpenAGI` folder, there are manually designed workflow and automatically generated workflows. The manual workflow is `OpenAGI_Flow_manual.txt`, and the file name of automatically generated workflows is in the form of `OpenAGI_Flow_manual_*4*.txt`. For example, `OpenAGI_Flow_manual_gpt4mixtral.txt` means the workflow is generated by GPT and used for Mixtral as the interpreter LLM.

## Reference

- We leveraged the dataset of [OpenAGI](https://github.com/agiresearch/OpenAGI) projects and based on [CoRE language] (https://github.com/agiresearch/CoRE) to implement our experiment.
- We leveraged the dataset of [OpenAGI](https://github.com/agiresearch/OpenAGI) and [TravelPlanner](https://github.com/OSU-NLP-Group/TravelPlanner) projects and based on [CoRE language] (https://github.com/agiresearch/CoRE) to implement our experiment.
9 changes: 9 additions & 0 deletions requirements_travel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
langchain==0.1.4
pandas==2.0.1
tiktoken==0.4.0
openai==1.13.3
langchain_google_genai==0.0.4
gradio==3.50.2
datasets==2.15.0
tiktoken==0.4.0
func_timeout==4.3.5
Loading

0 comments on commit bba9e79

Please sign in to comment.