Agents Course Unit 2.2 error 404

Hi,

I’m doing unit 2.2 of the the beginner agents course. Up until that point with little to no issue. However now, when any llama_index model calls are made in the course notebooks I get this error.

I don’t know what to do. When I click on the link in the error it says that user name or password is not correct. But at the beginning of each notebook you have to sign in to your HF account, which I have done without issue, so idk why it would say that the creds are not correct. The HF token is also set up correctly. The notebooks from earlier in the course that used smolagents still run with no issue. Any tips? Does something additional needs to be set up when using llama_index?

WorkflowRuntimeError: Error in step 'run_agent_step': 404, message='Not Found', url='https://router.huggingface.co/hf-inference/models/Qwen/Qwen2.5-Coder-32B-Instruct/v1/chat/completions'
{"error":"Invalid username or password."}
1 Like

It seems that explicitly specifying task="text-generation" may resolve the issue with llama_index.

llm = HuggingFaceInferenceAPI(
    model="Qwen/Qwen2.5-Coder-32B-Instruct",
    task="text-generation"
)

thanks for trying to help, this unfortunately had no result on my side and it still fails with the same error ;/
I suppose that means that the libraries have changed since the course was released?

1 Like

I suppose that means that the libraries have changed since the course was released?

Yeah. Also, the behavior of the Hugging Face servers has changed slightly.

llm = HuggingFaceInferenceAPI(
    model="Qwen/Qwen2.5-Coder-32B-Instruct",
    task="text-generation",
    provider="auto",
)