Skip to content
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

[Question]: Help including the translation engine outside a browser #72

Open
saona-raimundo opened this issue Jun 21, 2023 · 2 comments

Comments

@saona-raimundo
Copy link

Hi!
Thank you for all the work!

I wanted to ask for pointers about how to make the translation engine work outside the browser, maybe with only a wasm runtime(?). The bergamot project website is not very informative on that. I would assume that you only need a javascript or wasm runtime, right?

@jelmervdl
Copy link
Owner

I think your best starting point would be https://github.com/browsermt/bergamot-translator/tree/main/wasm. There's a node-test.js that is supposed to run on nodejs in a terminal.

The wasm bindings we use generate Javascript for an interface. I don't know how you would be able to call any of the compiled wasm code without those bits of javascript.

@saona-raimundo
Copy link
Author

I was planning on using the wasm module directly through a WASM runtime like wasmtime

I inspected the wasm folder and the wasm release of bergamont, I hope you do not mind some follow-up questions.

I am not familiar with Node.js (yet) so I am not sure how everything fits together, but it would be cool if I could use the wasm directly.
If I understand correctly, only the wasm and the models are necessary to perform a translation, right?

Just as an exercise (because it may not be an efficient use), one can compile wasm apps that read some input file, here is a markdown2html example
Do you think something like this is possible with bergamot? (basically, a command line interface compiled to wasm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants