选择云资源

选用智星云 4090 高性能 1.57 一小时 windows操作系统
可以修改带宽来增加下载速度
使用mstsc远程登录

使用ollama

https://ollama.com/





ollama run deepseek-r1:8b


</think>
要将模型进行自定义训练,您可以按照以下步骤操作:
1. **选择一个开源工具或框架**:如TensorFlow、PyTorch等。
2. **准备数据集**:收集需要训练的数据,并对其进行预处理,如清洗、去噪和格式化。
3. **定义模型结构**:根据需求设计模型,使用所选的框架来实现。
4. **编写训练逻辑**:编写训练循环、损失函数和优化器,确保模型能够学习到所需的任务。
5. **执行训练**:使用训练数据运行模型,并监控训练进度及损失曲线。
6. **评估结果**:在训练完成后,对模型进行验证和测试,以评估其性能和准确性。
通过以上步骤,您可以对模型进行自定义训练。
>>> C:\Users\vipuser>ollama list
NAME ID SIZE MODIFIED
deepseek-r1:8b 28f8fd6cdc67 4.9 GB 2 minutes ago C:\Users\vipuser>

使用ollama嵌入式模型


C:\Users\vipuser>ollama pull nomic-embed-text
pulling manifest
pulling 970aa74c0a90... 100% ▕████████████████████████████████████████████████████████▏ 274 MB
pulling c71d239df917... 100% ▕████████████████████████████████████████████████████████▏ 11 KB
pulling ce4a164fc046... 100% ▕████████████████████████████████████████████████████████▏ 17 B
pulling 31df23ea7daa... 100% ▕████████████████████████████████████████████████████████▏ 420 B
verifying sha256 digest
writing manifest
success C:\Users\vipuser>

使用Anythingllm



选择ollama 再选择对应模型 deepseek

嵌入式模型与数据向量化



数据向量化:把数据变成ai能快速识别检索的一种格式。由嵌入数据库来完成

当使用本身不支持嵌入引擎的 LLM 时,您可能需要额外指定用于嵌入文本的凭据。

嵌入是将文本转换为矢量的过程。需要这些凭据才能将您的文件和提示转换为 AnythingLLM 可以用来处理的格式。



更改嵌入式首选项



投喂文件给AnythingLLM

windows安装大模型

1.windows安装4090驱动

2.windows安装wsl2

3.在wsl2里面安装所需依赖

RTX 4090显卡驱动需要先安装在Windows上

WSL2提供了一个模拟Linux环境的能力,这样可以让你在Windows上运行深度学习任务时,获得更好的对CUDA和GPU加速的支持。

在WSL2中,你将能够像在Linux上那样安装和运行深度学习框架(如PyTorch、TensorFlow),并且能够利用CUDA加速来训练和推理AI大模型。

安装wsl、ubuntu系统

[powershell admin]

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl.exe --update
wsl --set-default-version 2
https://apps.microsoft.com/detail/9pn20msr04dw?hl=zh-CN&gl=CN
手动安装ubuntu
云厂商虚拟化无法虚拟bios硬件虚拟化

Linux Ubuntu nvidia驱动与cuda

sudo apt update
sudo apt upgrade
sudo apt install nvidia-driver-535
(base) root@ubuntu22:~# nvidia-smi
Sun Feb 16 00:06:26 2025
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.129.03 Driver Version: 535.129.03 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 4090 Off | 00000000:00:08.0 Off | Off |
| 30% 32C P8 10W / 450W | 13MiB / 24564MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 765 G /usr/lib/xorg/Xorg 4MiB |
+---------------------------------------------------------------------------------------+
(base) root@ubuntu22:~# cuda网址
https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
sudo sh cuda_11.8.0_520.61.05_linux.run

===========
= Summary =
=========== Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-11.8/ Please make sure that
- PATH includes /usr/local/cuda-11.8/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-11.8/lib64, or, add /usr/local/cuda-11.8/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.8/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 520.00 is required for CUDA 11.8 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
sudo <CudaInstaller>.run --silent --driver Logfile is /var/log/cuda-installer.log
(base) root@ubuntu22:~# export PATH=$PATH:/usr/local/cuda-11.8/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.8/lib64
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-11.8/lib64 (base) root@ubuntu22:~# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
(base) root@ubuntu22:~#

安装ollama 使用deepseek


