Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run on Mac with Python 3.11.3 #81

Open
kornhill opened this issue Apr 10, 2023 · 6 comments
Open

Cannot run on Mac with Python 3.11.3 #81

kornhill opened this issue Apr 10, 2023 · 6 comments

Comments

@kornhill
Copy link

python3 -m llama.download --model_size 7B

Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/itree/init.py", line 5, in
from . import _itree
ImportError: cannot import name '_itree' from partially initialized module 'itree' (most likely due to a circular import) (/opt/homebrew/lib/python3.11/site-packages/itree/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 189, in _run_module_as_main
File "", line 112, in _get_module_details
File "/opt/homebrew/lib/python3.11/site-packages/llama/init.py", line 17, in
from .model_single import ModelArgs, Transformer
File "/opt/homebrew/lib/python3.11/site-packages/llama/model_single.py", line 7, in
import hiq
File "/opt/homebrew/lib/python3.11/site-packages/hiq/init.py", line 59, in
from .tree import get_duration_from_hiq_string, get_graph_from_string, Tree
File "/opt/homebrew/lib/python3.11/site-packages/hiq/tree.py", line 9, in
import itree
File "/opt/homebrew/lib/python3.11/site-packages/itree/init.py", line 7, in
import _itree
ImportError: dlopen(/opt/homebrew/lib/python3.11/site-packages/_itree.cpython-311-darwin.so, 0x0002): tried: '/opt/homebrew/lib/python3.11/site-packages/_itree.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/python3.11/site-packages/_itree.cpython-311-darwin.so' (no such file), '/opt/homebrew/lib/python3.11/site-packages/_itree.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

@fivol
Copy link

fivol commented Apr 10, 2023

Same

Traceback (most recent call last):
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/itree/init.py", line 5, in
from . import _itree
ImportError: cannot import name '_itree' from partially initialized module 'itree' (most likely due to a circular import) (/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/itree/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/runpy.py", line 110, in _get_module_details
import(pkg_name)
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/llama/init.py", line 17, in
from .model_single import ModelArgs, Transformer
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/llama/model_single.py", line 7, in
import hiq
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/hiq/init.py", line 59, in
from .tree import get_duration_from_hiq_string, get_graph_from_string, Tree
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/hiq/tree.py", line 9, in
import itree
File "/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/itree/init.py", line 7, in
import _itree
ImportError: dlopen(/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/_itree.cpython-310-darwin.so, 0x0002): tried: '/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/_itree.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/_itree.cpython-310-darwin.so' (no such file), '/Users/fiobond/.conda/envs/llama/lib/python3.10/site-packages/_itree.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

@dguerri
Copy link

dguerri commented Apr 14, 2023

It's a problem with py-itree. This should work:

pip uninstall py-itree
ARCHFLAGS="-arch arm64" pip install https://github.com/juncongmoo/itree/archive/refs/tags/v0.0.18.tar.gz --compile --no-cache-dir

The link is from the py-itree PyPi page

@drathi599
Copy link

This did resolve the error, however, nothing is getting downloaded at least for me.

` python -m llama.download --model_size 7B

❤️ Resume download is supported. You can ctrl-c and rerun the program to resume the downloading
Downloading tokenizer...
✅ pyllama_data/tokenizer.model
✅ pyllama_data/tokenizer_checklist.chk
Downloading 7B
✅ pyllama_data/7B/params.json
✅ pyllama_data/7B/checklist.chk
Checking checksums
(base) ➜ vicuna_weights ls
pyllama_data
(base) ➜ vicuna_weights cd pyllama_data
(base) ➜ pyllama_data ls
7B
(base) ➜ pyllama_data cd 7B
(base) ➜ 7B ls
(base) ➜ 7B ls -a -l
total 0
drwxr-xr-x 2 drathi 64 Apr 15 11:59 .
drwxr-xr-x 3 drathi 96 Apr 15 11:59 ..
(base) ➜ 7B`

@dguerri
Copy link

dguerri commented Apr 15, 2023

This issue should contain the solution to that #47

Most probably you need to do:

pip uninstall pyllama
git clone https://github.com/juncongmoo/pyllama
pip install -e pyllama

@Syazvinski
Copy link

Syazvinski commented May 12, 2023

Same issue and after following both directions here it didnt error out anymore but now when I try and download I get this. Looks like im in some sort of loop. I could paste more but it just goes on and on.

`❤️ Resume download is supported. You can ctrl-c and rerun the program to resume the downloading
Downloading tokenizer...
✅ pyllama_data/tokenizer.model
✅ pyllama_data/tokenizer_checklist.chk

❤️ Resume download is supported. You can ctrl-c and rerun the program to resume the downloading
`

@kryt
Copy link

kryt commented May 30, 2023

After trying everything else, this finally solved it for me:
#47 (comment)

you have to brew install md5sha1sum for mac m1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@dguerri @kornhill @kryt @fivol @Syazvinski @drathi599 and others