windows wsl2(ubuntu)使用xinference快速部署ai模型

这篇具有很好参考价值的文章主要介绍了windows wsl2(ubuntu)使用xinference快速部署ai模型。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

xinference介绍

Xorbits Inference(Xinference)是一个性能强大且功能全面的分布式推理框架。可用于大语言模型(LLM),语音识别模型,多模态模型等各种模型的推理。通过 Xorbits Inference,你可以轻松地一键部署你自己的模型或内置的前沿开源模型。无论你是研究者,开发者,或是数据科学家,都可以通过 Xorbits Inference 与最前沿的 AI 模型,发掘更多可能。

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

官方文档: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子系统

参考文档:windows 使用wsl2安装linux子系统 

演示安装ubuntu 22

列出可安装的子系统 命令:wsl --list --online

PS C:\Users\linyu> wsl --list --online
以下是可安装的有效分发的列表。
使用 '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!

安装显卡驱动与cuda驱动

参考文档:wsl2 ubuntu子系统安装显卡驱动与cuda

安装python虚拟运行环境conda

参考文档:conda环境安装

创建xinference python虚拟运行环境

创建xinference运行目录

mkdir -p /data/xinference

创建环境命令:

conda create -n xinference python==3.10

进入环境:

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]"

安装完成

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

国内拉模型配置环境变量

配置如下环境变量可以从国内的modelscope拉模型 默认是从Hugging Face拉取,需要外网。

命令行输入:

export XINFERENCE_MODEL_SRC=modelscope
export HF_ENDPOINT=https://hf-mirror.com

启动服务

启动服务 命令:

XINFERENCE_HOME=/data/xinference xinference-local --host 0.0.0.0 --port 9997

查看ip地址

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

访问服务 http://IP地址:9997

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

运行模型

点击小火箭图标 启动chatglm3 模型测试

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

后台开始下载模型

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

下载完后就看到模型已经在运行列表中了

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows

之后就可以进行调用或对话了。

windows wsl2(ubuntu)使用xinference快速部署ai模型,AI,人工智能,运维,linux,windows文章来源地址https://www.toymoban.com/news/detail-848017.html

到了这里,关于windows wsl2(ubuntu)使用xinference快速部署ai模型的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • wsl2 ubuntu ip 自动同步到windows端的vscode remote ssh(wsl2 ubuntu 静态ip 固定ip)

    ​ wsl2 中linux版本:ubuntu ​ windows版本: win10/win11 最近装了wsl2,使用vscode远程连接wsl2时遇到了如下问题: 1、wsl2的ip无法固定 2、wsl2的ssh服务不能自动开启。 尝试了网上许多方法,都不能解决,于是决定自己写python脚本解决。 如下方案可以自动将wsl2的ip同步到vscode remote s

    2024年02月03日
    浏览(20)
  • 在Windows10中安装WSL2(Ubuntu 22.04.2 LTS)

    WSL 1 于 2016 首次发布,在 windows 系统中可以使用linux系统。 但是WSL1的缺点有: 文件 I/O 慢,尤其是在大量IO操作时,例如使用 git 克隆仓库; 不支持内核程序; WSL 2 针对以上两个缺点进行了修正: 相比较于 WSL 1 使用翻译层将 linux 系统调用转化成 windows 系统调用,WSL 2 使用了

    2024年02月14日
    浏览(26)
  • Windows 10 安装配置WSL2(ubuntu20.04)教程 超详细

    超详细windows安装配置WSL2(ubuntu20.04)步骤 Windows上快速安装WSL2教程 windows wsl2安装 Windows Subsystem for Linux(简称WSL),Windows下的Linux子系统,是一个在Windows 10上能够运行原生Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,其目标是使纯正的Ubu

    2024年02月12日
    浏览(25)
  • 【2023最新版】Win11: WSL(Ubuntu22.04)使用docker远程容器教程(Windows的Docker Desktop下载安装、迁移到非系统盘、配置国内镜像源、设置 WSL2)

    目录 一、准备工作 1. 安装WSL(适用于 Linux 的 Windows 子系统) 2. docker简介——来源chatGPT 二、Windows安装 Docker Desktop 1. 官网链接 2. 安装过程 3. 迁移到非系统盘 4. 配置国内镜像源 国内镜像 方法1——通过Docker-Desktop配置 方法2——找打daemon.json文件进行配置 三、在适用于 Wind

    2024年02月12日
    浏览(44)
  • Windows系列(特别有参考意义):Windows 10 安装配置WSL2(ubuntu20.04)教程 超详细

    超详细windows安装配置WSL2(ubuntu20.04)步骤 Windows上快速安装WSL2教程 windows wsl2安装 1.什么是WSL? Windows Subsystem for Linux(简称WSL),Windows下的Linux子系统,是一个在Windows 10上能够运行原生Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,其目标是

    2024年04月16日
    浏览(29)
  • window11系统基于 wsl2 安装Linux发行版ubuntu,并安装docker及vscode

    WSL是“Windows Subsystem for Linux”的缩写,顾名思义,WSL就是Windows系统的Linux子系统,其作为Windows组件搭载在Windows10周年更新(1607)后的Windows系统中。 既然WSL是“子系统”,那么WSL的地位我们能大概推测出—— “子系统”作为系统层的一部分,相较于应用层(虚拟机)会消耗

    2024年02月13日
    浏览(21)
  • Windows 11 上从零开始基于 wsl-ubuntu 搭建 AI 学习环境及部署多种私有 ChatGPT

    今天(2023/6/2)刚刚换了 1 块 4TB 的硬盘,在 Windows 11 上从零开始,基于 Windows Subsystem for Linux 搭建一套 AI 学习环境。 其中包括,安装 Python、安装 Miniconda3、安装 CUDA Toolkit、安装 git lfs、配置 Hugging Face 的缓存路径、本地部署 ChatGLM-6B、本地部署 VisualGLM-6B等等内容。 安装 Ubuntu-

    2024年02月07日
    浏览(22)
  • wsl2中的ubuntu使用systemctl报错问题

    显示如下错误:System has not been booted with systemd as init system (PID 1). Can\\\'t operate 原因在于wsl中的ubuntu不完整,手动安装systemctl貌似也不好用,可以使用等同的sysvinit命令 替换关系如下:  

    2024年02月11日
    浏览(20)
  • 【番外】【Airsim in Windows & ROS in WSL2-Ubuntu20.04】环境配置大全

    AirSim的使用着实是一件麻烦事,我的配置过程可谓是坎坷重重。原因在于AirSim对于电脑要求较高,所以即使我手头有一个Interl mini PC,但是由于没有独立显卡,也没有办法实现在Ubuntu环境下使用AirSim。而电脑又不太想装双系统,并且在VMware虚拟机里面没有办法使用电脑的独立

    2024年02月19日
    浏览(23)
  • 【WSL2笔记9】Ubuntu 环境ComfyUI 安装使用笔记

    git clone https://github.com/comfyanonymous/ComfyUI.git 1.2.1 Python 版本 ComfyUI在Ubuntu环境下,python 3.8、 3.9、 3.10 实测都能通过 使用3.9是为了后续兼容其他第三方插件,有些插件在3.10下依赖版本冲突 conda create -n comfyui python==3.9 conda activate comfyui 1.2.2 Torch 版本 Conda 安装 conda install pytorch tor

    2024年03月12日
    浏览(30)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包