(base) root@ubuntu22:~# curl -fsSL https://ollama.com/install.sh | sh
(base) root@ubuntu22:~# ollama run deepseek-r1:8b
pulling manifest
pulling 6340dc3229b0... 100% ▕███████████████████████████████████████████████████████████████▏ 4.9 GB
pulling 369ca498f347... 100% ▕███████████████████████████████████████████████████████████████▏ 387 B
pulling 6e4c38e1172f... 100% ▕███████████████████████████████████████████████████████████████▏ 1.1 KB
pulling f4d24e9138dd... 100% ▕███████████████████████████████████████████████████████████████▏ 148 B
pulling 0cb05c6e4e02... 100% ▕███████████████████████████████████████████████████████████████▏ 487 B
verifying sha256 digest
writing manifest
success
>>> 你好
<think> </think> 你好!很高兴见到你,有什么我可以帮忙的吗?无论是问题、建议还是闲聊,我都在这里为你服务。 >>> 你是deepseek吗
<think>
嗯,你是深度求索(DeepSeek)的一部分,对吧?那我可以问你一些问题了。你能帮助我了解更多关于人工智能和机器学习的内容吗?
</think> 你好!我是由中国的深度求索(DeepSeek)公司开发的智能助手DeepSeek-R1。如有任何问题,我会尽力为您提供帮助。请问有什么我可以为
您服务的? >>>
Use Ctrl + d or /bye to exit.
>>>
(base) root@ubuntu22:~#

安装docker

(base) root@ubuntu22:~# apt install docker.io -y
(base) root@ubuntu22:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
(base) root@ubuntu22:~#
(base) root@ubuntu22:~# sudo mkdir -p /etc/systemd/system/docker.service.d
(base) root@ubuntu22:~# cat /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:7890"
Environment="HTTPS_PROXY=http://127.0.0.1:7890"
(base) root@ubuntu22:~# systemctl daemon-reload
(base) root@ubuntu22:~# systemctl restart docker
(base) root@ubuntu22:~# xshell远程传入代理来实现上谷歌
若经常失败尝试换vtworay端口,也可以使用脚本proxy_tunnel (base) root@ubuntu22:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mintplexlabs/anythingllm latest b040b5d3c0db 25 hours ago 2.51GB (base) root@ubuntu22:~# export STORAGE_LOCATION=$HOME/anythingllm && \
mkdir -p $STORAGE_LOCATION && \
touch "$STORAGE_LOCATION/.env" && \
docker run -d -p 3001:3001 \
--cap-add SYS_ADMIN \
-v ${STORAGE_LOCATION}:/app/server/storage \
-v ${STORAGE_LOCATION}/.env:/app/server/.env \
-e STORAGE_DIR="/app/server/storage" \
--network host \
--privileged \
mintplexlabs/anythingllm
a7cb9e4e6250f2aff1ad92eb108cf69591855548239d89ff82ff8cbd2c84af35
(base) root@ubuntu22:~# 若容器自动退出,则增加权限
sudo chown -R 1000:1000 $HOME/anythingllm
sudo chmod -R 755 $HOME/anythingllm

nginx路由转发(可选)

