evaluating-code-models
ما الذي تفعله
تشرح هذه المهارة كيفية تشغيل BigCode evaluation harness على نموذج توليد الشيفرة. وهي موجهة للباحثين والمطورين الذين يريدون قياس قدرات البرمجة أو مقارنتها.
متى تستخدمها
- ✓عندما تريد قياس نموذج شيفرة على اختبارات معيارية مثل HumanEval أو MBPP.
- ✓عندما تريد مقارنة أداء نموذجين لكتابة الشيفرة.
- ✓عندما تحتاج إلى فحص جودة توليد الشيفرة بعدة لغات برمجة.
رابط المهارة
https://github.com/Orchestra-Research/AI-Research-SKILLs/blob/main/11-evaluation/bigcode-evaluation-harness/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“قِس مدى نجاح نموذج الشيفرة هذا في حل مسائل Python باستخدام معيار HumanEval.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تثبّت الأداة، وتضبط Accelerate، وتشغّل أمرًا يحدد النموذج والمهام. تولّد الأداة عينات الشيفرة وتشغّلها على الاختبارات، ثم تعرض درجات pass at k.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
BigCode Evaluation Harness - Code Model Benchmarking
Quick Start
BigCode Evaluation Harness evaluates code generation models across 15+ benchmarks including HumanEval, MBPP, and MultiPL-E (18 languages).
Installation:
git clone https://github.com/bigcode-project/bigcode-evaluation-harness.git
cd bigcode-evaluation-harness
pip install -e .
accelerate config
Evaluate on HumanEval:
accelerate launch main.py \
--model bigcode/starcoder2-7b \
--tasks humaneval \
--max_length_generation 512 \
--temperature 0.2 \
--n_samples 20 \
--batch_size 10 \
--allow_code_execution \
--save_generations
View available tasks:
python -c "from bigcode_eval.tasks import ALL_TASKS; print(ALL_TASKS)"
Common Workflows
Workflow 1: Standard Code Benchmark Evaluation
Evaluate model on core code benchmarks (HumanEval, MBPP, HumanEval+).
Checklist:
Code Benchmark Evaluation:
- [ ] Step 1: Choose benchmark suite
- [ ] Step 2: Configure model and generation
- [ ] Step 3: Run evaluation with code execution
- [ ] Step 4: Analyze pass@k results
Step 1: Choose benchmark suite
Python code generation (most common):
- HumanEval: 164 handwritten problems, function completion
- HumanEval+: Same 164 problems with 80× more tests (stricter)
- MBPP: 500 crowd-sourced problems, entry-level difficulty
- MBPP+: 399 curated problems with 35× more tests
Multi-language (18 languages):
- MultiPL-E: HumanEval/MBPP translated to C++, Java, JavaScript, Go, Rust, etc.
Advanced:
- APPS: 10,000 problems (introductory/interview/competition)
- DS-1000: 1,000 data science problems across 7 libraries
Step 2: Configure model and generation
# Standard HuggingFace model
accelerate launch main.py \
--model bigcode/starcoder2-7b \
--tasks humaneval \
--max_length_generation 512 \
--temperature 0.2 \
--do_sample True \
--n_samples 200 \
--batch_size 50 \
--allow_code_execution
# Quantized model (4-bit)
accelerate launch main.py \
--model codellama/CodeLlama-34b-hf \
--tasks humaneval \
--load_in_4bit \
--max_length_generation 512 \
--allow_code_execution
# Custom/private model
accelerate launch main.py \
--model /path/to/my-code-model \
--tasks humaneval \
--trust_remote_code \
--use_auth_token \
--allow_code_execution
Step 3: Run evaluation
# Full evaluation with pass@k estimation (k=1,10,100)
accelerate launch main.py \
--model bigcode/starcoder2-7b \
--tasks humaneval \
--temperature 0.8 \
--n_samples 200 \
--batch_size 50 \
--allow_code_execution \
--save_generations \
--metric_output_path results/starcoder2-humaneval.json
Step 4: Analyze results
Results in results/starcoder2-humaneval.json:
{
"humaneval": {
"pass@1": 0.354,
"pass@10": 0.521,
"pass@100": 0.689
},
"config": {
"model": "bigcode/starcoder2-7b",
"temperature": 0.8,
"n_samples": 200
}
}
Workflow 2: Multi-Language Evaluation (MultiPL-E)
Evaluate code generation across 18 programming languages.
Checklist:
Multi-Language Evaluation:
- [ ] Step 1: Generate solutions (host machine)
- [ ] Step 2: Run evaluation in Docker (safe execution)
- [ ] Step 3: Compare across languages
Step 1: Generate solutions on host
# Generate without execution (safe)
accelerate launch main.py \
--model bigcode/starcoder2-7b \
--tasks multiple-py,multiple-js,multiple-java,multiple-cpp \
--max_length_generation 650 \
--temperature 0.8 \
--n_samples 50 \
--batch_size 50 \
--generation_only \
--save_generations \
--save_generations_path generations_multi.json
Step 2: Evaluate in Docker container
# Pull the MultiPL-E Docker image
docker pull ghcr.io/bigcode-project/evaluation-harness-multiple
# Run evaluation inside container
docker run -v $(pwd)/generations_multi.json:/app/generations.json:ro \
-it evaluation-harness-multiple python3 main.py \
--model bigcode/starcoder2-7b \
--tasks multiple-py,multiple-js,multiple-java,multiple-cpp \
--load_generations_path /app/generations.json \
--allow_code_execution \
--n_samples 50
Supported languages: Python, JavaScript, Java, C++, Go, Rust, TypeScript, C#, PHP, Ruby, Swift, Kotlin, Scala, Perl, Julia, Lua, R, Racket
Workflow 3: Instruction-Tuned Model Evaluation
Evaluate chat/instruction models with proper formatting.
Checklist:
الأسئلة الشائعة
ما هو pass at k؟
هو درجة لاحتمال أن تنجح واحدة على الأقل من k إجابة مولّدة في الاختبارات.
كم لغة يغطي MultiPL-E؟
تقول المهارة إن MultiPL-E يغطي 18 لغة برمجة.
هل تشغّل الأداة الشيفرة المولّدة؟
نعم، عند السماح بتنفيذ الشيفرة، وهذا ما يفعله أمر المثال في المهارة.
التفاصيل
الوصف الأصلي من المؤلف
Evaluates code generation models across HumanEval, MBPP, MultiPL-E, and 15+ benchmarks with pass@k metrics. Use when benchmarking code models, comparing coding abilities, testing multi-language support, or measuring code generation quality. Industry standard from BigCode Project used by HuggingFace leaderboards.
الشعبية
- نجوم GitHub
- 14k
- الترتيب
- #11211
- الترخيص
- MIT
- آخر تحديث
- 10/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
autoresearch
14kيرشد وكيلك خلال مشروع بحث كامل في الذكاء الاصطناعي، من مراجعة الأدبيات إلى التجارب والكتابة، بدورة متكررة من الاختبار والمراجعة.
prompt-guard
14kيتيح لوكيلك فحص النصوص بحثًا عن محاولات حقن الأوامر وكسر القيود قبل وصولها إلى تطبيق الذكاء الاصطناعي، باستخدام مصنّف Meta الصغير.
pytorch-fsdp2
14kيوضح لوكيلك كيفية إضافة تجزئة PyTorch FSDP2 إلى سكربت التدريب، حتى تُقسَّم النماذج الكبيرة على عدة وحدات معالجة رسومية وتُحفظ بشكل صحيح.
ml-training-recipes
14kيمنح وكيلك وصفات تدريب مجربة للشبكات العصبية، تشمل اختيار النموذج والمحسّنات ومعدلات التعلم ومعالجة قفزات الخسارة.
مهارات مشابهة
pytorch-patterns
280kيساعد وكيلك على استخدام PyTorch في نماذج تعلم الآلة. يطبّق أفضل الممارسات لتدريب النماذج بكفاءة ويضمن نتائج قابلة للتكرار.
evm-token-decimals
280kيساعد وكيلك على تجنب أخطاء الأعداد العشرية عبر شبكات البلوكتشين المختلفة. يضمن دقة قيم الرموز في المعاملات والحسابات.
ito-inference
280kيتيح لوكيلك التحقق من توفر نماذج الذكاء الاصطناعي للاستخدام. يربط طلب الحوسبة بخدمة النموذج الجاهزة.