Please follow the instructions below to run the SceneGenAgent inference with offline or API-based models.
We take our LoRA fine-tuned Llama-3.1-70B-Instruct as an example. Here is the full list of LoRA modules for Llama-3.1-70B-Instruct we released:
Name | HF Repo |
---|---|
SceneGenAgent-Llama-3.1-70B-assign-placement | 🤗 HF Repo |
SceneGenAgent-Llama-3.1-70B-check-positional-error | 🤗 HF Repo |
SceneGenAgent-Llama-3.1-70B-fix-positional-error | 🤗 HF Repo |
You can download the weights of Llama-3.1-70B-Instruct at HF Repo.
The models should be served with OpenAI-compatible servers. For example, to serve Llama-3.1-70B along with multiple LoRA adapters with vLLM:
vllm serve <Llama-3.1-70B path> --tensor_parallel_size 2 --enable-lora --lora-modules assign_placement=<assign placement lora path> check_positional_error=<check positional error lora path> fix_positional_error=<fix positional error lora path> --max-lora-rank 64
Note that serving Llama-3.1-70B with LoRA adapters takes approximately 160GB of GPU memory.
For OpenAI models, we have implemented GPT4O
in model.py which supports other models as well should you change its model_name
. if you use our GPT4O
implementation, you should create a file openai_key
and add your API key.
For models incompatible with OpenAI API, you should create a child class of Model
in model.py and implement its generate and invoke methods. generate
accepts a single string as the prompt
argument and invoke
accepts multiple rounds of conversation as the messages
argument.
- Deploy the models following Model Deployment.
- Set the models you want to use in each part of SceneGenAgent in demo.py. We have implemented
LocalModel
for you in model.py, and you may changemodel_name
andbase_url
ofLocalModel
, set the models asGPT4O
to serve API models, or use any self-implemented model objects. Setting a model toNone
causes this part of SceneGenAgent to use the default model. - Run the demo with the following command:
python demo.py
- Deploy the models following Model Deployment.
- Extract benchmark data with:
cd benchmark tar -xzvf test_data.csv.tar.gz cd ..
- Set the models you want to use in each part of SceneGenAgent in eval.py. We have implemented
LocalModel
for you in model.py, and you may changemodel_name
andbase_url
ofLocalModel
, set the models asGPT4O
to serve API models, or use any self-implemented model objects. Setting a model toNone
causes this part of SceneGenAgent to use the default model. - Run evaluation with the following command:
The generated code is stored in
bash eval.sh
output/generation.jsonl
by default. To render the scene, run the code for each description in Process Simulate.