Download data/processed/batch_extract_trees.sh from AINativeOps/AINativeBench: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/datasets/AINativeOps/AINativeBench/resolve/main/data/processed/batch_extract_trees.sh
- Command line
-
hf download hf://datasets/AINativeOps/AINativeBench/data/processed/batch_extract_trees.sh
-
curl -L -o batch_extract_trees.sh https://huggingface.co/datasets/AINativeOps/AINativeBench/resolve/main/data/processed/batch_extract_trees.sh
1.34 kB
| # Batch-generate tree views for all langfuse_trace.json files | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| cd "$SCRIPT_DIR" || exit 1 | |
| echo "🔍 Scanning and processing all trace files..." | |
| echo "" | |
| count=0 | |
| success=0 | |
| failed=0 | |
| failed_files=() | |
| while IFS= read -r -d '' trace_file; do | |
| echo "Processing: $trace_file" | |
| if python3 "$SCRIPT_DIR/extract_trace_tree.py" "$trace_file" > /dev/null 2>&1; then | |
| ((success++)) | |
| else | |
| echo " ❌ Failed" | |
| ((failed++)) | |
| failed_files+=("$trace_file") | |
| fi | |
| ((count++)) | |
| # Show progress every 10 files | |
| if (( count % 10 == 0 )); then | |
| echo "" | |
| echo "📊 Progress: processed $count files (success: $success, failed: $failed)" | |
| echo "" | |
| fi | |
| done < <(find . -name "langfuse_trace.json" -type f -print0) | |
| echo "" | |
| printf '%*s\n' 60 '' | tr ' ' '=' | |
| echo "✨ Batch processing complete!" | |
| printf '%*s\n' 60 '' | tr ' ' '=' | |
| echo "Total processed: $count files" | |
| echo "Success: $success" | |
| echo "Failed: $failed" | |
| echo "" | |
| # If there are failed files, list them | |
| if [ $failed -gt 0 ]; then | |
| echo "❌ Failed files:" | |
| for failed_file in "${failed_files[@]}"; do | |
| echo " - $failed_file" | |
| done | |
| echo "" | |
| fi | |
| echo "💡 Tip: The tree is saved as execution_path.md next to langfuse_trace.json" | |