From c83411882b6d98634fa24e263bf7d1202128f70b Mon Sep 17 00:00:00 2001 From: meric-karadag Date: Thu, 27 Feb 2025 08:58:51 +0300 Subject: [PATCH 1/2] Fix #222: Add instructions for setting HF_TOKEN in Space --- units/en/unit1/tutorial.mdx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/units/en/unit1/tutorial.mdx b/units/en/unit1/tutorial.mdx index 9eddcc0f..252e839d 100644 --- a/units/en/unit1/tutorial.mdx +++ b/units/en/unit1/tutorial.mdx @@ -40,6 +40,14 @@ To start, duplicate this Space: +After duplicating the Space, you'll need to add your Hugging Face API token so your agent can access the model API: + +1. First, get your Hugging Face token from [https://hf.co/settings/tokens](https://hf.co/settings/tokens) if you don't already have one +2. Go to your duplicated Space and click on the **Settings** tab +3. Scroll down to the **Variables and Secrets** section and click **New Secret** +4. Create a secret with the name `HF_TOKEN` and paste your token as the value +5. Click **Save** to store your token securely + Throughout this lesson, the only file you will need to modify is the (currently incomplete) **"app.py"**. You can see here the [original one in the template](https://huggingface.co/spaces/agents-course/First_agent_template/blob/main/app.py). To find yours, go to your copy of the space, then click the `Files` tab and then on `app.py` in the directory listing. Let's break down the code together: @@ -210,7 +218,6 @@ agent = CodeAgent( GradioUI(agent).launch() ``` -Your **Goal** is to get familiar with the Space and the Agent. Currently, the agent in the template **does not use any tools, so try to provide it with some of the pre-made ones or even make some new tools yourself!** From 17e09f42b91cd9d1a517145048e6c9d7e76b7aff Mon Sep 17 00:00:00 2001 From: burtenshaw Date: Tue, 4 Mar 2025 11:51:56 +0100 Subject: [PATCH 2/2] Update units/en/unit1/tutorial.mdx --- units/en/unit1/tutorial.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/units/en/unit1/tutorial.mdx b/units/en/unit1/tutorial.mdx index 252e839d..da4ab667 100644 --- a/units/en/unit1/tutorial.mdx +++ b/units/en/unit1/tutorial.mdx @@ -218,6 +218,7 @@ agent = CodeAgent( GradioUI(agent).launch() ``` +Your **Goal** is to get familiar with the Space and the Agent. Currently, the agent in the template **does not use any tools, so try to provide it with some of the pre-made ones or even make some new tools yourself!**