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

pip3 on macOS can install in funny directories #189

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Conversation

ericcurtin
Copy link
Collaborator

Like:

/Users/ecurtin/Library/Python//3.9/bin/omlmd

Like:

/Users/ecurtin/Library/Python//3.9/bin/omlmd

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
@ericcurtin
Copy link
Collaborator Author

@tarilabs omlmd doesn't really work great for me at least on macOS, which is a pity, it's a very popular platform for model inferencing...

$ ./ramalama.py pull oci://quay.io/mmortari/gguf-py-example:v1
Downloading quay.io/mmortari/gguf-py-example:v1...
/Users/ecurtin/Library/Python/3.9/lib/python/site-packages/urllib3/init.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: urllib3/urllib3#3020
warnings.warn(

@tarilabs
Copy link
Member

That's weird because I made all the demos of omlmd on Mac OSX 👉 https://containers.github.io/omlmd/demos/demo/

@tarilabs
Copy link
Member

Is the installation you are doing in a pyenv or venv?
I think in general, or at least my experience, using the global Mac OS Python environment is in general discouraged.

For another instance this is also analogously highlighted for ilab, here: https://github.com/instructlab/instructlab#:~:text=NOTE%3A%20The%20following%20steps%20in%20this%20document%20use%20Python%20venv%20for%20virtual%20environments.

Happy to follow-up online to double check which steps you followed and potential more robust alternatives?
lmk!

@ericcurtin
Copy link
Collaborator Author

Maybe it's just a harmless warning and https://quay.io/repository/mmortari/gguf-py-example isn't a real model

@tarilabs
Copy link
Member

and https://quay.io/repository/mmortari/gguf-py-example isn't a real model

if I recall I've taken that from the gguf example of llama.cpp repo and a valid gguf file but indeed not a Large Language Model

@tarilabs
Copy link
Member

tarilabs commented Sep 25, 2024

Maybe it's just a harmless warning

I don't get those warning anyways on Mac OSX during my demo recordings, so I think it's a matter of how the library/dependencies are installed maybe?

@rhatdan
Copy link
Member

rhatdan commented Sep 25, 2024

LGTM

@tarilabs
Copy link
Member

fwiw, just tried straight from repo root now and with:

./ramalama.py pull oci://quay.io/mmortari/gguf-py-example:v1

I get just-and-only:

Downloading quay.io/mmortari/gguf-py-example:v1...

which then shows in my storage:

% ./ramalama.py list                                          
NAME                                                   MODIFIED    SIZE
oci://quay.io/mmortari/gguf-py-example/v1/example.gguf 1 month ago 4.0K

image

I believe the warn from #189 (comment) maybe depends on the local system environment and configuration used then?

Possibly some pip install ... was done against the Mac native global Python environment?
On Mac, my understanding that is discouraged,
and I suggest using a Python environment like example from InstructLab,
or use pipx

my2c and happy to discuss further!

@tarilabs
Copy link
Member

tarilabs commented Sep 26, 2024

...I think I see now; seems to me install.py is making use of the default pip3 from the default Mac global python environment:

ramalama/install.py

Lines 79 to 80 in 07555d5

subprocess.run(["pip3", "install", "huggingface_hub[cli]"], check=True)
subprocess.run(["pip3", "install", "omlmd==0.1.4"], check=True)

what about:

  1. using pipx instead of installing in the Mac global python environment
    i.e. make for Mac pipx a depedency as homebrew brew

  2. just "shading" omlmd sources inside the ramalama
    after all is just an sdk

  3. I could check what distributing omlmd through brew entails

please notice 2, 3 wouldn't however solve the same issue for the other dependency huggingface_hub[cli] or any future dependencies, which imho should not be installed on the end-user default Mac global python environment my2c

hence, I believe option 1 is the most preferable for the dependencies *of ramalama when installed/used on Mac.

always happy to discuss further !

edit: typo

@ericcurtin
Copy link
Collaborator Author

@tarilabs if you could try and package ramalama and omlmd via brew that would be appreciated! We should migrate to there eventually...

@ericcurtin ericcurtin merged commit 9331d0f into main Sep 26, 2024
9 checks passed
@ericcurtin ericcurtin deleted the omlmd-fix branch September 26, 2024 10:34
@tarilabs
Copy link
Member

could try and package ramalama and omlmd via brew that would be appreciated! We should migrate to there eventually...

noted @ericcurtin eventually this will also impact however other dependencies of ramalama itself, as I noted in #189 (comment)

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

Successfully merging this pull request may close these issues.

3 participants