Error when deploying

#3
by JosephH - opened

model = AutoModelForCausalLM.from_pretrained(
File "/opt/conda/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 466, in from_pretrained
return model_class.from_pretrained(
File "/opt/conda/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2629, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/mosaicml/mpt-7b-chat/fa9345560420e2111498f87799ea7dd31cbd647e/modeling_mpt.py", line 205, in init
self.transformer = MPTModel(config)
File "/root/.cache/huggingface/modules/transformers_modules/mosaicml/mpt-7b-chat/fa9345560420e2111498f87799ea7dd31cbd647e/modeling_mpt.py", line 46, in init
self.blocks = nn.ModuleList([MPTBlock(device=config.init_device, **config.to_dict()) for _ in range(config.n_layers)])
File "/root/.cache/huggingface/modules/transformers_modules/mosaicml/mpt-7b-chat/fa9345560420e2111498f87799ea7dd31cbd647e/modeling_mpt.py", line 46, in
self.blocks = nn.ModuleList([MPTBlock(device=config.init_device, **config.to_dict()) for _ in range(config.n_layers)])
File "/root/.cache/huggingface/modules/transformers_modules/mosaicml/mpt-7b-chat/fa9345560420e2111498f87799ea7dd31cbd647e/blocks.py", line 30, in init
self.ffn = MPTMLP(d_model=d_model, expansion_ratio=expansion_ratio, device=device)
File "/root/.cache/huggingface/modules/transformers_modules/mosaicml/mpt-7b-chat/fa9345560420e2111498f87799ea7dd31cbd647e/blocks.py", line 13, in init
self.act = nn.GELU(approximate='none')
TypeError: init() got an unexpected keyword argument 'approximate'

How can I fix this? I have upgraded pip and here is the packages i installed:
einops
gradio
torch
transformers
numpy
sentencepiece

Hi, you likely have an incompatible version of something, could you share the output of pip list?

Closing as stale

abhi-mosaic changed discussion status to closed

I'm receiving it too:

File "C:\Users\gustavo.contreiras/.cache\huggingface\modules\transformers_modules\mosaicml\mpt-7b-instruct\bbe7a55d70215e16c00c1825805b81e4badb57d7\blocks.py", line 13, 
in __init__
    self.act = nn.GELU(approximate='none')
TypeError: Module.__init__() got an unexpected keyword argument 'approximate'

requirements.txt:

fastapi==0.74.*
requests==2.28.*
uvicorn[standard]==0.17.*
sentencepiece==0.1.*
torch
transformers
haystack
farm-haystack
einops

pip list:

accelerate               0.20.3
anyio                    3.7.0
appdirs                  1.4.4
asgiref                  3.7.2
async-timeout            4.0.2
attrs                    23.1.0
azure-ai-formrecognizer  3.3.0b1
azure-common             1.1.28
azure-core               1.27.1
backoff                  2.2.1
beautifulsoup4           4.12.2
blis                     0.7.9
boilerpy3                1.0.6
cachetools               5.3.1
canals                   0.2.2
catalogue                2.0.8
cattrs                   23.1.2
certifi                  2023.5.7
charset-normalizer       2.0.12
click                    8.1.3
colorama                 0.4.6
confection               0.0.4
construct                2.5.3
cymem                    2.0.7
dataclasses-json         0.5.8
decorator                5.1.1
dill                     0.3.6
dnspython                2.3.0
docopt                   0.6.2
einops                   0.6.1
elastic-transport        8.4.0
elasticsearch            8.8.0
Events                   0.4
exceptiongroup           1.1.1
faiss-cpu                1.7.4
farm-haystack            1.17.2
fastapi                  0.74.1
filelock                 3.12.2
fsspec                   2023.6.0
google-api-core          2.11.1
google-api-python-client 2.70.0
google-auth              2.20.0
google-auth-httplib2     0.1.0
googleapis-common-protos 1.59.1
greenlet                 2.0.2
grpcio                   1.56.0
grpcio-tools             1.48.2
h11                      0.14.0
h2                       4.1.0
haystack                 0.42
hpack                    4.0.0
httpcore                 0.17.2
httplib2                 0.22.0
httptools                0.5.0
httpx                    0.24.1
huggingface-hub          0.15.1
hyperframe               6.0.1
idna                     3.4
inflect                  6.0.4
isodate                  0.6.1
jaraco.context           4.3.0
Jinja2                   3.1.2
joblib                   1.2.0
jsonschema               4.17.3
langchain                0.0.74
langcodes                3.3.0
lazy-imports             0.3.1
loguru                   0.7.0
manifest-ml              0.0.1
MarkupSafe               2.1.3
marshmallow              3.19.0
marshmallow-enum         1.5.1
monotonic                1.6
more-itertools           9.1.0
msrest                   0.7.1
murmurhash               1.0.9
mypy-extensions          1.0.0
networkx                 3.1
nltk                     3.8.1
num2words                0.5.12
numpy                    1.25.0
oauthlib                 3.2.2
packaging                23.1
pandas                   2.0.2
pathy                    0.10.2
pefile                   2023.2.7
Pillow                   9.5.0
pinecone-client          2.2.2
pip                      21.2.3
posthog                  3.0.1
preshed                  3.0.8
protobuf                 3.20.2
psutil                   5.9.5
pyasn1                   0.5.0
pyasn1-modules           0.3.0
pydantic                 1.10.9
pyparsing                3.1.0
pyrsistent               0.19.3
python-dateutil          2.8.2
python-dotenv            1.0.0
python-ptrace            0.9.8
pytz                     2023.3
PyYAML                   6.0
qdrant-client            0.11.10
quantulum3               0.9.0
rank-bm25                0.2.2
redis                    4.5.5
regex                    2023.6.3
requests                 2.28.2
requests-cache           0.9.8
requests-oauthlib        1.3.1
rsa                      4.9
safetensors              0.3.1
scikit-learn             1.2.2
scipy                    1.10.1
sentence-transformers    2.2.2
sentencepiece            0.1.99
setuptools               57.4.0
six                      1.16.0
smart-open               6.3.0
sniffio                  1.3.0
soupsieve                2.4.1
spacy                    3.5.3
spacy-legacy             3.0.12
spacy-loggers            1.0.4
SQLAlchemy               1.4.48
sqlitedict               2.1.0
srsly                    2.4.6
sseclient-py             1.7.2
starlette                0.17.1
tenacity                 8.2.2
thinc                    8.1.10
threadpoolctl            3.1.0
tiktoken                 0.4.0
tokenizers               0.13.3
torch                    1.11.0
torchvision              0.12.0
tqdm                     4.65.0
transformers             4.29.1
typer                    0.7.0
typing_extensions        4.5.0
typing-inspect           0.9.0
tzdata                   2023.3
uritemplate              4.1.1
url-normalize            1.4.3
urllib3                  1.26.16
uvicorn                  0.17.6
validators               0.18.2
wasabi                   1.1.2
watchgod                 0.8.2
weaviate-client          3.9.0
websockets               11.0.3
wikipedia                1.4.0
win32-setctime           1.1.0
wolframalpha             5.0.0
xmltodict                0.13.0

@GustavoContreirasHAH I have solved this with this requirement and docker file, inshaAllah.
https://github.com/Yusuf-YENICERI/Custom-AI-On-Server/blob/main/requirements.txt
https://github.com/Yusuf-YENICERI/Custom-AI-On-Server/blob/main/Dockerfile

potassium, sanic and websockets is not related

Sign up or log in to comment