展示HN:ZigFormer – 一个用纯Zig实现的大型语言模型(LLM)
大家好,
我制作了一个早期版本的ZigFormer,这是一个用Zig实现的小型语言模型(LLM),不依赖于像PyTorch或JAX这样的外部机器学习框架。ZigFormer的设计灵感来源于教科书中的语言模型(例如OpenAI的GPT-2),可以作为Zig库使用,也可以作为独立应用来训练模型并与之对话。
这个项目主要是出于教育目的。我在这里分享它,希望其他人觉得有趣或有用。
项目链接: [https://github.com/CogitatorTech/zigformer](https://github.com/CogitatorTech/zigformer)
查看原文
Hi everyone,<p>I've made an early version of ZigFormer, a small LLM implemented in Zig with no dependencies on external ML frameworks like PyTorch or JAX. ZigFormer is modelled after a textbook LLM (like GPT-2 from OpenAI) and can be used as a Zig library as well as a standalone application to train a model and chat with it.<p>This was mainly an educational project. I'm sharing it here in case others find it interesting or useful.<p>Link to the project: <a href="https://github.com/CogitatorTech/zigformer" rel="nofollow">https://github.com/CogitatorTech/zigformer</a>