DankoZhang

Results 13 comments of DankoZhang

> 请提供测速的方法。 btw,lmdeploy没有针对 vlm 中的视觉模型做优化,优化的是它的语言模型部分。 测速的方法是,用同一批数据请求量化后和量化前的模型,分别统计两者的用时

> 能不能直接贴测试代码呢?对着代码说更清楚些。btw,vision 模型默认的batch size只有1。是要调整的。 def infer_data(self, input_path, output_path): total_time = 0 fw = open(output_path, "w") with open(input_path, "r") as fr: for line in tqdm(fr.readlines()): r = json.loads(line.strip()) url = r["image"]...

> 能不能直接贴测试代码呢?对着代码说更清楚些。btw,vision 模型默认的batch size只有1。是要调整的。 另外请教下,『vision 模型默认的batch size只有1』,是什么意思,这个哪里用到了,跟github中的批处理有关系吗?(下面的代码) from lmdeploy import pipeline, TurbomindEngineConfig from lmdeploy.vl import load_image pipe = pipeline('liuhaotian/llava-v1.6-vicuna-7b', backend_config=TurbomindEngineConfig(session_len=8192)) image_urls=[ "https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/human-pose.jpg", "https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/det.jpg" ] prompts = [('describe this image', load_image(img_url))...

> vision 模型默认的batch size只有1。是要调整的。 这句话是啥意思,这个在哪里调整呢

> I think we need to know more information before we can help you. > > Can you provide a minimal reproducer? @hmellor thanks,here is my code,`tmp_gene_data` is my input...

> 能否提供一下更详细的需求? @lll2343 感谢回复,这里的出发点是输入的图片分辨率比较大,num_image_token的数量需要从256->64, 想过两个方案,一是直接修改mlp1层,二是增加一个新的mlp用于降维,想了解下怎么训练比较好,或者是否有其他方案? 另外,如果相要提升模型对特定领域流程图的理解能力,应该怎么训练呢?

> Hi, > > 1. **修改 MLP 无法减少 `num_image_token`** > `pixel_shuffle` 已降低 `num_image_token`,详见 [[extract_feature函数](https://github.com/OpenGVLab/InternVL/blob/main/internvl_chat/internvl/model/internvl_chat/modeling_internvl_chat.py#272)]。 > 如果输入图片分辨率较高,可以通过调整 `max_dynamic_patch` 来减少切图数量。 > 2. **增加训练步数** > 修改 `[meta.json]`中的 `repeat_time` 参数(见 [meta.json](https://github.com/OpenGVLab/InternVL/blob/main/internvl_chat/shell/data/coco_caption.json#L6)),在该数据集上训练更多步数以提升性能。 @lll2343 ,感谢回复~ 1....

> Hi, > > 1. **降低 `num_image_token` 的方法** > 修改 `MLP1` 并不会直接减少 `num_image_token`。实际上,这是通过 `pixel_shuffle` 来实现的。目前 `downsample_ratio` 设置为 0.5,`num_image_token` 已经从 256 降低到了 64。您可以将 `downsample_ratio` 设置得更小,例如 0.25,这样 `num_image_token` 将从 256 降至 16。具体实现请参考...