Run this model with HF Jobs

Run microsoft/Florence-2-large 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 and TRL to fine-tune https://huggingface.co/microsoft/Florence-2-large. Ask me which dataset to train on, then push the fine-tuned model to a new 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/microsoft/Florence-2-large 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.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/microsoft/Florence-2-large. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/microsoft/Florence-2-large. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

doesn't work well with transformers >= 4.52.1

#104
by kimsia - opened
lib/python3.12/site-packages/torch/nn/modules/module.py", line 1940, in __getattr__
    raise AttributeError(
AttributeError: 'DaViT' object has no attribute '_initialize_weights'

No such issue when transformers 4.51.3

But, I get this issue when using with transformers 4.52.1 and higher (was using 4.52.3)

I can confirm 4.51.3 has no issues

It's broken above 4.49...Please fix this otherwise I'll be forced to no longer use these great models...

https://github.com/huggingface/transformers/issues/36886

Hi, I’m facing an issue while trying to load the DaViT model.
When I instantiate the model, I get the following error:

AttributeError: 'DaViT' object has no attribute '_initialize_weights'

Please define the _initialize_weights function in the DaViT class, or remove the call if it’s not needed (especially if the model is pretrained and doesn’t require reinitialization).

Kindly guide me on this as soon as possible (ASAP).

Thanks in advance!

gopi123456789987654321

Just downgrade transformers

That’s what I did

kimsia

it is working now

Thank you very much

It's broken above 4.49...Please fix this otherwise I'll be forced to no longer use these great models...

https://github.com/huggingface/transformers/issues/36886

Not correct. Works with 4.51.3

AttributeError: 'DaViT' object has no attribute '_initialize_weights'

My investigation of this problem showed that the problem is not only in transformers, but in the incompatibility of triton and xformers versions.
In the end, I had to manually remove folders torch, torchvision, torchaudio. Install torch==2.7.1 for cu126, transformers==4.51.1, triton==3.2.0+gited43d228, xformers==0.0.31
And only after that the problems disappeared.

Can we update the model card of the dependencies used and their versions?

In the config.json there is a line: "transformers_version": "4.41.0.dev0", which i,of course,the minimum version.It would be nice if there was also a line for the Maximum supported version. Maybe: "transformers_max: "4.51.3"

I ran into the issue that the maximum version for Florence2 was lower then the minimum version for gemma3, so I built two instances separately to work on them. I have never tried to load two transformers versions at once in the same app. I'm not sure it has the code to be called by version number without constantly replacing itself.

Sign up or log in to comment