首先,下载Qwen2-VL-72B-Instruct-GPTQ-Int4模型到指定路径(例如:/root/xiedong/Qwen2-VL-72B-Instruct-GPTQ-Int4
)。该路径可以根据实际情况调整。
在之前的文章 【深度学习】LLaMA-Factory部署Qwen2-VL 中,已经介绍了如何部署未量化的模型。本篇将讨论如何部署量化过的模型,即 Qwen2-VL-72B-Instruct-GPTQ-Int4。
官方教程地址:[AutoGPTQ 教程](https://github.com/AutoGPTQ/AutoGPTQ/blob/main/README_zh.md
初始化:
cvoid OLED_Init(void)
{
oled_port_init();
delay(4000); //初始化之前的延时很重要!
OLED_WR_Byte_(0xAE, OLED_CMD); //--display off
OLED_WR_Byte_(0x00, OLED_CMD); //---set low column address
OLED_WR_Byte_(0x10, OLED_CMD); //---set high column address
OLED_WR_Byte_(0x40, OLED_CMD); //--set start line address
OLED_WR_Byte_(0xB0, OLED_CMD); //--set page address
OLED_WR_Byte_(0x81, OLED_CMD); // contract control
OLED_WR_Byte_(0xFF, OLED_CMD); //--128
OLED_WR_Byte_(0xA1, OLED_CMD); //set segment remap
OLED_WR_Byte_(0xA6, OLED_CMD); //--normal / reverse
OLED_WR_Byte_(0xA8, OLED_CMD); //--set multiplex ratio(1 to 64)
OLED_WR_Byte_(0x3F, OLED_CMD); //--1/32 duty
OLED_WR_Byte_(0xC8, OLED_CMD); //Com scan direction
OLED_WR_Byte_(0xD3, OLED_CMD); //-set display offset
OLED_WR_Byte_(0x00, OLED_CMD); //
OLED_WR_Byte_(0xD5, OLED_CMD); //set osc division
OLED_WR_Byte_(0x80, OLED_CMD); //
OLED_WR_Byte_(0xD8, OLED_CMD); //set area color mode off
OLED_WR_Byte_(0x05, OLED_CMD); //
OLED_WR_Byte_(0xD9, OLED_CMD); //Set Pre-Charge Period
OLED_WR_Byte_(0xF1, OLED_CMD); //
OLED_WR_Byte_(0xDA, OLED_CMD); //set com pin configuartion
OLED_WR_Byte_(0x12, OLED_CMD); //
OLED_WR_Byte_(0xDB, OLED_CMD); //set Vcomh
OLED_WR_Byte_(0x30, OLED_CMD); //
OLED_WR_Byte_(0x8D, OLED_CMD); //set charge pump enable
OLED_WR_Byte_(0x14, OLED_CMD); //
OLED_Clear();
OLED_WR_Byte_(0xAF, OLED_CMD); //--turn on oled panel
}
multiprocessing.set_start_method('spawn')
在 Python 的并发编程领域,如何管理进程的启动对于确保程序稳定性和合理管理资源至关重要。multiprocessing
模块为启动子进程提供了几种方法,其中 spawn
是在某些场景下特别有用和稳健的选项。