多模态大模型2

Datawhale (linklearner.com) 第五期的夏令营快要开始了,全程免费,推荐给想要学习的小伙伴们~

Datajuicer:数据合成

1、Try Data-Juicer in your browser in a JupyterLab. 

JupyterHubicon-default.png?t=N7T8http://8.138.149.181/hub/login?next=%2Fhub%2F%3Fspm%3Da2c22.12281978.0.0.376b10bel5pWsN

2、Run datajuicer by example:

## dj-process --config solution/**.yaml

dataset_path: input/data-of-image-text-pair.jsonl
export_path: output/image_captioning_output.jsonl

process:
  - image_captioning_mapper:
      hf_img2seq: '/path/to/a/local/downloaded/HF/model'
      keep_original_sample: false   # we only need the recaptioned captions

 data-juicer/configs/config_all.yaml at main · modelscope/data-juicer · GitHubicon-default.png?t=N7T8https://github.com/modelscope/data-juicer/blob/main/configs/config_all.yaml     

3、可能有用的算子:(比赛要求所有数据必须经过合成, 先用-image_captionaing_mapper处理400k全部数据,在已创建的实例(双卡A800-80G)上需要约16h*12元/小时=190+)

线下赛只能使用10k数据,某人训练想要省钱,早上6点关停了机器,结果97%前功尽弃,这件事情已经不是第一次发生了!多存10快可能就处理完了!

400k数据可以测试不同规模的数据量用同一个算子处理会不会对结果影响不同,在做这个大实验之前可以先试试20k!

即使用大规模的数据进行处理通过了预赛,决赛限制了10k数据,所以早失败有早失败的好处!

  - random_selector:                                        # selector to random select samples
      select_ratio:                                           # the ratio to be sampled
      select_num:                                             # the number to be sampled

  # Selector ops


  - frequency_specified_field_selector:                     
# selector to select samples based on the sorted frequency of specified field value
      field_key: ''                                           
# the target keys corresponding to multi-level field information need to be separated by '.'
      top_ratio:                                              
# ratio of selected top specified field value
      topk:                                                   
# number of selected top specified field value
      reverse: True                                           
# determine the sorting rule, if reverse=True, then sort in descending order
  


  - range_specified_field_selector:                         
# selector to select a range of samples based on the sorted specified field value from smallest to largest.
      field_key: ''                                           
# the target keys corresponding to multi-level field information need to be separated by '.'
      lower_percentile:                                       
# the lower bound of the percentile to be sampled
      upper_percentile:                                       
# the upper bound of the percentile to be sampled
      lower_rank:                                             
# the lower rank of the percentile to be sampled
      upper_rank:                                             
# the upper rank of the percentile to be sampled


  - topk_specified_field_selector:                          
# selector to select top samples based on the sorted specified field
      field_key: ''                                           
# the target keys corresponding to multi-level field information need to be separated by '.'
      top_ratio:                                              
# ratio of selected top samples
      topk:                                                   
# number of selected top sample
      reverse: True                                           
# determine the sorting rule, if reverse=True, then sort in descending order

image-text-similarity-filter

  - image_text_similarity_filter:                           
# filter samples according to the similarity between image and text.
      hf_clip: openai/clip-vit-base-patch32                   
# name of used Hugging Face clip
      min_score: 0.1                                          
# the min similarity of filter range
      max_score: 1.0                                          
# the max similarity of filter range
      horizontal_flip: false                                  
# flip image horizontally (left to right).
      vertical_flip: false                                    
# flip image vertically (top to bottom).
      reduce_mode: avg                                        
# reduce mode when one text corresponds to multiple images in a chunk,  must be one of ['avg','max', 'min'].
      any_or_all: any                                         
# keep this sample when any/all images meet the filter condition
      mem_required: '1500MB'                                  
# This operation (Op) utilizes deep neural network models that consume a significant amount of memory for computation, hence the system's available memory might constrains the maximum number of processes that can be launched

image-text-matching-filter

