Download audit_node.js from GRIMIAI-VNAnhdev/GROMAIVN: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/datasets/GRIMIAI-VNAnhdev/GROMAIVN/resolve/main/audit_node.js
- Command line
-
hf download hf://datasets/GRIMIAI-VNAnhdev/GROMAIVN/audit_node.js
-
curl -L -o audit_node.js https://huggingface.co/datasets/GRIMIAI-VNAnhdev/GROMAIVN/resolve/main/audit_node.js
1.85 kB
| const fs = require('fs'); | |
| const path = require('path'); | |
| const root = 'C:\\Users\\Admin\\Desktop\\GROM_ktined'; | |
| const excludes = new Set(['.git','.venv','venv','node_modules','__pycache__','dist','build','.cache']); | |
| const dataExt = new Set(['.txt','.jsonl','.json','.md','.csv','.yaml','.yml','.tsv']); | |
| const src = path.resolve(root,'data','data','sources'); | |
| const py = []; | |
| const outside = []; | |
| const all = []; | |
| function human(n){const u=['B','KiB','MiB','GiB'];let i=0;while(n>=1024&&i<3){n/=1024;i++;}return n.toFixed(2)+' '+u[i];} | |
| function walk(d){for(const e of fs.readdirSync(d,{withFileTypes:true})){if(excludes.has(e.name))continue;const p=path.join(d,e.name);if(e.isDirectory())walk(p);else{all.push(p);const ext=path.extname(p).toLowerCase();if(ext==='.py'||ext==='.pyw')py.push(p);if(dataExt.has(ext)&&!path.resolve(p).startsWith(src+path.sep))outside.push(p);}}} | |
| walk(root); | |
| let out=['=== DATA FILES OUTSIDE sources ===']; | |
| for(const p of outside)out.push(`${human(fs.statSync(p).size)}\t${p}`); | |
| out.push('=== PYTHON FILES ===',...py); | |
| out.push('=== PYTHON REFERENCES ==='); | |
| const pats=['dataset','sources','raw_text','train.txt','dialogue_dedup','glob','rglob','os.walk','external_datasets','local_uploads','inbox_done','needs_review']; | |
| for(const p of py){let lines;try{lines=fs.readFileSync(p,'utf8').split(/\r?\n/)}catch{continue;}lines.forEach((line,i)=>{const low=line.toLowerCase();if(pats.some(x=>low.includes(x.toLowerCase())))out.push(`${p}:${i+1}:${line.trim()}`);});} | |
| out.push('=== LARGEST FILES ==='); | |
| all.map(p=>[fs.statSync(p).size,p]).sort((a,b)=>b[0]-a[0]).slice(0,80).forEach(([s,p])=>out.push(`${human(s)}\t${p}`)); | |
| out.push('=== DONE ==='); | |
| fs.writeFileSync(path.join(root,'audit_node.txt'),out.join('\n'),'utf8'); | |
| console.log(`audited ${all.length} files, ${py.length} python, ${outside.length} data outside sources`); | |