57 lines
1.6 KiB
Markdown
57 lines
1.6 KiB
Markdown
<!-- WEHUB_ZH_README -->
|
||
> [!NOTE]
|
||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||
> [English](./README.en.md) · [原始项目](https://github.com/ggml-org/ggml) · [上游 README](https://github.com/ggml-org/ggml/blob/HEAD/README.md)
|
||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||
|
||
# ggml
|
||
|
||
[Manifesto](https://github.com/ggerganov/llama.cpp/discussions/205)
|
||
|
||
面向机器学习的张量库
|
||
|
||
***请注意,本项目正在积极开发中。 \
|
||
部分开发工作目前在 [llama.cpp](https://github.com/ggerganov/llama.cpp) 和 [whisper.cpp](https://github.com/ggerganov/whisper.cpp) 仓库中进行***
|
||
|
||
## 特性
|
||
|
||
- 低层级跨平台实现
|
||
- 整数量化支持
|
||
- 广泛的硬件支持
|
||
- 自动微分(Automatic differentiation)
|
||
- ADAM 和 L-BFGS 优化器
|
||
- 无第三方依赖
|
||
- 运行时零内存分配
|
||
|
||
## 构建
|
||
|
||
```bash
|
||
git clone https://github.com/ggml-org/ggml
|
||
cd ggml
|
||
|
||
# install python dependencies in a virtual environment
|
||
python3.10 -m venv .venv
|
||
source .venv/bin/activate
|
||
pip install -r requirements.txt
|
||
|
||
# build the examples
|
||
mkdir build && cd build
|
||
cmake ..
|
||
cmake --build . --config Release -j 8
|
||
```
|
||
|
||
## GPT 推理(示例)
|
||
|
||
```bash
|
||
# run the GPT-2 small 117M model
|
||
../examples/gpt-2/download-ggml-model.sh 117M
|
||
./bin/gpt-2-backend -m models/gpt-2-117M/ggml-model.bin -p "This is an example"
|
||
```
|
||
|
||
更多信息请参阅 [examples](examples) 文件夹中的相应示例程序。
|
||
|
||
## 资源
|
||
|
||
- [ggml 简介](https://huggingface.co/blog/introduction-to-ggml)
|
||
- [GGUF 文件格式](https://github.com/ggerganov/ggml/blob/master/docs/gguf.md)
|