phrase-grounding-recall-filter

模型训练

 ########################### Editable Part Begins ###########################  
export CUDA_VISIBLE_DEVICES=0,1

export NCCL_P2P_DISABLE=1

export NCCL_IB_DISABLE=1



# exp meta information

EXP_NAME=default

PRETRAIN_DATASET=../output/image_captioning_output/res_10k.jsonl PRETRAIN_DATASET_IMAGE_PATH=../input/pretrain_stage_1_10k



# training args

# pretraining

# make sure PRETRAIN_BATCH_SIZE_PER_GPU *PRETRAIN_GRADIENT_ACCUMULATION_STEPS * num_gpus = 256 
PRETRAIN_BATCH_SIZE_PER_GPU=4 PRETRAIN_GRADIENT_ACCUMULATION_STEPS=32 PRETRAIN_DATALOADER_NUM_WORKERS=4 



# finetuning 
# make sure FINETUNE_BATCH_SIZE_PER_GPU * FINETUNE_GRADIENT_ACCUMULATION_STEPS * num_gpus = 128 

FINETUNE_BATCH_SIZE_PER_GPU=4 FINETUNE_GRADIENT_ACCUMULATION_STEPS=16 FINETUNE_DATALOADER_NUM_WORKERS=4 



# log and ckpt 
LOGGING_STEP=1 
CKPT_SAVE_STEPS=100 
TOTAL_SAVE_CKPT_LIMIT=1 


# inference args 
# inference for some benchmarks supports multi-gpus 
INFER_CUDA_IDX="0" 

############################ Editable Part Ends ############################ 

thanks to Datawhale夏令营—(4)多模态大模型 (notion.site)

等合成400kmapping数据要到明天早上,准备待会仔细看一下算力云上储存数据的具体形式,挑选合适的算子

这期间也可以试试从400?数据量疯狂增大以后模型的表现有没有变好

TAT我把这个实例删掉了就像第一次把fulldata下载到系统盘以后把第一个实例删掉一样,跑代码就像我的人生,我不是那种能够看着失误的地方和已经付出的部分想着better than nothing修修补补的人,但凡有不合心意的地方,我只能从头开始,不然只是在浪费时间的开机的金钱(还有我吃下去的粮食)……

  • 28
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Monkey 多模态模型是由阿里云开发的一种大型预训练模型。它采用了多模态学习技术,能够同时处理文本、图像、语音等多种形式的数据,并从中提取出丰富的特征信息。这种模型设计使得它在多种需要跨模态理解的任务上展现出较高的性能。 ### 驱动原理与优势: 1. **统一表示学习**:通过深度学习架构,Monkey 模型能够将不同模态的信息映射到共享的高维空间中,便于后续任务如分类、生成等操作。 2. **端到端学习**:基于强化学习或自监督学习机制,模型可以自动从数据中学习最优策略或表示,无需大量人工标注数据,提高了训练效率和泛化能力。 3. **大规模预训练**:通常,多模态模型会利用大规模未标记数据进行预训练,这有助于模型在各种下游任务中快速适应和获得良好的性能。 4. **高性能应用**:在诸如问答系统、智能推荐、视觉描述生成、语言理解和生成等多个领域,多模态模型展现了强大的处理能力和创新的应用潜力。 ### 实现与应用: - **问答系统**:结合文本理解和图像检索功能,提供更为精准的问题解答服务。 - **智能推荐**:融合用户的历史行为、喜好及实时情境信息,给出个性化的产品或内容推荐。 - **视觉描述生成**:对图像或视频进行描述,帮助视障人群理解多媒体内容,或用于辅助教育场景中的故事讲述。 - **自然语言处理**:提升机器翻译、情感分析、对话系统等任务的准确性和流畅度。 --- ### 相关问题: 1. **如何评估 Monkey 大模型的效果?** 2. **多模态模型与其他类似模型相比有何独特之处?** 3. **如何优化多模态模型的训练过程以提高其性能?**
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值