Closed YALYAshley closed 3 months ago
Hope to get help, thank you.
I also met this problem. May I ask if you have resolved it?
I also met this problem. May I ask if you have resolved it?
Not yet.
In the call to the generate function, in the blip2_vicuna_instruct.py
file, amend the call to the generate function, L465 to include the max_new_tokens
as follows:
outputs = self.llm_model.generate( inputs_embeds=inputs_embeds, attention_mask=attention_mask, do_sample=use_nucleus_sampling, top_p=top_p, temperature=temperature, num_beams=num_beams, max_length=max_length, min_length=min_length,
eos_token_id=self.eos_token_id,
repetition_penalty=repetition_penalty, length_penalty=length_penalty, num_return_sequences=num_captions, max_new_tokens=max_length, # Here )
In the call to the generate function, in the file, amend the call to the generate function, L465 to include the as follows:
blip2_vicuna_instruct.py``max_new_tokens
outputs = self.llm_model.generate( inputs_embeds=inputs_embeds, attention_mask=attention_mask, do_sample=use_nucleus_sampling, top_p=top_p, temperature=temperature, num_beams=num_beams, max_length=max_length, min_length=min_length,
eos_token_id=self.eos_token_id,
repetition_penalty=repetition_penalty, length_penalty=length_penalty, num_return_sequences=num_captions, max_new_tokens=max_length, # Here )
Thank you. I will try it.
When I choose to run test_qa.sh, the following error occurs: ValueError: Input length of input_ids is 0, but
max_length
is set to -43. This can lead to unexpected behavior. You should consider increasingmax_length
or, better yet, settingmax_new_tokens
.This is my test_qa.sh: checkpoint_path='/saved_model/MSVD_qa/checkpoint_best.pth' torchrun --nproc_per_node=4 \ --master_port=34652 \ train.py \ --cfg-path lavis/projects/malmm/qa_msvd.yaml \ --options \ model.arch blip2_vicuna_instruct \ model.model_type vicuna7b \ model.load_finetuned False \ model.load_pretrained True \ model.num_query_token 32 \ model.vit_precision fp16 \ model.freeze_vit True \ model.memory_bank_length 10 \ model.num_frames 80 \ run.init_lr 1e-4 \ run.max_epoch 5 \ run.num_beams 5 \ run.batch_size_train 8 \ run.batch_size_eval 8 \ run.accum_grad_iters 1 \ run.num_workers 12 \ run.seed 42 \ run.evaluate True \ run.valid_splits "['val', 'test']" \ run.report_metric True \ run.prefix test \ run.resume_ckpt_path ${checkpoint_path}