HF pro subscription for llama 3.1-8b

#49
by ostoslista - opened

Do you need to have the HF pro subscription to access this model through code? I have set up a virtual environment through flask in python, but when I try to access it, it says that you would need the pro subscription for it even though I have never seen it mentioned anywhere. Btw I'm new to coding and I have never done projects using huggingface.

No, HF pro is not necessary.

You need to have been granted access to the model by filling in the form on the model card and you need to be properly logged in through the huggingface-cli when trying to download the model from HF directly.

I'm also having this issue and, in addition to the token being loaded to the environment variable, I also tried the hugging face-cli and this did not solve the issue. I have also requested and received approval to use the model.

llm_engine = HfEngine("meta-llama/Meta-Llama-3.1-70B-Instruct")
agent = ReactCodeAgent(
tools=[],
llm_engine=llm_engine,
additional_authorized_imports=["numpy", "pandas", "matplotlib.pyplot", "seaborn"],
max_iterations=10,
)
analysis = agent.run(... etc)

----- error ---- (partial output)
raise AgentGenerationError(f"Error in generating llm output: {e}.")
transformers.agents.agents.AgentGenerationError: Error in generating llm output: (Request ID: kf2xylnj5hEmhDSzbaSOC)

Bad request:
Model requires a Pro subscription; check out hf.co/pricing to learn more. Make sure to include your HF token in your query..
Reached max iterations.
NoneType: None

Interesting...

Well, the way it worked - and still works (just tried this again with the 8B non-instruct model) - is simply using the model in my python code like I usually would:

model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.float16)

If the model is not present, it automatically triggers the download from HF (provided the token is present, I assume):

Downloading shards:   0%|                                                                                               | 0/4 [00:00<?, ?it/s]
model-00001-of-00004.safetensors:   8%|█████▋                                                             | 419M/4.98G [00:14<02:53, 26.3MB/s]

Furthermore, I just tried downloading the model for use with llama, as mentioned on the model card:

huggingface-cli download meta-llama/Meta-Llama-3.1-8B-Instruct --include "original/*" --local-dir Meta-Llama-3.1-8B-Instruct

Also works fine without HF Pro on my end.

If all tooling fails, you should also be able to download the required files manually from the git repo:

https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct/tree/main

But I'm not sure I fully understand your issue. Can you please be more specific in describing what you are trying to do?

If you access the model through the inference API, it requires a pro subscription.

If you use the model locally (i.e. using pipeline or AutoModelForCausalLM ) it doesn't

If it doesn't seem like you downloaded anything, it's calling the API

Sign up or log in to comment