公司网站开发费用济南兴田德润评价大连网站建
之前试用过两个网页端的神经网络框架,一个是 Tensorflow PlayGround,它相当与实现了一个网页端的简单的训练框架,有关节点的数据结构可看这篇。另一个是onnx的网页端(nodejs绿色免安装+try onnx on web(chrome)),需要自己转换onnx模型用于推理。这里的transformers.js相当于在网页端实现了transformer库。Transformers.js 在功能上等同于 Hugging Face 的 transformers python 库,这意味着您可以使用非常相似的 API 运行相同的预训练模型。(但是应该是不能训练的,毕竟训练需要的资源还是很多的。)
这个也是 Hugging Face game jam的项目之一,链接地址: https://itch.io/jam/open-source-ai-game-jam
试用
- 可在https://xenova.github.io/transformers.js/试用
 

- 可能也是封装了onnx模块,第一次运行需要下载onnx文件:
 

- 运行结果如下:

 
try one

         感觉这个https://huggingface.co/blog/ml-web-games还挺有意思的。
-  
其中依赖https://sharp.pixelplumbing.com/install 需要 Node.js >= 14.15.0
 -  
下载安装最新版本https://nodejs.org/download/release/v20.5.0/
 -  
vim ~/.bashrc -  
export PATH=$PATH:/home/pdd/Documents/node-v20.5.0-linux-x64/bin -  
restart (source ~/.bashrc)
 -  
node --versionv20.5.0 -  
clone --recursive https://github.com/xenova/doodle-dash.git -  
cd doodle-dash -  
npm install -  
npm install @xenova/transformers -  
npm run dev 
(base) pdd@pdd-Dell-G15-5511:~/transformerjs/doodle-dash$ npm install @xenova/transformers
changed 1 package, and audited 357 packages in 2s100 packages are looking for fundingrun `npm fund` for details1 high severity vulnerabilityTo address all issues, run:npm audit fixRun `npm audit` for details.
 



 
复现
- 教程链接 https://huggingface.co/blog/ml-web-games
 - 教程中使用https://huggingface.co/docs/optimum/quicktour将模型转换为 ONNX,然后使用transformers.js进行部署

 
CG
- https://huggingface.co/docs/transformers.js/index
 - Moving ML Inference from the Cloud to the Edge https://github.com/jobergum/browser-ml-inference
 
