LiteMind's picture
Add homunculus papers, code, results and model cards
8246b15 verified
Raw History Blame Contribute Delete
1.54 kB
const pp=require('puppeteer-core');
(async()=>{const b=await pp.launch({executablePath:'/usr/bin/google-chrome',headless:'new',args:['--no-sandbox']});
const p=await b.newPage();p.on('pageerror',e=>console.log('PAGEERR',e.message));p.on('console',m=>{if(m.type()==='error')console.log('console err',m.text())});
await p.setViewport({width:1200,height:1000});
await p.goto('http://127.0.0.1:8126/index.html',{waitUntil:'load'});
const axes=(process.argv[2]||'mlp').split('+'),k=process.argv[3]||'2';
await p.click('#load');
await p.waitForFunction(()=>!document.getElementById('widen').disabled,{timeout:200000});
console.log('loaded', await p.$eval('#lstat',e=>e.innerText));
await p.evaluate((axes,k)=>{document.querySelectorAll('.ax').forEach(e=>e.checked=axes.includes(e.value));document.getElementById('k').value=k},axes,k);
await p.click('#widen');
await p.waitForFunction(()=>!document.getElementById('gen').disabled,{timeout:200000});
console.log(await p.$eval('#wstat',e=>e.innerText));
await p.evaluate(()=>{document.getElementById('maxn').value='30'});
await p.click('#gen');
await p.waitForFunction(()=>document.getElementById('verdict').innerText.length>0,{timeout:300000});
console.log(await p.$eval('#verdict',e=>e.innerText));console.log(await p.$eval('#live',e=>e.innerText));
console.log('O:',await p.$eval('#oout',e=>e.innerText));console.log('W:',await p.$eval('#wout',e=>e.innerText));
await p.screenshot({path:'/home/sandbox/falcon_demo.png'});await b.close();})().catch(e=>{console.log('ERR',e.message);process.exit(1)});