You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pygemma not getting build on mac when I do it in virtual environment. #16
Collecting pygemma==0.1.3
Using cached pygemma-0.1.3.tar.gz (4.0 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pygemma
Building wheel for pygemma (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pygemma (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [63 lines of output]
running bdist_wheel
running build
running build_ext
CMake Warning:
Ignoring extra path from command line:
"/private/var/folders/_f/5wjn/T/pip-install-gi3rew2y/pygemma_682956"
CMake Error: T"/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/_f/5w00gn/T/pip-install-gi3rew2y/pygemma_68a6', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/_f/5wjp0gn/T/pip-install-gi3rew2y/pygemma_6829ca6/build/lib.macosx-14.0-arm64-cpython-312', '-DPYTHON_EXECUTABLE=/Users/name/Documents/C++/venv/bin/python3.12']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pygemma
Failed to build pygemma
ERROR: Could not build wheels for pygemma, which is required to install pyproject.toml-based projects
yeah I tried building it from source , but when i ran it I got this error : Abort at /Users/username/Documents/pygemma/gemma-cpp-python-0.1.3/build/temp.macosx-14.0-arm64-cpython-312/_deps/gemma-src/gemma.cc:823: Failed to load the tokenizer file.
zsh: abort python test.py
I built successfully now I also loaded the tokenizer but now I am gettting this error when I run the code?
tokenizer : [no path specified]
compressed_weights : [no path specified]
model :
weights : [no path specified]
max_tokens : 3072
max_generated_tokens : 2048
multiturn : 0
Failed to read cache c_embedding (error 381)
Abort at /Users/username/Documents/pygemma/gemma-cpp-python-0.1.3/build/temp.macosx-14.0-arm64-cpython-312/_deps/gemma-src/gemma.cc:113: Failed to open model file - does it exist?
zsh: abort python test.py
Note:gemma.cc file exists
If I am correct, you are still using the older version of pygemma. I'd recommend you to update to the lastest commits of the repo and rebuild, as it was tested and uses a newer version of gemma.cpp. Maybe the issue you are facing relates to that this version of pygemma was still using old version of gemma.cpp, which may not work with newer model files.
Here is the how you may use the new version of pygemma:
Activity
phamson02 commentedon Apr 23, 2024
Can you try to install it from source as instructed here?
You can refer to this example file to see new APIs of the library.
omkar806 commentedon Apr 23, 2024
yeah I tried building it from source , but when i ran it I got this error : Abort at /Users/username/Documents/pygemma/gemma-cpp-python-0.1.3/build/temp.macosx-14.0-arm64-cpython-312/_deps/gemma-src/gemma.cc:823: Failed to load the tokenizer file.
zsh: abort python test.py
phamson02 commentedon Apr 23, 2024
Have you already built successfully? From the error message looks like maybe there is a problem with the tokenizer file you are using to load model
omkar806 commentedon Apr 25, 2024
I built successfully now I also loaded the tokenizer but now I am gettting this error when I run the code?
tokenizer : [no path specified]
compressed_weights : [no path specified]
model :
weights : [no path specified]
max_tokens : 3072
max_generated_tokens : 2048
multiturn : 0
Failed to read cache c_embedding (error 381)
Abort at /Users/username/Documents/pygemma/gemma-cpp-python-0.1.3/build/temp.macosx-14.0-arm64-cpython-312/_deps/gemma-src/gemma.cc:113: Failed to open model file - does it exist?
zsh: abort python test.py
Note:gemma.cc file exists
omkar806 commentedon Apr 25, 2024
My Code :
from pygemma import Gemma
gemma = Gemma()
gemma.show_help()
gemma.show_config()
gemma.load_model("/Users/username/Documents/pygemma/gemma_model/tokenizer.spm", "/Users/username/Documents/pygemma/gemma_model/2b-it-sfp.sbs", "2b-it-sfp")
gemma.completion("Write a poem")
phamson02 commentedon Apr 26, 2024
If I am correct, you are still using the older version of
pygemma. I'd recommend you to update to the lastest commits of the repo and rebuild, as it was tested and uses a newer version of gemma.cpp. Maybe the issue you are facing relates to that this version of pygemma was still using old version of gemma.cpp, which may not work with newer model files.Here is the how you may use the new version of
pygemma: