File size: 1,812 Bytes
5e79b62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# # MMAU-mini (topp=0.9, temp=0.7)
# DELTA=125
# TOP_K=0
# TOP_P=0.9
# TEMPERATURE=0.7
# INPUT_JSON=/path/to/MMAU-test/mini-vila_original.json
# DATASET_NAME=MMAU_mini

# INPUT_JSON is a json file of the following format
# [
#     {
#         "id": 0,
#         "sound": "path/to/mmau-test-mini-audios/3fe64f3d-282c-4bc8-a753-68f8f6c35652.wav",
#         "conversations": [
#             {"from": "human", "value": "<sound>\nHow many times does the word 'otter' appear in the sentence? Choose the correct option from the following options:\n(A) one\n(B) zero\n(C) one\n(D) three."},
#             {"from": "gpt", "value": "N/A"}
#         ]
#     },
#     ...
# ]

# LS Clean (greedy sampling)
DELTA=4
TOP_K=0
TOP_P=1.0
TEMPERATURE=1.0
INPUT_JSON=/path/to/input.json
DATASET_NAME=ls_clean

# INPUT_JSON is a json file of the following format
# [
#     {
#         "id": "7729-102255-0000",
#         "sound": "path/to/test-clean/7729/102255/7729-102255-0000.wav",
#         "conversations": [
#             {"from": "human", "value": "Transcribe the speech in the input audio.\n<sound>"},
#             {"from": "gpt", "value": "N/A"}
#         ]
#     },
#     ...
# ]

for GPU in {0..0}
do
    START_IDX=$((GPU*DELTA))
    END_IDX=$((START_IDX+DELTA))
    OUTPUT_JSONL=./outputs/${DATASET_NAME}_topk${TOP_K}_topp${TOP_P}_temp${TEMPERATURE}_${START_IDX}_to_${END_IDX}.jsonl \
    
    CUDA_VISIBLE_DEVICES=$GPU python3 inference_scripts_hf/inference_hf.py \
            --hf-model-path checkpoint_folder_full/ \
            --input-json $INPUT_JSON \
            --output-jsonl $OUTPUT_JSONL \
            --start-idx $START_IDX \
            --end-idx $END_IDX \
            --max-new-tokens 8192 \
            --temperature $TEMPERATURE \
            --top-p $TOP_P \
            --top-k $TOP_K & 
done 
wait