# Data Preparation ## Alignment Pretraining Data #### Audiocap To begin, download and preprocess the original dataset as outlined in [prepara.md](T_X_pair_data/audiocap/prepare.md). This will yield the following directory and files: ```angular2html data/T-X_pair_data/audiocap ├── audiocap.json ├── audios | ├── 91139.wav | ├── 11543.wav | └── ... ``` Next, run [prepare_data.py](prepare_data.py) to preprocess the Audiocap data for encoding-side audio comprehension and decoding-side audio generation. This process will add additional JSON files for comprehension and generation purposes, as shown below: ```angular2html data/T-X_pair_data/audiocap ├── audiocap.json ├── audiocap_comprehension.json ├── audiocap_generation.json ├── audios | ├── 91139.wav | ├── 11543.wav | └── ... ``` ---------------- #### CC3M Firstly, download and preprocess the original dataset as outlined in [prepare.md](T_X_pair_data/cc3m/prepare.md). This will yield the following directory and files: ```angular2html data/T-X_pair_data/cc3m ├── cc3m.json ├── images | ├── 001315438.jpg | ├── 001313716.jpg | └── ... ``` Then, run [prepare_data.py](prepare_data.py) to preprocess the CC3M data for encoding-side image comprehension and decoding-side image generation. ```angular2html data/T-X_pair_data/cc3m ├── cc3m.json ├── cc3m_comprehension.json ├── cc3m_generation.json ├── images | ├── 001315438.jpg | ├── 001313716.jpg | └── ... ``` --------------- #### webvid Firstly, download and preprocess the original dataset as outlined in [prepare.md](T_X_pair_data/webvid/prepare.md). This will yield the following directory and files: ```angular2html data/T-X_pair_data/webvid ├── webvid.json ├── videos | ├── 31353427.mp4 | ├── 14781349.mp4 | └── ... ``` Or just run the following command: ``` bash download.sh # download the dataset bash preprocess.sh # uncompress the dataset ``` Then, run [prepare_data.py](prepare_data.py) to preprocess the Webvid data for encoding-side video comprehension and decoding-side video generation: ```angular2html data/T-X_pair_data/webvid ├── webvid.json ├── webvid_comprehension.json ├── webvid_generation.json ├── videos | ├── 31353427.mp4 | ├── 14781349.mp4 | └── ... ``` ------------ ## Instruction Data #### T-T+X Data We provide the construction method in [construction directory](IT_data/T-T+X_data/construction), please refer to it for details. Then, run the [prepare_data.py](prepare_data.py) to preprocess the dataset format for instruction-tuning: ``` [ # audio instruction dataset { "audio_captions": [ "A vehicle engine works at regular pace and a man speeches" ], "audio_caption_embeddings": [ "34706.wav.npy" ], "conversations": [ { "from": "human", "value": "I'm working on a project that requires the sound of a vehicle engine working at a regular pace, along with a man giving a speech. Can you assist me with that?", "input_modality": "text" }, { "from": "gpt", "value": "Absolutely! I have just the audio clip you need. Imagine yourself transported to the scene: the steady hum of a vehicle engine reverberates in the background, creating an ambient backdrop. Amidst this mechanical symphony, a man's voice takes center stage, delivering an engaging and inspiring speech that captivates the listener's attention.