Run this model with HF Jobs

Run briaai/RMBG-2.0 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/briaai/RMBG-2.0. Ask me which dataset to train on, then push the fine-tuned model to a new private model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/briaai/RMBG-2.0 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

issue with new transformer

#38
by ABDALLALSWAITI - opened
bash
model = AutoModelForImageSegmentation.from_pretrained('briaai/RMBG-2.0', trust_remote_code=True)
  File "/home/abdallah/Desktop/test imagen/.venv/lib/python3.13/site-packages/transformers/models/auto/auto_factory.py", line 597, in from_pretrained
    return model_class.from_pretrained(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        pretrained_model_name_or_path, *model_args, config=config, **hub_kwargs, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/abdallah/Desktop/test imagen/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 288, in _wrapper
    return func(*args, **kwargs)
  File "/home/abdallah/Desktop/test imagen/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 5106, in from_pretrained
    model.tie_weights()
    ~~~~~~~~~~~~~~~~~^^
  File "/home/abdallah/Desktop/test imagen/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 3136, in tie_weights
    module.tie_embeddings_and_encoder_decoder()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/abdallah/Desktop/test imagen/.venv/lib/python3.13/site-packages/transformers/modeling_utils.py", line 3112, in tie_embeddings_and_encoder_decoder
    if getattr(self.config.get_text_config(decoder=True), "tie_word_embeddings", True):
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/home/abdallah/Desktop/test imagen/.venv/lib/python3.13/site-packages/transformers/configuration_utils.py", line 1238, in get_text_config
    if not return_both and len(valid_text_config_names) == 0 and config_to_return.is_encoder_decoder:
                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abdallah/Desktop/test imagen/.venv/lib/python3.13/site-packages/transformers/configuration_utils.py", line 207, in __getattribute__
    return super().__getattribute__(key)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
AttributeErro

worked with transformers==4.54.1

I copied an updated birefnet.py (https://huggingface.co/ZhengPeng7/BiRefNet/blob/main/birefnet.py) into the RMBG model folder and it appears to work.

BRIA AI org

@ABDALLALSWAITI thanks for your comment, should be working now with latest Transformers.

Sign up or log in to comment