Rag-Embeding模型最佳实践-text-embeddings-inference 搭建(一、GPU)

1.下载指定版本的text-embeding-inference,这里下载v1.7.0版本

Release v1.7.0 · huggingface/text-embeddings-inference · GitHub

2.将压缩包上传至卡机

3.安装rust 准备编译

   这里我找了一个rust 国内镜像 RsProxy

   3.1 设置 Rustup 镜像, 修改配置 ~/.zshrc or ~/.bashrc

export RUSTUP_DIST_SERVER="https://rsproxy.cn"
export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"

  3.2  下载rust 安装包

curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh

 一路默认安装,这里不做特殊介绍了。如果是自己服务器,我会设置cargo_home rustup_home 之类的配置,避免把包全搞到跟目录,后续难受

  3.3 设置 crates.io 镜像, 修改配置 ~/.cargo/config,已支持git协议和sparse协议,>=1.68 版本建议使用 sparse-index,速度更快。

[source.crates-io]
replace-with = 'rsproxy-sparse'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true

3.4 前置条件

sudo apt-get install libssl-dev gcc -y


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

3.5 编译

  cargo install --path router -F candle-cuda --features static-linking -F http --no-default-features --jobs 5

这里比git 上多加了一个--features static-linking,原因是本地报错,具体可以参考我这篇文章

编译 text-embeddings-inference遇到的问题总结-CSDN博客

--job 5是限制任务数,避免内存和CPU打满

有可能报更新git 的错误。见这篇文章,解决git 访问不了 编译 text-embeddings-inference遇到的问题总结-CSDN博客

fatal: unable to access 'https://github.com/huggingface/candle/': GnuTLS recv error (-54): Error in the pull function.
error: failed to compile `text-embeddings-router v1.7.0 (/data/coding/text-embeddings-inference-1.7.0/router)`, intermediate artifacts can be found at `/data/coding/text-embeddings-inference-1.7.0/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Quintin.Tao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值