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

ramalama login - TypeError: expected str, bytes or os.PathLike object, not NoneType #698

Open
dougsland opened this issue Feb 1, 2025 · 5 comments
Assignees

Comments

@dougsland
Copy link
Collaborator

I might be doing the wrong process to login into huggingface, please help me to understand the right process. Anyway, this output seems very nasty. Am I doing the login correct?

401: Unauthorized, okay, lets login (see next step)

ramalama run hf://ibm-granite/granite-3.1-8b-instruct       
URL pull failed and huggingface-cli not available
Error: Failed to pull model: 'failed to pull https://huggingface.co/ibm-granite/raw/main/granite-3.1-8b-instruct: HTTP Error 401: Unauthorized

Trying to login first:

$ export RAMALAMA_TRANSPORT=huggingface
$ ramalama login --token yourtokenhere        
os.execvp(None, [None, 'login'])
Traceback (most recent call last):
  File "/opt/homebrew/bin/ramalama", line 95, in <module>
    main(sys.argv[1:])
    ~~~~^^^^^^^^^^^^^^
  File "/opt/homebrew/bin/ramalama", line 72, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/Users/douglaslandgraf/ramalama/ramalama/ramalama/q/qm/.github/workflows/optionhugging/ramalama/ramalama/cli.py", line 294, in login_cli
    return model.login(args)
           ~~~~~~~~~~~^^^^^^
  File "/Users/douglaslandgraf/ramalama/ramalama/ramalama/q/qm/.github/workflows/optionhugging/ramalama/ramalama/oci.py", line 127, in login
    return exec_cmd(conman_args, debug=args.debug)
  File "/Users/douglaslandgraf/ramalama/ramalama/ramalama/q/qm/.github/workflows/optionhugging/ramalama/ramalama/common.py", line 65, in exec_cmd
    return os.execvp(args[0], args)
           ~~~~~~~~~^^^^^^^^^^^^^^^
  File "<frozen os>", line 611, in execvp
  File "<frozen os>", line 633, in _execvpe
  File "<frozen posixpath>", line 178, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

I am using source code from master.

@dougsland
Copy link
Collaborator Author

@miabbott I was checking another issue you opened, have you see similar issue above? Am I missing something?

@miabbott
Copy link

miabbott commented Feb 2, 2025

@dougsland I repeated my install in a clean Python venv (see #688 (comment)) and got the Unauthorized error, too.

Though after installing huggingface_hub, I was able to login successfully:

(ramalama_tmp) $ export RAMALAMA_TRANSPORT=huggingface
(ramalama_tmp) $ ramalama login --token hf_.....
Username: [email protected]
Password: 
Login Succeeded!

Kind of confusing that I need to provide a username/password when I already have a token (#709)

@dougsland
Copy link
Collaborator Author

@dougsland I repeated my install in a clean Python venv (see #688 (comment)) and got the Unauthorized error, too.

Though after installing huggingface_hub, I was able to login successfully:

(ramalama_tmp) $ export RAMALAMA_TRANSPORT=huggingface
(ramalama_tmp) $ ramalama login --token hf_.....
Username: [email protected]
Password: 
Login Succeeded!

Kind of confusing that I need to provide a username/password when I already have a token (#709)

Agreed @miabbott, going to investigate. Thanks for sharing the commands.

@ericcurtin
Copy link
Collaborator

ericcurtin commented Feb 3, 2025

We need to re-implement our own version of huggingface-cli. llama.cpp and huggingface-cli are two reference implementations we can follow for logins etc. Unfortunately it's difficult to use huggingface-cli as a python package. But luckily enough, it's not difficult to implement this from scratch.

@ericcurtin
Copy link
Collaborator

ericcurtin commented Feb 3, 2025

It wouldn't be a bad first PR, just to simply print a message in the meantime that this functionality doesn't exist in RamaLama. You don't need to login to hf for the public models.

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

3 participants