issue with running the model
Sorry for asking dumb question (especially seeing all the advanced ones about fine-tuning and quantization :) ). But I am facing the problem trying to run it with the code snippet from the model card
from transformers import AutoTokenizer, FuyuForCausalLM , FuyuProcessor, FuyuImageProcessor
ImportError: cannot import name 'FuyuForCausalLM' from 'transformers'
I am on transforems==4.34.1
attempt to use
Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="adept/fuyu-8b")
leads to the following error:
miniconda3/lib/python3.11/site-packages/transformers/models/auto/configuration_auto.py", line 748, in getitem
raise KeyError(key)
KeyError: 'fuyu'
So what is the proper way / config to run the model?
Thank you! Appreciate you prompt advice
Hi, I tried doing this but still getting
โญโ ~/workspace/mine-misc ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท Py mine-misc 3.10.13
โฐโโฏ pip install git+https://github.com/huggingface/transformers
Collecting git+https://github.com/huggingface/transformers
Cloning https://github.com/huggingface/transformers to /private/var/folders/m_/t431rmpd1gjdb50j74qzsc_h0000gp/T/pip-req-build-sq9homdr
Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers /private/var/folders/m_/t431rmpd1gjdb50j74
qzsc_h0000gp/T/pip-req-build-sq9homdr
Resolved https://github.com/huggingface/transformers to commit 33f98cfded1724e12be11a3b3333e4821de9bbbe
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: tqdm>=4.27 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (from tra
nsformers==4.35.0.dev0) (4.66.1)
Requirement already satisfied: huggingface-hub<1.0,>=0.16.4 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-
packages (from transformers==4.35.0.dev0) (0.17.3)
Requirement already satisfied: numpy>=1.17 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (from tr
ansformers==4.35.0.dev0) (1.26.1)
Requirement already satisfied: safetensors>=0.3.1 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (
from transformers==4.35.0.dev0) (0.4.0)
Requirement already satisfied: packaging>=20.0 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (fro
m transformers==4.35.0.dev0) (23.2)
Requirement already satisfied: regex!=2019.12.17 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (f
rom transformers==4.35.0.dev0) (2023.10.3)
Requirement already satisfied: filelock in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (from trans
formers==4.35.0.dev0) (3.12.4)
Requirement already satisfied: pyyaml>=5.1 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (from tr
ansformers==4.35.0.dev0) (6.0.1)
Requirement already satisfied: tokenizers<0.15,>=0.14 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packag
es (from transformers==4.35.0.dev0) (0.14.1)
Requirement already satisfied: requests in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (from trans
formers==4.35.0.dev0) (2.31.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-pa
ckages (from huggingface-hub<1.0,>=0.16.4->transformers==4.35.0.dev0) (4.8.0)
Requirement already satisfied: fsspec in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (from hugging
face-hub<1.0,>=0.16.4->transformers==4.35.0.dev0) (2023.10.0)
Requirement already satisfied: certifi>=2017.4.17 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (
from requests->transformers==4.35.0.dev0) (2023.7.22)
Requirement already satisfied: idna<4,>=2.5 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (from r
equests->transformers==4.35.0.dev0) (3.4)
Requirement already satisfied: charset-normalizer<4,>=2 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-pack
ages (from requests->transformers==4.35.0.dev0) (3.3.1)
Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/htammineedi/.pyenv/versions/3.10.13/envs/mine-misc/lib/python3.10/site-packages (
from requests->transformers==4.35.0.dev0) (2.0.7)
[notice] A new release of pip is available: 23.0.1 -> 23.3.1
[notice] To update, run: python3.10 -m pip install --upgrade pip
โญโ ~/workspace/mine-misc ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท 15s Py mine-misc 3.10.13
โฐโโฏ python
Python 3.10.13 (main, Oct 15 2023, 09:30:15) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from transfomers import FuyuProcessor
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'transfomers'
>>> from transformers import FuyuProcessor
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utili
ties can be used.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'FuyuProcessor' from 'transformers' (/Users/htammineedi/.pyenv/versions/mine-misc/lib/python3.10/site-package
s/transformers/__init__.py)
>>>
Hey
@htamm-ramp
, are you sure your dev environment/PYTHONPATH is setup correctly? Building from source in my conda env allows me import FuyuProcessor
from transformers
. Maybe you have a conflicting installation of transformers from PyPI?
Hey.
@htamm-ramp
, try install torch
and pillow
.
pip install torch pillow