Run this model with HF Jobs

Run microsoft/Phi-4-multimodal-instruct 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/microsoft/Phi-4-multimodal-instruct. 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/Phi-4-multimodal-instruct 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.

cannot import name 'SlidingWindowCache' from 'transformers.cache_utils'

#71
by alighabusaleh - opened

I have the following issue

  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/user/.cache/huggingface/modules/transformers_modules/microsoft/Phi-4-multimodal-instruct/0af439b3adb8c23fda473c4f86001dbf9a226021/modeling_phi4mm.py", line 29, in <module>
    from transformers.cache_utils import Cache, DynamicCache, SlidingWindowCache, StaticCache
ImportError: cannot import name 'SlidingWindowCache' from 'transformers.cache_utils'

however the version is correct

(.newEnv) user:~$ pip show transformers 
Name: transformers
Version: 4.48.2
Summary: State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow
Home-page: https://github.com/huggingface/transformers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors)
Author-email: transformers@huggingface.co
License: Apache 2.0 License
Location: ~/.newEnv/lib/python3.10/site-packages
Requires: filelock, huggingface-hub, numpy, packaging, pyyaml, regex, requests, safetensors, tokenizers, tqdm
Required-by: peft, pysentimiento, sentence-transformers

any idea how to fix this issue?

Hello, I also occur this problem, do you have solved this problem?

Hi, I'm encountering this issue, have you solved it?

Same here :/ Has anyone managed to solve this problem? How?

Guys, just try to downgrade your transformers library... The SlidingWindowCache class was removed from the public API of transformers.cache_utils starting with Transformers v4.48.0

Sign up or log in to comment