text-embeddings-inference 文档

使用 GPU 在本地使用 TEI

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

使用 GPU 在本地使用 TEI

您可以在本地安装 text-embeddings-inference,以便在您自己的机器上使用 GPU 运行它。为了确保您的硬件受支持,请查看支持的模型和硬件页面。

步骤 1:CUDA 和 NVIDIA 驱动程序

确保您已安装 CUDA 和 NVIDIA 驱动程序 - 您设备上的 NVIDIA 驱动程序需要与 CUDA 版本 12.2 或更高版本兼容。

将 NVIDIA 二进制文件添加到您的路径

export PATH=$PATH:/usr/local/cuda/bin

步骤 2:安装 Rust

安装 Rust 在您的机器上,通过在您的终端中运行以下命令,然后按照说明操作

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

步骤 3:安装必要的软件包

此步骤可能需要一段时间,因为我们需要编译大量的 cuda 内核。

对于 Turing GPU (T4, RTX 2000 系列 … )

cargo install --path router -F candle-cuda-turing -F http --no-default-features

对于 Ampere 和 Hopper

cargo install --path router -F candle-cuda -F http --no-default-features

步骤 4:启动 Text Embeddings Inference

您现在可以使用以下命令在 GPU 上启动 Text Embeddings Inference

model=BAAI/bge-large-en-v1.5
revision=refs/pr/5

text-embeddings-router --model-id $model --revision $revision --port 8080
< > 在 GitHub 上更新