CASALIOY: Illegal Instruction when running python casalioy/startLLM.py on Mac m1 in docker container (with or without --platform linux/amd64 run param)

.env

Generic

TEXT_EMBEDDINGS_MODEL=sentence-transformers/all-MiniLM-L6-v2 TEXT_EMBEDDINGS_MODEL_TYPE=HF # LlamaCpp or HF USE_MLOCK=true

Ingestion

PERSIST_DIRECTORY=db DOCUMENTS_DIRECTORY=source_documents INGEST_CHUNK_SIZE=500 INGEST_CHUNK_OVERLAP=50

Generation

MODEL_TYPE=LlamaCpp # GPT4All or LlamaCpp MODEL_PATH=eachadea/ggml-vicuna-7b-1.1/ggml-vic7b-q5_1.bin MODEL_TEMP=0.8 MODEL_N_CTX=1024 # Max total size of prompt+answer MODEL_MAX_TOKENS=256 # Max size of answer MODEL_STOP=[STOP] CHAIN_TYPE=betterstuff N_RETRIEVE_DOCUMENTS=100 # How many documents to retrieve from the db N_FORWARD_DOCUMENTS=100 # How many documents to forward to the LLM, chosen among those retrieved N_GPU_LAYERS=4

Python version

Python 3.11.3

System

Debian GNU/Linux 11 (bullseye) (DOCKER container)

CASALIOY version

su77ungr/casalioy:stable

Information

  • The official example scripts
  • My own modified scripts

Related Components

  • Document ingestion
  • GUI
  • Prompt answering

Reproduction

Steps to reproduce (on Mac m1):

docker pull su77ungr/casalioy:stable docker run -it su77ungr/casalioy:stable /bin/bash

python casalioy/ingest.py

Downloading model sentence-transformers/all-MiniLM-L6-v2 from HF Downloading (…)_Pooling/config.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 190/190 [00:00<00:00, 684kB/s] Downloading (…)55de9125/config.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 612/612 [00:00<00:00, 3.70MB/s] Downloading (…)125/data_config.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 39.3k/39.3k [00:00<00:00, 4.90MB/s] Downloading (…)ce_transformers.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 116/116 [00:00<00:00, 626kB/s] Downloading (…)cial_tokens_map.json: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 112/112 [00:00<00:00, 641kB/s] Downloading (…)nce_bert_config.json: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 53.0/53.0 [00:00<00:00, 309kB/s] Downloading (…)5de9125/modules.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 349/349 [00:00<00:00, 2.15MB/s] Downloading (…)okenizer_config.json: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 350/350 [00:00<00:00, 1.64MB/s] Downloading (…)e9125/tokenizer.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 466k/466k [00:00<00:00, 1.31MB/s] Downloading pytorch_model.bin: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 90.9M/90.9M [00:18<00:00, 4.96MB/s] Fetching 10 files: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:24<00:00, 2.41s/it] Downloading model eachadea/ggml-vicuna-7b-1.1/ggml-vic7b-q5_1.bin from HF Downloading ggml-vic7b-q5_1.bin: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5.06G/5.06G [11:31<00:00, 7.31MB/s] Fetching 1 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [11:37<00:00, 697.51s/it] The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling transformers.utils.move_cache(). 0it [00:00, ?it/s] Scanning files Processing state_of_the_union.txt Processing 90 chunks Creating a new collection, size=384 Saving 90 chunks Saved, the collection now holds 90 documents. Processed state_of_the_union.txt Processing sample.csv Processing 9 chunks Saving 9 chunks Saved, the collection now holds 99 documents. Processed sample.csv Processing shor.pdf Processing 22 chunks Saving 22 chunks Saved, the collection now holds 121 documents. Processed shor.pdf Processing Muscle Spasms Charley Horse MedlinePlus.html [nltk_data] Downloading package punkt to /root/nltk_data...===================> ] 3/ 7 eta [00:19] [nltk_data] Unzipping tokenizers/punkt.zip. 21 [nltk_data] Downloading package averaged_perceptron_tagger to 2 [nltk_data] /root/nltk_data... [nltk_data] Unzipping taggers/averaged_perceptron_tagger.zip. Processing 15 chunks Saving 15 chunks Saved, the collection now holds 136 documents. Processed Muscle Spasms Charley Horse MedlinePlus.html Processing Easy_recipes.epub Processing 31 chunks Saving 31 chunks Saved, the collection now holds 167 documents. Processed Easy_recipes.epub Processing Constantinople.docx Processing 13 chunks Saving 13 chunks Saved, the collection now holds 179 documents. Processed Constantinople.docx Processing LLAMA Leveraging Object-Oriented Programming for Designing a Logging Framework-compressed.pdf Processing 14 chunks Saving 14 chunks Saved, the collection now holds 193 documents. Processed LLAMA Leveraging Object-Oriented Programming for Designing a Logging Framework-compressed.pdf 100.0% [==================================================================================================================================================================>] 7/ 7 eta [00:00] Done

root@6e62f96184c4:/srv/CASALIOY# python casalioy/startLLM.py found local model dir at models/sentence-transformers/all-MiniLM-L6-v2 found local model file at models/eachadea/ggml-vicuna-7b-1.1/ggml-vic7b-q5_1.bin

Illegal instruction

Expected behavior

I would expect to start the chatting

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments

I actually have it working now. Not sure because of the python base image or, because i built the image locally. Thank you

Most likely not caused by slim, since it works fine on my end 😛