当前位置: 首页 > wzjs >正文

网站建设讨论会手工制作玩具

网站建设讨论会,手工制作玩具,做拍卖网站怎么样,wordpress 连接微信ktransformers 上的 DeepSeek-R1 671B open-webui 一、下载GGUF模型1. 创建目录2. 魔塔下载 DeepSeek-R1-Q4_K_M3. 安装显卡驱动和cuda4. 显卡 NVIDIA GeForce RTX 4090 二、安装ktransformers1. 安装依赖2. 安装uv工具链3. 下载源码4. 创建python虚拟环境 三、编译ktransforme…

ktransformers 上的 DeepSeek-R1 671B open-webui

  • 一、下载GGUF模型
    • 1. 创建目录
    • 2. 魔塔下载 DeepSeek-R1-Q4_K_M
    • 3. 安装显卡驱动和cuda
    • 4. 显卡 NVIDIA GeForce RTX 4090
  • 二、安装ktransformers
    • 1. 安装依赖
    • 2. 安装uv工具链
    • 3. 下载源码
    • 4. 创建python虚拟环境
  • 三、编译ktransformers
  • 四、运行ktransformers
    • 1. 后台运行
    • 2. API 测试
  • 五、open-webui 集成
    • 1. 安装 open-webui
    • 2. 运行脚本go.sh
    • 3. 启动过程很慢,监听端口 3000 运行后可以访问web界面
  • 参考

一、下载GGUF模型

1. 创建目录

mkdir DeepSeek-R1-GGUF

2. 魔塔下载 DeepSeek-R1-Q4_K_M

https://www.modelscope.cn/models/unsloth/DeepSeek-R1-GGUF

3. 安装显卡驱动和cuda

wget https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda_12.6.0_560.28.03_linux.run
sudo sh cuda_12.6.0_560.28.03_linux.run

4. 显卡 NVIDIA GeForce RTX 4090

NVIDIA-SMI 560.35.05 
CUDA Version: 12.6  

二、安装ktransformers

1. 安装依赖

sudo apt-get install git

2. 安装uv工具链

curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
which uv
which uvx

3. 下载源码

git clone https://github.com/kvcache-ai/ktransformers.git
cd ktransformers
git checkout 94ab2de
git rev-parse --short HEAD # 应显示 94ab2de

4. 创建python虚拟环境

# uv venv ./venv --python 3.11 --python-preference=only-managed
Using CPython 3.11.11
Creating virtual environment at: ./venv
Activate with: source venv/bin/activate

三、编译ktransformers

apt-get install build-essential cmake
source venv/bin/activate
uv pip install -r requirements-local_chat.txt
uv pip install setuptools wheel packaging
# uv pip install setuptools wheel packaging
Using Python 3.11.11 environment at: 
Resolved 3 packages in 454ms
Prepared 1 package in 133ms
░░░░░░░░░░░░░░░░░░░░ [0/2] Installing wheels...                                                                                                     warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.If the cache and target directories are on different filesystems, hardlinking may not be supported.If this is intentional, set `export UV_LINK_MODE=copy` or use `--link-mode=copy` to suppress this warning.
Installed 2 packages in 102ms+ setuptools==75.8.0+ wheel==0.45.1# uv pip install --link-mode=copy packaging
Using Python 3.11.11 environment at:
Audited 1 package in 2ms
系统的物理CPU核心数量
export MAX_JOBS=72
export CMAKE_BUILD_PARALLEL_LEVEL=72
# 安装flash_attn
uv pip install flash_attn --no-build-isolation
export UV_LINK_MODE=copy
uv pip install flash_attn --no-build-isolation
export USE_NUMA=1
git submodule init
git submodule update
KTRANSFORMERS_FORCE_BUILD=TRUE uv pip install . --no-build-isolation

四、运行ktransformers

PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python3 ktransformers/server/main.py \--gguf_path /DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M/ \--model_path deepseek-ai/DeepSeek-R1 \--model_name unsloth/DeepSeek-R1-GGUF \--cpu_infer 16 \--max_new_tokens 8192 \--cache_lens 32768 \--total_context 32768 \--cache_q4 true \--temperature 0.6 \--top_p 0.95 \--optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml \--force_think \--use_cuda_graph \--host 0.0.0.0 \--port 8080

