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

HuggingFace Token #429

Closed
AfamO opened this issue Dec 31, 2023 · 2 comments
Closed

HuggingFace Token #429

AfamO opened this issue Dec 31, 2023 · 2 comments

Comments

@AfamO
Copy link

AfamO commented Dec 31, 2023

Describe the bug
Hugging Face is asking for token to access and run Llam2 model

To Reproduce
Steps to reproduce the behavior:

  1. Import Client from llm_vm
  2. Try performing completion request using llam2 as big_model.
  3. Then run the python code . See the attached screen shot.
  4. See error. See the attached screen shot

Expected behavior
Before invoking the model, Hugging Face expects a token having permission to the repo to be passed either via
huggingface-cli loginor by passingtoken=<your_token>`.

Screenshots
llm_vm llama2 error

Desktop (please complete the following information):

  • OS: Windows
  • Browser [e.g. chrome, safari]
  • Version The latest build. Just cloned from the main repo about 3 hours ago.

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@wansatya
Copy link

wansatya commented Jan 4, 2024

You can manage the HF login using from huggingface_hub import login

import sys
import os
# Import our client
from llm_vm.client import Client
# Import huggingface hub login
from huggingface_hub import login

# Login with HF API token
login(
    os.getenv("LLM_VM_HUGGINGFACEHUB_API_TOKEN")
)

# Instantiate the client specifying which LLM you want to use
client = Client(
    big_model='llama2'
)

# Put in to your prompt and go!
response = client.complete(
    context='',
    prompt = 'What is anarchy?'
)
print(
    response, file=sys.stderr
) # Anarchy is a political system in which the state is abolished and the people are free...

@AfamO
Copy link
Author

AfamO commented Jan 9, 2024

It's alright. The above step, along with extra efforts to request for repo access from both Meta and Hugging Face websites, worked

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

2 participants