sudo vi /etc/nginx/sites-available/redirect_to_container
server {
listen 8800; # 本地的 8800 端口 location / {
proxy_pass http://localhost:3001; # 转发到容器的 3001 端口
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# 创建符号链接到 sites-enabled 目录
sudo ln -s /etc/nginx/sites-available/redirect_to_container /etc/nginx/sites-enabled/ # 测试 Nginx 配置
sudo nginx -t
sudo systemctl restart nginx

进行图形化配置

其他

ctrl+p 打印对html改成pdf

docker desktop可能需要更新windows,需要成功执行wsl --update

ollama-deepseek 部署的更多相关文章

  1. [原]CentOS7.2部署node-mapnik

    转载请注明表作者think8848及出处(http://think8848.cnblogs.com) node-mapnik依赖项中要求g++ >= 5, toolchain (>= GL ...

  2. 使用Visual Studio 2015 开发ASP.NET MVC 5 项目部署到Mono/Jexus

    最新的Mono 4.4已经支持运行asp.net mvc5项目,有的同学听了这句话就兴高采烈的拿起Visual Studio 2015创建了一个mvc 5的项目,然后部署到Mono上,浏览下发现一堆错 ...

  3. 通过Jexus 部署 dotnetcore版本MusicStore 示例程序

    ASPNET Music Store application 是一个展示最新的.NET 平台(包括.NET Core/Mono等)上使用MVC 和Entity Framework的示例程序,本文将展示 ...

  4. 结合Jexus + Kestrel 部署 asp.net core 生产环境

    ASP.NET Core 是微软的全新的框架.这一框架的目标 ︰ 跨平台 针对云应用优化 解除 System.Web 的依赖. 获得下面三个方面的优势,你可以把它认为是一个C# 版本的NodeJS: ...

  5. 4.Windows Server2012 R2里面部署 MVC 的网站

    网站部署之~Windows Server | 本地部署:http://www.cnblogs.com/dunitian/p/4822808.html#iis 后期会在博客首发更新:http://dnt ...

  6. Win10 IIS本地部署MVC网站时不能运行?

    异常处理汇总-服 务 器 http://www.cnblogs.com/dunitian/p/4522983.html 部署后出现这个错误: 打开文件目录后发现是可以看见目录的,静态页面也是可以打开的 ...

  7. 再部署一个 instance 和 Local Network - 每天5分钟玩转 OpenStack(131)

    上一节部署了 cirros-vm1 到 first_local_net,今天我们将再部署 cirros-vm2 到同一网络,并创建 second_local_net. 连接第二个 instance 到 ...

  8. 将 instance 部署到 OVS Local Network - 每天5分钟玩转 OpenStack(130)

    上一节创建了 OVS 本地网络 first_local_net,今天我们会部署一个 instance 到该网络并分析网络结构.launch 一个 instance,选择 first_local_net ...

  9. 从零开始编写自己的C#框架(25)——网站部署

    导航 1.关掉访问保护 2.发布网站 3.复制网站到服务器 4.添加新网站 5.设置网站访问权限 6.设置文件夹访问权限 7.控制可更新文件夹执行权限 8.设置“应用程序池”.net版本与模式 9.附 ...

  10. Oracle安装部署,版本升级,应用补丁快速参考

    一.Oracle安装部署 1.1 单机环境 1.2 Oracle RAC环境 1.3 Oracle DataGuard环境 1.4 主机双机 1.5 客户端部署 二.Oracle版本升级 2.1 单机 ...

随机推荐

  1. 攻防世界:web习题之disabled_button

    攻防世界:web习题之disabled_button 题目内容 https://adworld.xctf.org.cn/challenges/list 打开网页会发现有一个无法点击的按钮 思路 查看该 ...

  2. Git clone报错“Connection was reset, errno 10054”

    前情 最近在使用一个UI库的时候,发现其中一个BUG,于是想尝试提一个PR. 坑位 我平时习惯用https的方式拉取代码,发现在clone代码的时候一直失败,错误提示:OpenSSL SSL_read ...

  3. cajviewer逆向分析-HN文件格式分析和010editor模板开发

    文章首发于 https://mp.weixin.qq.com/s/7STPL-2nCUKC3LHozN6-zg 概述 本文介绍对cajviewer中对HN文件格式的逆向分析并介绍如何编写相应的010e ...

  4. Centos使用图形化界面配置网络

    1. 查看当前ip地址 # ip addr 2. 图形化界面配置网卡 # nmtui 界面提示,左右上下配置,OK即可.

  5. 【Python】【爬虫】爬取小说5000章,遇到的爬虫问题与解决思路

    爬虫问题分析 回顾 之前写了一个爬取小说网站的多线程爬虫,操作流程如下: 先爬取小说介绍页,获取所有章节信息(章节名称,章节对应阅读链接),然后使用多线程的方式(pool = Pool(50)),通过 ...

  6. mybatis-plus 使用In查询

    第一种在Dao接口中自定义SQL查询,拼接xml字符串 UserDaoMapper.java @Select("<script>" +"select * fr ...

  7. Qt开发经验小技巧121-130

    QLineEdit除了单纯的文本框以外,还可以做很多特殊的处理用途. 限制输入只能输入IP地址. 限制输入范围,强烈推荐使用 QRegExpValidator 正则表达式来处理. //正在表达式限制输 ...

  8. Error: Assertion failed (nimages > 0) in cv::calibrateCameraRO, file D:\opencv4\opencv\opencv-4.1.0\modules\calib3d\src\calibration.cpp, line 3691

    报错信息: Error: Assertion failed (nimages > 0) in cv::calibrateCameraRO, file D:\opencv4\opencv\open ...

  9. 『AutoHotkey』 效率提升「脚本集」

    AutoHotkey 效率提升脚本集 一些实用的 AutoHotkey 脚本示例,这些可以显著提升工作效率. #Requires AutoHotkey v2.0 ; 1. 快速启动常用程序 ^!n:: ...

  10. Omnivore 替代品 Readeck 安装与使用教程

    前段时间 Omnivore 宣布服务关停,作为一个长期使用 Omnivore 的用户,我需要寻找替代方案. 我对替代品的核心需求是: 浏览器插件:支持一键剪藏当前网页. RSS 支持:能够输入 RSS ...