DouDou commited on
Commit
28e5d57
·
verified ·
1 Parent(s): 065e39b

Upload data3/test_generation.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. data3/test_generation.sh +33 -0
data3/test_generation.sh ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # 测试脚本 - 生成少量样本以验证功能
3
+
4
+ # 检查是否设置了API密钥
5
+ if [ -z "$OPENAI_API_KEY" ]; then
6
+ echo "❌ 错误: 未设置 OPENAI_API_KEY 环境变量"
7
+ echo "请运行: export OPENAI_API_KEY='your-api-key'"
8
+ exit 1
9
+ fi
10
+
11
+ # 激活虚拟环境
12
+ source .venv/bin/activate
13
+
14
+ echo "🧪 测试运行 - 生成2个高质量样本"
15
+ echo "================================"
16
+ echo ""
17
+
18
+ # 运行脚本生成2个样本
19
+ python3 generate_problems_openai.py \
20
+ --max-samples 2 \
21
+ --min-score 90 \
22
+ --model gpt-4o-mini \
23
+ --output test_problems.jsonl
24
+
25
+ echo ""
26
+ echo "================================"
27
+ echo "✅ 测试完成!"
28
+ echo ""
29
+ echo "查看结果:"
30
+ echo " cat test_problems.jsonl | python3 -m json.tool | head -n 50"
31
+ echo ""
32
+ echo "查看生成的问题数量:"
33
+ echo " wc -l test_problems.jsonl"