chaofan
chaofan
可能是pytorch版本比较低的缘故 可以尝试`reranker = FlagReranker('/root/workspace/bge-reranker-v2-m3', use_fp16=False, device='cpu')`将模型放在CPU上看是否可以顺利加载
If you download reranker-v2-minicpm-layerwise, you can load it with the following method: 1. make sure `configuration_minicpm_reranker.py` and `modeling_minicpm_reranker.py` in `/path/bge-reranker-v2-minicpm-layerwise`. 2. modify the following part of `config.json`: ``` "auto_map": {...
> @545999961 Why are we turning off direct download from Huggingface in Commit [65cd70d](https://github.com/FlagOpen/FlagEmbedding/commit/65cd70d73fc26dedbba5ceb1423b983cb7ee1c52)? If we remove `local_files_only=True` then it works and having local file only seems quite inconvenient. I'm...
Can you provide specific error information? I want to know where the error occurred.
can you provide your version of `transformers` and `flash-attn`
> > can you provide your version of `transformers` and `flash-attn` > > `warnings.warn( /root/anaconda3/envs/zzq_kdd/lib/python3.9/site-packages/transformers/tokenization_utils_base.py:2692: UserWarning:`max_length`is ignored when`padding`=`True`and there is no truncation strategy. To pad to max length, use`padding='max_length'`. warnings.warn(...
> > can you provide your version of `transformers` and `flash-attn` > > > can you provide your version of `transformers` and `flash-attn` > > During the process of fine-tuning...
这里的方法主要是针对lora设计的 如果是全量的话保存的是整个模型BiEncoderModel,将下面这部分注释掉后可以保存AutoModelForCausalLM加载的模型 ``` if not self.use_lora: super()._save(output_dir, state_dict) return ```
1. 修改`save_steps`参数可以设置保存的步数 2. 可能是有个别样例会超过最长的max_len,可以修改https://github.com/FlagOpen/FlagEmbedding/blob/53cfac4a50ac0e023b2f8d19b10667c9c210fa41/FlagEmbedding/reranker/data.py#L40 的`truncation=True`为`truncation='longest_first'` 3. 模型合并指的是LLM-reranker合并吗,LLM-reranker的合并是将lora的参数合并到原始的模型之上
1. 在训练的时候添加`save_steps`参数就可以了 2. 可以修改这部分代码 ``` qry_inputs = self.tokenizer.encode(qry_encoding, truncation=True, max_length=self.args.max_len * 3 // 4, add_special_tokens=False) doc_inputs = self.tokenizer.encode(doc_encoding, truncation=True, max_length=self.args.max_len, add_special_tokens=False) item = self.tokenizer.prepare_for_model( qry_inputs, doc_inputs, truncation='only_second', max_length=self.args.max_len, ) ```...