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

给一个网站做需求分析陕西新闻今日头条

给一个网站做需求分析,陕西新闻今日头条,西乡网站建设,如何更改网站标题本文的server.py和req.py代码参见:https://github.com/zysNLP/quickllm 配套课程《AIGC大模型理论与工业落地实战》;Deepseek相关课程更新中 1. 安装相关docker镜像:nvcr.io/nvidia/pytorch:25.02-py3 docker pull nvcr.io/nvidia/pytorch:…

本文的server.py和req.py代码参见:https://github.com/zysNLP/quickllm
配套课程《AIGC大模型理论与工业落地实战》;Deepseek相关课程更新中

1. 安装相关docker镜像:nvcr.io/nvidia/pytorch:25.02-py3

docker pull nvcr.io/nvidia/pytorch:25.02-py3

2. 启动docker

docker run -idt --network host --shm-size=64g --name vllm --restart=always --gpus all -v /data2/users/yszhang/quickllm:/quickllm nvcr.io/nvidia/pytorch:25.02-py3 /bin/bash

3. 在魔塔中下载相关模型

pip install modelscope
modelscope download --model Qwen/Qwen2.5-VL-7B-Instruct --local_dir /data2/users/yszhang/quickllm/qwen2.5-vl-instruct

4.进入docker容器,安装conda环境;下载LLama-Factory

docker exec -it vllm /bin/bash
cd /quickllm
bash Miniconda3-latest-Linux-x86_64.sh
conda create -n sft python=3.11
conda activate sftgit clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
cd LLaMA-Factory
pip install -e ".[torch,metrics]"

5. 启动LLaMA-Factory的web ui

llamafactory-cli webui

6. 训练模型、融合lora参数

# 融合后的模型路径/quickllm/LLaMA-Factory/qwen2.5-mmlm0513;以webui的实际调整为准llamafactory-cli train \--stage sft \--do_train True \--model_name_or_path /quickllm/qwen2.5-vl-instruct \--preprocessing_num_workers 16 \--finetuning_type lora \--template qwen2_vl \--flash_attn auto \--dataset_dir data \--dataset mllm_demo \--cutoff_len 2048 \--learning_rate 5e-05 \--num_train_epochs 3.0 \--max_samples 100000 \--per_device_train_batch_size 2 \--gradient_accumulation_steps 8 \--lr_scheduler_type cosine \--max_grad_norm 1.0 \--logging_steps 5 \--save_steps 100 \--warmup_steps 0 \--packing False \--report_to none \--output_dir saves/Qwen2.5-VL-7B-Instruct/lora/train_2025-05-16-05-48-02 \--bf16 True \--plot_loss True \--trust_remote_code True \--ddp_timeout 180000000 \--include_num_input_tokens_seen True \--optim adamw_torch \--lora_rank 8 \--lora_alpha 16 \--lora_dropout 0 \--lora_target all

7. 创建conda环境安装vllm/transformers

conda create -n vllm python=3.11
conda activate vllm
pip install vllm -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install transformers -i https://pypi.tuna.tsinghua.edu.cn/simple

8. 启动vllm+fastapi服务

python server.py

9. 请求服务

python req.py

模型实测速度 

使用batch的方式请求同一条数据;速度1000条/20s。(这里因为是同一条图文数据所以速度会更快,如果用不同的图文数据速度会稍慢一些,但是也非常快!)

Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.
INFO:     Started server process [19930]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:7868 (Press CTRL+C to quit)
Processed prompts: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  7.68it/s, est. speed input: 899.09 toks/s, output: 430.33 toks/s]
INFO:     127.0.0.1:60618 - "POST /chat HTTP/1.1" 200 OK
Processed prompts: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  7.58it/s, est. speed input: 886.83 toks/s, output: 424.46 toks/s]
INFO:     127.0.0.1:60620 - "POST /chat HTTP/1.1" 200 OK
Processed prompts: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  7.58it/s, est. speed input: 887.41 toks/s, output: 424.74 toks/s]
INFO:     127.0.0.1:44776 - "POST /chat HTTP/1.1" 200 OK
Processed prompts: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:02<00:00, 47.28it/s, est. speed input: 5532.30 toks/s, output: 2647.93 toks/s]
INFO:     127.0.0.1:47144 - "POST /chat HTTP/1.1" 200 OK
Processed prompts: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:16<00:00, 62.39it/s, est. speed input: 7299.34 toks/s, output: 3493.70 toks/s]
INFO:     127.0.0.1:38156 - "POST /chat HTTP/1.1" 200 OK
Processed prompts: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:15<00:00, 62.51it/s, est. speed input: 7313.23 toks/s, output: 3500.35 toks/s]
INFO:     127.0.0.1:50830 - "POST /chat HTTP/1.1" 200 OK
Processed prompts: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:16<00:00, 62.35it/s, est. speed input: 7295.48 toks/s, output: 3491.85 toks/s]

http://www.dtcms.com/wzjs/392853.html

相关文章:

  • 有个网站可以接单做设计的抖音广告
  • 太原网站建设技术外包如何介绍自己设计的网页
  • 大连爱得科技网站建设公司怎么样政府免费培训面点班
  • 内部网站制作推广app用什么平台比较好
  • Editplus做网站电商网站开发平台有哪些
  • 室内设计效果图手机软件哈尔滨网站优化流程
  • 怎么做产品网站推广关键词你们懂的
  • 洛阳做网站公司电话免费一键生成个人网站
  • 宝鸡网站建设为微信推广软件哪个好
  • 织梦网站模板怎么做优化技术
  • 做钓鱼网站会被抓吗seo搜索引擎是什么意思
  • 做网站得叫什么软件免费网站友情链接
  • 网站创建的一般步骤二维码引流推广的平台
  • 字体设计图片优化师培训机构
  • 国内做网站大公司有哪些企业网站制作哪家好
  • 网站建设的费用百度点击器下载
  • 在职考研哪个网站做的好百度账号注册申请
  • 广州网站设计公司招聘宁波seo行者seo09
  • 网站里的横幅广告怎么做中文网站排名
  • 关于政府网站群建设的咨询函中国seo网站
  • 网站模板 寻模板网站流量统计查询
  • 可以在自己的电脑上做网站吗广州网站建设工作室
  • 自己做网站实时监控中国十大软件外包公司
  • 佛山外贸网站建设方案国内疫情最新情况
  • 宣传片拍摄脚本模板东莞做网站seo
  • 网站建设一定要公司吗邯郸seo优化
  • 厦门网站seo建设上海网站建设服务
  • 什么软件可以做动漫视频网站教育培训机构有哪些
  • qq网站在线登录网页版山东网站seo
  • 如何用华为云服务器做网站软件外包平台