I can not download the model

#6
by WANNTING - opened

I want to download the model, but I keep encountering the following error message. How should I proceed? Thanks a lot for your help.
""" Model not found for path or HF repo: mlx-community/Meta-Llama-3.1-8B-Instruct-4bit.
Please make sure you specified the local path or Hugging Face repo id correctly.
If you are trying to access a private or gated Hugging Face repo, make sure you are authenticated:
https://huggingface.co/docs/huggingface_hub/en/guides/cli#huggingface-cli-login"""

it is my download model code.
"""
from mlx_lm import load, generate
from huggingface_hub import login

Step 1: Set Hugging Face Access Token

access_token = "hf_KCXXXX"
login(access_token)

Step 2: Attempt to load the model

try:
model_name = "mlx-community/Meta-Llama-3.1-8B-Instruct-4bit" # Ensure the model name is correct
model, tokenizer = load(model_name)
print(f"Model {model_name} loaded successfully!")

# Step 3: Generate using the model
prompt = "hello"
response = generate(model, tokenizer, prompt=prompt, verbose=True)
print(f"Generation result: {response}")

except Exception as e:
print(f"An error occurred during model loading or generation: {e}")
""

Sign up or log in to comment