#!/bin/bash # 定义要运行的程序命令 program="./benchmark -p ../../../models/chatglm2-6b/chatglm2-6b-flm/chatglm2-6b-int8.flm -f ../../../models/chatglm2-6b/prompts/100tokens.txt --loop" # 定义要运行的实例数量 num_instances=2 # 启动后台进程 for ((i=1; i<=num_instances; i++)); do $program & done # 压测持续时间(秒) test_duration=120 # 等待一段时间以进行压测 sleep $test_duration # 杀死所有后台进程 pkill -f benchmark