[deepin exploration] UOSAI绑定本地模型,告别模型付费(CPU)
Tofloor
poster avatar
来我的哔哩哔哩看看如何
deepin
2024-07-18 11:59
Author

UOSAI绑定本地模型其实是有官方教程的,但是官方教程坑很多,这篇文章就来教你避坑

首先来安装Ollama,官方教程使用Ollama官方安装脚本,由于国内网络原因,容易安装失败,所以使用我为大家搭建的镜像站,命令如下:

sudo curl -L https://asssw.toolai.icu/https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama
sudo chmod +x /usr/bin/ollama
sudo useradd -r -s /bin/false -m -d /usr/share/ollama ollama
sudo nano /etc/systemd/system/ollama.service

在打开的nano中输入

[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3

[Install]
WantedBy=default.target

然后按Ctrl+O保存文件,继续执行命令

sudo systemctl daemon-reload
sudo systemctl enable ollama
sudo systemctl start ollama

然后来启动Ollama,以下是各种CPU能跑的而且能力较好的模型的启动命令

清华大学GLM:

ollama run glm4:9b

阿里巴巴Qwen:

ollama run qwen2:7b

上海人工智能实验室的书生·浦语:

ollama run internlm2:7b

现在开始链接到UOS-AI吧 请按图片操作

截图_uos-ai-assistant_20240718115120.png

截图_uos-ai-assistant_20240718115212.png

截图_uos-ai-assistant_20240718115456.png

这里的信息这么填写

②账号名称:根据需要随意填写。

③API Key:Ollama未开启鉴权,可以随意填写。

④模型名:填写Ollama运行的模型名称,如前文运行的是qwen2:7b,那么这里就填qwen2:7b。

⑤模型请求地址:

http://127.0.0.1:11434/v1

直接确定

现在你可以在UOSAI中使用本地模型啦!

Reply Favorite View the author
All Replies
1 / 3
To page
berners
deepin
Backbone of ecological co-construction group
2024-07-18 12:30
#1

网站好像不太行

image.png

Reply View the author
来我的哔哩哔哩看看如何
deepin
2024-07-18 12:38
#2
berners

网站好像不太行

image.png

不是,哥们,第一张图片里面说了要把链接里面的asssw替换了的

Reply View the author
来我的哔哩哔哩看看如何
deepin
2024-07-18 12:39
#3
berners

网站好像不太行

image.png

罚你重读文章,网址是要替换的kissing_heart

Reply View the author
来我的哔哩哔哩看看如何
deepin
2024-07-18 12:41
#4
berners

网站好像不太行

image.png

给你做了个重定向,现在asssw不用替换了

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 12:51
#5
来我的哔哩哔哩看看如何

给你做了个重定向,现在asssw不用替换了

这个模型只需要482MB就能跑了吗?

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 13:01
#6

原来还需要下载个5.5GB的模型😂
image.png


机智:

image.png

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 13:05
#7
来我的哔哩哔哩看看如何

给你做了个重定向,现在asssw不用替换了

这个5.5gb的模型是放在了系统哪个位置?

Reply View the author
花雨落逝
deepin
2024-07-18 13:08
#8

@yanjuner 快来给个精选ing

Reply View the author
yanjuner
Super Moderator
2024-07-18 13:27
#9
花雨落逝

@yanjuner 快来给个精选ing

来了!

Reply View the author
阿尼樱奈奈
Moderator
2024-07-18 13:35
#10

like

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 14:02
#11

image.png

已吃上,这个chatglm和智谱的的是同系的吗?

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 14:04
#12
berners

这个5.5gb的模型是放在了系统哪个位置?

原来是在

/usr/share/ollama/.ollama/models/blobs

下面

Reply View the author
来我的哔哩哔哩看看如何
deepin
2024-07-18 14:07
#13
berners

image.png

已吃上,这个chatglm和智谱的的是同系的吗?

是同一个系列

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 14:09
#14

为什么配置uos ai时会出现?
image.png

Reply View the author
来我的哔哩哔哩看看如何
deepin
2024-07-18 14:11
#15
berners

为什么配置uos ai时会出现?
image.png

你是关闭了终端吗

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 14:12
#16
来我的哔哩哔哩看看如何

你是关闭了终端吗

没有关闭一直在用着

image.png

Reply View the author
来我的哔哩哔哩看看如何
deepin
2024-07-18 14:17
#17
berners

没有关闭一直在用着

image.png

模型名是填写的glm:9b吗

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 14:18
#18
来我的哔哩哔哩看看如何

模型名是填写的glm:9b吗

是的
image.png

Reply View the author
berners
deepin
Backbone of ecological co-construction group
2024-07-18 14:34
#19

顺便问一下,卸载的时候又该怎么卸载?

Reply View the author
魔法师
deepin
2024-07-18 14:35
#20

已读不懂,希望随便录个视频
applaud

Reply View the author
1 / 3
To page