1. 后台运行

nohup env PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python3 ktransformers/server/main.py \--gguf_path /DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M/ \--model_path deepseek-ai/DeepSeek-R1 \--model_name unsloth/DeepSeek-R1-GGUF \--cpu_infer 16 \--max_new_tokens 8192 \--cache_lens 32768 \--total_context 32768 \--cache_q4 true \--temperature 0.6 \--top_p 0.95 \--optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml \--force_think \--use_cuda_graph \--host 0.0.0.0 \--port 8080 >> server.log 2>&1 &

2. API 测试

curl http://IP:8080/v1/chat/completions \-H "Content-Type: application/json" \-d '{"model": "DeepSeek-R1","messages": [{"role": "user", "content": "你是谁!"}]}'

五、open-webui 集成

1. 安装 open-webui

mkdir open-webui
cd open-webui
uv venv ./venv --python 3.11
source venv/bin/activate
uv pip install open-webui

2. 运行脚本go.sh

#!/usr/bin/env bashsource venv/bin/activate# open-webui 不原生支持HOST和PORT环境变量,需手动传递参数
# https://docs.openwebui.com/getting-started/env-configuration/#port
# 若open-webui运行异常,可执行`rm -rf ./data`清除数据后重启服务并清理浏览器缓存export DATA_DIR="$(pwd)/data"
export ENABLE_OLLAMA_API=False
export ENABLE_OPENAI_API=True
export OPENAI_API_KEY="dont_change_this_cuz_openai_is_the_mcdonalds_of_ai"
export OPENAI_API_BASE_URL="http://IP:8080/v1" # <--- 需与ktransformers/llama.cpp的API配置匹配
#export DEFAULT_MODELS="openai/foo/bar" # <--- 保留注释,此参数用于`litellm`接入
export WEBUI_AUTH=False
export DEFAULT_USER_ROLE="admin"
export HOST=0.0.0.0
export PORT=3000 # <--- open-webui网页服务端口open-webui serve \--host $HOST \--port $PORT# 在浏览器中访问显示的URL:端口

3. 启动过程很慢,监听端口 3000 运行后可以访问web界面

netstat -netlp    

在这里插入图片描述

参考

  1. ktransformers 上的 DeepSeek-R1 671B
  2. ktransformers
http://www.dtcms.com/wzjs/611444.html

相关文章:

  • 一个网站如何做cdn加速器互联网营销师培训费用是多少
  • 网站制作眼html网页作业
  • 福州云建站模版旅游电子商务网站建设情况
  • php能做手机网站吗哈尔滨seo优化教程
  • 飞创网站建设专业网页设计培训班价格
  • 自己做网站怎么上传到网上wordpress 页面nofollow
  • 平台网站制作湖南响应式网站建设
  • 网站页面示意图怎么做友联建设集团官方网站
  • 效果图网站有哪些好的青岛网站制作
  • 东莞阳光网官方网站郑州哪里有做网站
  • 连云港网站建设价位WordPress未设置密码用户
  • 贵阳app下载首页网站关键词优化教程
  • 莱州做网站汕头建设银行电话
  • 网站运营建站优化专家宁波外贸网站设计公司
  • 杭州做网站seowordpress 移除字体
  • 廊坊网站建微信公众号小程序制作流程
  • wordpress搬站流程mvc5 网站开发美學 pdf
  • 阿里云购买网站登录wordpress伪静态404错误
  • centos6.6做网站fedora做网站服务器
  • 建立公司网站的好处jsp网站 值班
  • 张家口网站建设电话全部游戏免费(试玩)不用下载
  • 招投标网站销售怎么做小区媒体网站建设
  • 怎么区别做pc端和手机端网站云南商城网站建设
  • 产品做网站推广银川建设厅网站
  • 中启智联网站建设影楼网站怎么做
  • 淘宝联盟的网站怎么自己做一建论坛建工教育网
  • ps做网站首页怎么石家庄展为网络科技有限公司
  • 网站管理系统是什么建外贸网站 东莞
  • 批量建站怎么赚钱网页源码下载
  • 网页设计优化网站建设可以吗Wordpress可以卸载吗