Download python_lora_dataset_builder/pipeline/decision.py from api-relay/sadASDasd: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/pipeline/decision.py
- Command line
-
hf download hf://datasets/api-relay/sadASDasd/python_lora_dataset_builder/pipeline/decision.py
-
curl -L -o decision.py https://huggingface.co/datasets/api-relay/sadASDasd/resolve/main/python_lora_dataset_builder/pipeline/decision.py
1.24 kB
| def decide(c,n,coverage): | |
| if not c['ast_valid']:return 'reject','syntax_invalid' | |
| if not c['compile_valid']:return 'reject','compile_failed' | |
| if not c.get('secret_passed',True):return 'reject','secret_detected' | |
| if c['duplicate']:return 'skip',f"{c.get('duplicate_kind','duplicate')}_duplicate" | |
| # Tier activity (whether this tier is being processed this run at all) is | |
| # decided earlier, in runner.py, before a NIM request is ever spent. By the | |
| # time a record reaches here it's already an active tier, so we don't gate | |
| # on basic_tier_allowed again — doing so would incorrectly skip every | |
| # active tier-2/tier-3 record right after paying for its NIM review. | |
| if c.get('execution_status')=='failed':return 'reject','execution_failed' | |
| if not n['valid']:return 'reject','nim_invalid' | |
| for k in ('correctness','instruction_alignment'): | |
| if n['scores'][k]<85:return 'reject',f'{k}_below_85' | |
| if n['scores']['scope_fit']<85:return 'skip','scope_fit_below_85' | |
| s=n['overall_score'] | |
| if s<80:return 'reject','score_below_80' | |
| if s<=84:return 'manual_review','score_80_to_84' | |
| if s<=89:return ('include','coverage_needed') if coverage.needs_coverage(n['dominant_topic']) else ('skip','coverage_full') | |
| return 'include','score_90_plus' | |