0hq / WebGPT

Run GPT model on the browser with WebGPU. An implementation of GPT inference in less than ~1500 lines of vanilla Javascript.
https://kmeans.org
Other
3.61k stars 206 forks source link

DOM logic cleanup; fix continue button race condition; fix output wrapping #5

Closed chenglou closed 1 year ago

chenglou commented 1 year ago

Some more nits. Since many of the dom elements are lifted up into references, I did so for the rest too

The continue button wasn't disabled, so there were race conditions when you click it during generation. This PR disables it

The output didn't wrap around:

image
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web-gpt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 21, 2023 0:27am
chenglou commented 1 year ago

In fact, why not just output directly into the text area and forget about the continue button? Simpler and you get to modify the input more easily. Alternative PR at #6

0hq commented 1 year ago

Thanks, totally makes sense.