Skip to content

Some configuration files are missing after finetuning bge-m3 model #1326

Open

Description

@chansonzhang

我对 bge-m3 模型进行微调 后发现一些配置文件丢失了,这些文件包括:

  1. modules.json
  2. config_sentence_transformers.json
  3. 1_Pooling/config.json

这会导致以下问题:

  1. No sentence-transformers model found with name xxx. Creating a new one with mean pooling. (c.f. issues#1238)
  2. 使用 optimum-cli 导出 onnx 模型时, 导出的模型结构中会缺少最后的 sentence embedding 输出.

我通过将原始 bge-m3 模型中的上述文件拷贝到我的微调后模型目录中解决了上述问题,但是这样有两个问题:

  1. 需要手动拷贝,麻烦且易出错
  2. 导致一致性问题,如果我在拷贝这些配置文件前使用 SentenceTransformer 加载模型,默认使用的 mean pooling, 如果拷贝了配置文件后再加载会按照配置使用 CLS pooling.

Activity

  1. changed the title [-]Some configuration files are missing after finetuning[/-] [+]Some configuration files are missing after finetuning bge-m3 model[/+] on Jan 10, 2025
  2. 545999961 commented on Jan 15, 2025

    @545999961
    Collaborator

    transformers是什么版本呢

  3. chansonzhang commented on Feb 7, 2025

    @chansonzhang
    Author

    transformers是什么版本呢

    @545999961
    transformers==4.44.2

  4. gaohongkui commented on Apr 30, 2025

    @gaohongkui

    # if self.is_world_process_zero():
    # save_ckpt_for_sentence_transformers(output_dir,
    # pooling_mode=self.args.sentence_pooling_method,
    # normlized=self.args.normlized)

    # if self.is_world_process_zero():
    # save_ckpt_for_sentence_transformers(output_dir,
    # pooling_mode=self.args.sentence_pooling_method,
    # normlized=self.args.normlized)

    看起来是这里引起的,为什么要注释这些行呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions