Automatic Speech Recognition
Transformers
Safetensors
phi4mm
text-generation
nlp
code
audio
speech-summarization
speech-translation
visual-question-answering
phi-4-multimodal
phi
phi-4-mini
custom_code
Eval Results
Instructions to use microsoft/Phi-4-multimodal-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/Phi-4-multimodal-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="microsoft/Phi-4-multimodal-instruct", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-4-multimodal-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
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