Evaluate BAGEL model
mainEVAL.md.repository·main·Indexed 27 days ago
https://github.com/bytedance-seed/bagelBAGEL is an open-source multimodal foundation model with 7B active parameters (14B total) designed for unified multimodal understanding and generation. It supports text-to-image generation, image editing, and complex world-modeling tasks such as multiview synthesis and world navigation. The model includes a 'thinking' process for intermediate reasoning and provides a Gradio WebUI with various quantization modes (NF4, INT8) for different VRAM capacities.
EVAL.md.To evaluate GEdit-Bench, modify the model path, output path, API key, and API URL in scripts/eval/run_gedit.sh, then execute the script. The evaluation uses gpt-4.1-2025-04-14.
bash script/eval/run_gedit.shTo set up the environment with sample data for T2I (text-to-image), Editing, and VLM (vision-language model) tasks, follow these steps:
Download and unzip the sample dataset:
wget -O bagel_example.zip https://lf3-static.bytednsdoc.com/obj/eden-cn/nuhojubrps/bagel_example.zip
unzip bagel_example.zip -d /dataVerify the directory hierarchy: The expected structure is:
t2i/: text-to-image (parquet format)editing/: image editing (parquet format)vlm/: contains images/ (JPEG/PNG) and llava_ov_si.jsonl (vision-language SFT conversations)Configure paths:
Edit every your_data_path placeholder in data/dataset_info.py to point to your actual data locations.
Extend data (Optional):
You can extend DATASET_INFO in data/dataset_info.py with your own parquet shards or JSONL files to mix additional data into training.
wget -O bagel_example.zip \
https://lf3-static.bytednsdoc.com/obj/eden-cn/nuhojubrps/bagel_example.zip
unzip bagel_example.zip -d /dataTo evaluate Vision-Language Model (VLM) performance on benchmarks like MME, MMBench, MMMU, MMVet, MathVista, and MMVP, use the scripts/eval/run_eval_vlm.sh script.
Requirements:
vlm directory with the following structure:data/vlm/
├── MathVista
├── mmbench
├── mme
├── MMMU
├── mm-vet
└── MMVP$openai_api_key in scripts/eval/run_eval_vlm.sh and your_api_url in eval/vlm/eval/mathvista/utilities.py. The default model is gpt-4o-2024-11-20.Execution: Set the following environment variables before running the script:
$model_path: Path to the model checkpoint.$output_path: Path where logs and results will be saved.$GPUS: Number of GPUs to use (increase for faster execution).$openai_api_key: Required for MathVista.Launch the BAGEL interface using app.py. Choose the command based on your GPU VRAM capacity:
--mode 2 --zh).--mode 3). Note: INT8 is not recommended for the 22-32GB range.# For 32GB+ VRAM GPU or multi GPUs.
python app.py
# For 12~32GB VRAM GPU, recommend using NF4 quantization. And use Chinese interface.
python app.py --mode 2 --zh
# For 22~32GB VRAM GPU, not recommended to use INT8 quantization.
python app.py --mode 3To start training, execute the provided shell script. You can modify the variables within the script to suit your specific training requirements. Refer to TRAIN.md for detailed instructions.
bash scripts/train.shTo set up the BAGEL environment, clone the repository, create a Conda environment with Python 3.10, install the required dependencies, and install flash_attn with no build isolation.
git clone https://github.com/bytedance-seed/BAGEL.git
cd BAGEL
conda create -n bagel python=3.10 -y
conda activate bagel
pip install -r requirements.txt
pip install flash_attn==2.5.8 --no-build-isolationTo evaluate ImgEdit-Bench, follow these steps for data preparation and execution.
Download the benchmark data from ImgEdit-Bench and extract it into a Benchmark directory. The structure must be:
Benchmark
├── hard
├── multiturn
└── singleturn
├── judge_prompt.json
├── singleturn.json
├── animal
├── architecture
├── clothes
├── compose
├── daily object
├── for_add
├── human
├── style
└── transportRun scripts/eval/run_imgedit.sh.
Required Settings:
$model_path: Path to the model checkpoint.$output_path: Path for logs.$openai_api_key: Set in scripts/eval/run_imgedit.sh.your_api_url: Set in eval/gen/imgedit/basic_bench.py.Default Configuration:
gpt-4o-2024-11-20cfg_text_scale: 4cfg_img_scale: 1.5cfg_renorm_min: 0 (for CFG Renorm)To evaluate RISEBench, download the benchmark data from RISEBench and place it in the data directory.
Required Directory Structure:
data/
├── datav2_total_w_subtask.json
├── causal_reasoning_images
├── logical_reasoning_images
├── spatial_reasoning_images
└── temporal_reasoning_imagesGenEval evaluation requires specific dependencies and a detector model.
1. Install Dependencies:
pip install open-clip-torch
pip install clip-benchmark
pip install --upgrade setuptools
sudo pip install -U openmim
sudo mim install mmengine mmcv-full==1.7.2
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection; git checkout 2.x
pip install -v -e .2. Download Detector:
cd ./eval/gen/geneval
mkdir model
bash ./evaluation/download_models.sh ./model3. Run Evaluation:
Execute scripts/eval/run_geneval.sh.
$model_path and $output_path.metadata_file to ./eval/gen/geneval/prompts/evaluation_metadata.jsonl.To evaluate the WISE benchmark, run scripts/eval/run_wise.sh.
Configuration:
$model_path and $output_path.$openai_api_key in scripts/eval/run_wise.sh.your_api_url in eval/gen/wise/gpt_eval_mp.py.gpt-4o-2024-05-13.think flag to enable thinking mode.To evaluate RISEBench, run the scripts/eval/run_rise.sh script. You must configure the model checkpoint path, the output log path, and the OpenAI API credentials.
Required Environment Variables/Settings:
$model_path: Path to the model checkpoint.$output_path: Path where evaluation logs will be saved.$openai_api_key: Set this within scripts/eval/run_rise.sh.your_api_url: Set this in eval/gen/rise/gpt_eval.py.Default Configuration:
gpt-4.1-2025-04-14cfg_text_scale: 4cfg_img_scale: 2.0cfg_renorm_min: 0 (for CFG Renorm)To use thinking mode, include the think flag/option as specified in the script.