Avoid trust_remote_code with transformers v5.6.0

#3
by tomaarsen HF Staff - opened

Hello!

Pull Request overview

  • Drop the auto_map shim and modeling_e5_omni.py re-export, and remove trust_remote_code=True from the README snippet
  • Fix sentence_bert_config.json: transformer_task should now be "any-to-any" as we need to import with AutoModelForMultimodalLM instead of AutoModel
  • Pin transformers>=5.6.0 in the README install line and in config_sentence_transformers.json

Details

This is a follow-up to #2. That PR required trust_remote_code=True because qwen2_5_omni_thinker could not be loaded out-of-the-box by AutoConfig/AutoModel, which was worked around via a modeling_e5_omni.py re-export plus an auto_map entry in config.json. I resolved that directly on transformers, so this model (and its siblings) can now be loaded without any trust_remote_code=True, custom modeling file, or auto_map entry.

To avoid that, I made a PR on transformers, which has now been merged and released in transformers v5.6.0, which allows this model and its siblings to be loaded without trust_remote_code=True. The changes are rather small, and the model has the same outputs as before.

  • Tom Aarsen
tomaarsen changed pull request status to open
Haon-Chen changed pull request status to merged

Sign up or log in to comment