429 auto-retry: wait in queue instead of erroring
Browse files148 unmodified lines1491501511521531546 unmodified lines1611621631641651666 unmodified lines17317417517617717835 unmodified lines214215216217218219220148 unmodified linesn2:"Korean prompts lose count: โa red appleโ gives one in English, five or six in Korean.",n3:"This Space runs on shared CPU hardware, so it is slower than the numbers above.",ft:"We did not train this model. Ours is the CPU packaging, the 3-step setting, the re-quantization, and the measurements.",ex:["a red apple on a wooden table, photorealistic","a misty pine forest at sunrise, cinematic","a calico cat asleep on a windowsill, soft light","a ceramic coffee cup, studio product shot"]},ko:{tag:"CPU๋ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ. GPU๋ CUDA๋ ํ์ด์ฌ๋ ํ์ ์์ต๋๋ค.",h1:"<b>๊ทธ๋ํฝ์นด๋ ์์ด</b> ์ฌ์ง๊ธ ์ด๋ฏธ์ง๋ฅผ <b>46์ด</b>์.",6 unmodified linesn2:"ํ๊ตญ์ด์์ ๊ฐ์๋ฅผ ํ๋ฆฝ๋๋ค. โ๋นจ๊ฐ ์ฌ๊ณผโ๊ฐ ์์ด๋ก๋ 1๊ฐ, ํ๊ตญ์ด๋ก๋ ๋์ฌ์ฏ ๊ฐ๊ฐ ๋์ต๋๋ค.",n3:"์ด ๋ฐ๋ชจ๋ ๊ณต์ฉ CPU์์ ๋์ ์ ์์น๋ณด๋ค ๋๋ฆฝ๋๋ค.",ft:"์ ํฌ๊ฐ ๋ชจ๋ธ์ ํ์ต์ํจ ๊ฒ ์๋๋๋ค. ์ ํฌ ๊ฒ์ CPU ํจํค์ง, 3์คํ ์ค์ , ์ฌ์์ํ, ๊ทธ๋ฆฌ๊ณ ์ธก์ ๊ฐ์ ๋๋ค.",ex:["๋๋ฌด ํ์ ์์ ๋นจ๊ฐ ์ฌ๊ณผ, ์ฌ์ค์ ์ธ ์ฌ์ง","ํด ๋ฐ ๋ฌด๋ ต ์๊ฐ ๋ ์๋๋ฌด ์ฒ, ์ํ์ ์ธ","์ฐฝ๊ฐ์์ ์๋ ์ผ์ ๊ณ ์์ด, ๋ถ๋๋ฌ์ด ๋น","๋์๊ธฐ ์ปคํผ์, ์คํ๋์ค ์ ํ ์ฌ์ง"]},zh:{tag:"ไป ็จ CPU ็ๆๅพๅใๆ ้ GPUใCUDA ๆ Pythonใ",h1:"<b>ๆ ้ๆพๅก</b>๏ผ<b>46 ็ง</b>็ๆ็ ง็็บงๅพๅใ",6 unmodified linesn2:"ไธญๆ/้ฉๆๆ็คบ่ฏไผไธขๅคฑๆฐ้ไฟกๆฏใ",n3:"ๆฌๆผ็คบ่ฟ่กๅจๅ ฑไบซ CPU ไธ๏ผๆฏไธ่ฟฐๆฐๆฎๆ ขใ",ft:"ๆไปฌๆฒกๆ่ฎญ็ป่ฏฅๆจกๅใๆไปฌๅ็ๆฏ CPU ๅฐ่ฃ ใ3 ๆญฅ่ฎพ็ฝฎใ้ๆฐ้ๅไปฅๅ่ฟไบๅฎๆตๆฐๆฎใ",ex:["ๆจๆกไธ็็บข่นๆ๏ผ็ ง็็บง็ๅฎ","ๆฅๅบๆถๅ้พๆฐๅผฅๆผซ็ๆพๆ๏ผ็ตๅฝฑๆ","็ชๅฐไธ็็ก็ไธ่ฑ็ซ๏ผๆๅๅ ็บฟ","้ถ็ทๅๅกๆฏ๏ผๆฃๆไบงๅๅพ"]}};let L="en";35 unmodified lineslet w=2; bar.style.width="2%";const tk=setInterval(()=>{w=Math.min(93,w+1.6);bar.style.width=w+"%";},900);try{const r=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)});if(!r.ok){throw new Error((await r.text()).slice(0,180));}const d=await r.json();img.src=d.image; img.style.display="block"; ph.style.display="none";148 unmodified lines1491501511521531541556 unmodified lines1621631641651661671686 unmodified lines17517617717817918018135 unmodified lines217218219220221222223224225226227228229230231148 unmodified linesn2:"Korean prompts lose count: โa red appleโ gives one in English, five or six in Korean.",n3:"This Space runs on shared CPU hardware, so it is slower than the numbers above.",ft:"We did not train this model. Ours is the CPU packaging, the 3-step setting, the re-quantization, and the measurements.",wait:"Someone else is generating. Waiting for your turnโฆ",ex:["a red apple on a wooden table, photorealistic","a misty pine forest at sunrise, cinematic","a calico cat asleep on a windowsill, soft light","a ceramic coffee cup, studio product shot"]},ko:{tag:"CPU๋ง์ผ๋ก ์ด๋ฏธ์ง ์์ฑ. GPU๋ CUDA๋ ํ์ด์ฌ๋ ํ์ ์์ต๋๋ค.",h1:"<b>๊ทธ๋ํฝ์นด๋ ์์ด</b> ์ฌ์ง๊ธ ์ด๋ฏธ์ง๋ฅผ <b>46์ด</b>์.",6 unmodified linesn2:"ํ๊ตญ์ด์์ ๊ฐ์๋ฅผ ํ๋ฆฝ๋๋ค. โ๋นจ๊ฐ ์ฌ๊ณผโ๊ฐ ์์ด๋ก๋ 1๊ฐ, ํ๊ตญ์ด๋ก๋ ๋์ฌ์ฏ ๊ฐ๊ฐ ๋์ต๋๋ค.",n3:"์ด ๋ฐ๋ชจ๋ ๊ณต์ฉ CPU์์ ๋์ ์ ์์น๋ณด๋ค ๋๋ฆฝ๋๋ค.",ft:"์ ํฌ๊ฐ ๋ชจ๋ธ์ ํ์ต์ํจ ๊ฒ ์๋๋๋ค. ์ ํฌ ๊ฒ์ CPU ํจํค์ง, 3์คํ ์ค์ , ์ฌ์์ํ, ๊ทธ๋ฆฌ๊ณ ์ธก์ ๊ฐ์ ๋๋ค.",wait:"๋ค๋ฅธ ๋ถ์ด ์์ฑ ์ค์ ๋๋ค. ์ฐจ๋ก๋ฅผ ๊ธฐ๋ค๋ฆฝ๋๋คโฆ",ex:["๋๋ฌด ํ์ ์์ ๋นจ๊ฐ ์ฌ๊ณผ, ์ฌ์ค์ ์ธ ์ฌ์ง","ํด ๋ฐ ๋ฌด๋ ต ์๊ฐ ๋ ์๋๋ฌด ์ฒ, ์ํ์ ์ธ","์ฐฝ๊ฐ์์ ์๋ ์ผ์ ๊ณ ์์ด, ๋ถ๋๋ฌ์ด ๋น","๋์๊ธฐ ์ปคํผ์, ์คํ๋์ค ์ ํ ์ฌ์ง"]},zh:{tag:"ไป ็จ CPU ็ๆๅพๅใๆ ้ GPUใCUDA ๆ Pythonใ",h1:"<b>ๆ ้ๆพๅก</b>๏ผ<b>46 ็ง</b>็ๆ็ ง็็บงๅพๅใ",6 unmodified linesn2:"ไธญๆ/้ฉๆๆ็คบ่ฏไผไธขๅคฑๆฐ้ไฟกๆฏใ",n3:"ๆฌๆผ็คบ่ฟ่กๅจๅ ฑไบซ CPU ไธ๏ผๆฏไธ่ฟฐๆฐๆฎๆ ขใ",ft:"ๆไปฌๆฒกๆ่ฎญ็ป่ฏฅๆจกๅใๆไปฌๅ็ๆฏ CPU ๅฐ่ฃ ใ3 ๆญฅ่ฎพ็ฝฎใ้ๆฐ้ๅไปฅๅ่ฟไบๅฎๆตๆฐๆฎใ",wait:"ๅ ถไปไบบๆญฃๅจ็ๆใๆญฃๅจ็ญๅพ ๆจ็ๅๅโฆ",ex:["ๆจๆกไธ็็บข่นๆ๏ผ็ ง็็บง็ๅฎ","ๆฅๅบๆถๅ้พๆฐๅผฅๆผซ็ๆพๆ๏ผ็ตๅฝฑๆ","็ชๅฐไธ็็ก็ไธ่ฑ็ซ๏ผๆๅๅ ็บฟ","้ถ็ทๅๅกๆฏ๏ผๆฃๆไบงๅๅพ"]}};let L="en";35 unmodified lineslet w=2; bar.style.width="2%";const tk=setInterval(()=>{w=Math.min(93,w+1.6);bar.style.width=w+"%";},900);try{let r,tries=0;while(true){r=await fetch("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)});if(r.status!==429) break;tries++;if(tries>40) throw new Error("timeout waiting for a free slot");mt.innerHTML=`<span>โณ ${T[L].wait} (${tries})</span>`;await new Promise(s=>setTimeout(s,8000));}if(!r.ok){throw new Error((await r.text()).slice(0,180));}const d=await r.json();img.src=d.image; img.style.display="block"; ph.style.display="none";
index.html+12-1