I’m facing this error when using the download-file...
# ask-ai
c
I’m facing this error when using the download-files command included in the agent tutorial. What am I missing?
Copy code
OSError: There was a specific connection error when trying to load livekit/turn-detector:
401 Client Error: Unauthorized for url: <https://huggingface.co/livekit/turn-detector/resolve/v1.2.2-en/config.json> (Request ID: Root=1-68d3ffa3-22c7613944796cfb139c61b3;d045e286-5a00-4302-b0ea-e2730f154c1e)
t
Thanks for reaching out, Guillaume. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like you're encountering an authentication issue when trying to download the model files for the LiveKit turn detector. Don’t worry, I’m here to help you through this! Here are some steps you can follow to get things working smoothly: 1. Set a Hugging Face Token: Please make sure the
HF_TOKEN
environment variable is set with a valid Hugging Face token. You can do this by running: `export HF_TOKEN=your_hugging_face_token python agent.py download-files`Alternatively, you can include it directly in the command like this:
HF_TOKEN=your_hugging_face_token python agent.py download-files
2. Accept Model Repository Terms: Head over to
<HUGGING_FACE_MODEL_URL>
and click on "Agree and access repository" to make sure your account has permission to access the model files. 3. Run the Correct Command: Double-check that you’re running the download command from the right script file:
python agent.py download-files
4. Verify Plugin Registration: Make sure the turn detector plugin is properly imported and registered in your agent code. 5. Check Network and Dependencies: Confirm that your environment has internet access and that necessary packages like
huggingface-hub
are installed. 6. Verify Token Permissions: Lastly, ensure your Hugging Face token has the right permissions to access private or gated repositories. Once you’ve gone through these steps, you should be able to download the model files without any trouble. If you run into any other issues or have questions, please don’t hesitate to reach out—I’m here to help! Sources: LiveKit turn detector plugin | LiveKit Docs | livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector... | plugins/livekit/src/hf_utils.test.ts | common/arg.cpp