evalstone/bash/case/calc_glm52_cost.sh

29 lines
938 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# ============================================================
# GLM5.2 API 成本计算脚本
# 用法: bash bash/case/calc_glm52_cost.sh [结果CSV/Excel]
# 默认读取最新的 DS4-Flash-INT8 NO-Thinking 2.0 FULL 结果
# ============================================================
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$ROOT_DIR"
INPUT="${1:-$ROOT_DIR/P800模型能力评测结果 - DS4-Flash-INT8-NO-Thinking-2.0-FULL.csv}"
OUTPUT="${2:-$ROOT_DIR/results/P800_benchmark_cost_GLM52.csv}"
# GLM5.2 报价(示例):输入 8 元/百万 tokens输出 28 元/百万 tokens折扣 0.65
INPUT_PRICE=8
OUTPUT_PRICE=28
DISCOUNT=0.65
MODEL_NAME="GLM-5.2"
python3 tools/calculate_cost.py \
--input "$INPUT" \
--input-price "$INPUT_PRICE" \
--output-price "$OUTPUT_PRICE" \
--discount "$DISCOUNT" \
--model-name "$MODEL_NAME" \
--output "$OUTPUT"