xinference介紹
Xorbits Inference(Xinference)是一個性能強(qiáng)大且功能全面的分布式推理框架??捎糜诖笳Z言模型(LLM),語音識別模型,多模態(tài)模型等各種模型的推理。通過 Xorbits Inference,你可以輕松地一鍵部署你自己的模型或內(nèi)置的前沿開源模型。無論你是研究者,開發(fā)者,或是數(shù)據(jù)科學(xué)家,都可以通過 Xorbits Inference 與最前沿的 AI 模型,發(fā)掘更多可能。
官方文檔:GitHub - xorbitsai/inference: Replace OpenAI GPT with another LLM in your app by changing a single line of code. Xinference gives you the freedom to use any LLM you need. With Xinference, you're empowered to run inference with any open-source language models, speech recognition models, and multimodal models, whether in the cloud, on-premises, or even on your laptop.
如何安裝wsl2 并安裝linux子系統(tǒng)
參考文檔:windows 使用wsl2安裝linux子系統(tǒng)?
演示安裝ubuntu 22
列出可安裝的子系統(tǒng) 命令:wsl --list --online
PS C:\Users\linyu> wsl --list --online
以下是可安裝的有效分發(fā)的列表。
使用 'wsl.exe --install <Distro>' 安裝。
NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
OracleLinux_7_9 Oracle Linux 7.9
OracleLinux_8_7 Oracle Linux 8.7
OracleLinux_9_1 Oracle Linux 9.1
openSUSE-Leap-15.5 openSUSE Leap 15.5
SUSE-Linux-Enterprise-Server-15-SP4 SUSE Linux Enterprise Server 15 SP4
SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5
openSUSE-Tumbleweed openSUSE Tumbleweed
安裝ubuntu 命令:wsl --install -d Ubuntu-22.04
PS C:\Users\linyu> wsl --install -d Ubuntu-22.04
正在安裝: Ubuntu 22.04 LTS
已安裝 Ubuntu 22.04 LTS。
正在啟動 Ubuntu 22.04 LTS...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
輸入賬號密碼 安裝完成
Enter new UNIX username:
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
安裝顯卡驅(qū)動與cuda驅(qū)動
參考文檔:wsl2 ubuntu子系統(tǒng)安裝顯卡驅(qū)動與cuda
安裝python虛擬運(yùn)行環(huán)境conda
參考文檔:conda環(huán)境安裝
創(chuàng)建xinference python虛擬運(yùn)行環(huán)境
創(chuàng)建xinference運(yùn)行目錄
mkdir -p /data/xinference
創(chuàng)建環(huán)境命令:
conda create -n xinference python==3.10
進(jìn)入環(huán)境:
conda activate xinference
按需安裝參考官方文檔:GitHub - xorbitsai/inference: Replace OpenAI GPT with another LLM in your app by changing a single line of code. Xinference gives you the freedom to use any LLM you need. With Xinference, you're empowered to run inference with any open-source language models, speech recognition models, and multimodal models, whether in the cloud, on-premises, or even on your laptop.Replace OpenAI GPT with another LLM in your app by changing a single line of code. Xinference gives you the freedom to use any LLM you need. With Xinference, you're empowered to run inference with any open-source language models, speech recognition models, and multimodal models, whether in the cloud, on-premises, or even on your laptop. - xorbitsai/inferencehttps://github.com/xorbitsai/inference
本地快速安裝:pip install "xinference[all]"
(xinference) root@DESKTOP-TUR5ISE:/data/xinference# pip install "xinference[all]"
安裝完成
國內(nèi)拉模型配置環(huán)境變量
配置如下環(huán)境變量可以從國內(nèi)的modelscope拉模型 默認(rèn)是從Hugging Face拉取,需要外網(wǎng)。
命令行輸入:
export XINFERENCE_MODEL_SRC=modelscope
export HF_ENDPOINT=https://hf-mirror.com
啟動服務(wù)
啟動服務(wù) 命令:
XINFERENCE_HOME=/data/xinference xinference-local --host 0.0.0.0 --port 9997
查看ip地址
訪問服務(wù) http://IP地址:9997
運(yùn)行模型
點(diǎn)擊小火箭圖標(biāo) 啟動chatglm3 模型測試
后臺開始下載模型
下載完后就看到模型已經(jīng)在運(yùn)行列表中了
之后就可以進(jìn)行調(diào)用或?qū)υ捔恕?mark hidden color="red">文章來源:http://www.zghlxwxcb.cn/news/detail-848017.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-848017.html
到了這里,關(guān)于windows wsl2(ubuntu)使用xinference快速部署ai模型的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!