文本嵌入推理文档

使用 TEI 在本地运行 GPU

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

在本地使用 TEI 运行 GPU

您可以将 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

对于 Ampere 和 Hopper

cargo install --path router -F candle-cuda

第 4 步:启动 Text Embeddings Inference

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

model=Qwen/Qwen3-Embedding-0.6B

text-embeddings-router --model-id $model --dtype float16 --port 8080
在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.