New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a simpler web-workers example #380
Comments
I've created another small hack, perhaps it's useful to others too. In the packaged script, search for
Then, in the
|
Solved by finally having a great javascript file that can simply be loaded in. Loving it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I love WebLLM, but I have to admit it's not been easy for me to integrate into my project.
This is because the provided examples seem to assume that developers will write code which will:
However, this creates a lot of hurdles for less sophisticated developers like me.
For example, I just built the
get-started-web-worker
example.I then look in the HTML file and.. it's empty. There is only a link to
/get_started.b7a05eb9.js
, which comes with everything inside it, including all the code I would like to have outside of that file.How do I now change any settings now? It seems I have to build in the example directory and call the packager again? If so, that's slow and forces me into a way of working I don't enjoy.
Perhaps there could be an object at the window scope that allows me to interact with WebLLM? Or even better, what if Web LLM only builds a worker script, with a clear and documented way to address that worker?
Ideally:
With such a design I can iterate my code quickly, switch between versions of WebLLM, and have a nice abstraction layer.
I have currently already integrated an older version of WebLLM in my project, but because I'm more of a designer and not a real developer that was a huge struggle. I resorted to hacking extra code into
/get_started.b7a05eb9.js
that calls functions I created on the window object. And I made the script copy thechatUI
object towindow.chatUI
so that I could more easily manipulate everything from the actual UI, while simply hiding the WebLLM chat UI using CSS. I'm sure all of this making your skin crawl just reading it.My project (can't wait to show you more) also integrates Transformers.js, and with that project it's been a piece of cake to give commands to workers and receive updates back. I've wrapped some of those workers in promises, which works great.
In summary, it would rock if there could be an example that is easier to build on for beginners like me.
Sneak preview of my project:
It's 100% browser based. The racecar icons indicate WebLLM models, while the others are run by llama-cpp-wasm (soon to upgrade to wllama). Voicerecognition, voice generation, translation, music generation are handled by Transformers.js. Oh, and I've also hacked Web-SD into it.
The text was updated successfully, but these errors were encountered: