Skip to content

Commit

Permalink
Feature/sheeprl upgrade (#33)
Browse files Browse the repository at this point in the history
* feat: bump sheeprl to v0.5.5

* feat: update docs

* feat: added sheeprl section

* feat: variable renaming

* fix: typos

* feat: update sheeprl version

* feat: update
  • Loading branch information
michele-milesi authored Apr 23, 2024
1 parent c78176a commit a787a9d
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,47 @@ To do so, you would need to:
```
Also in this case, the Hugging Face token you saved earlier will be automatically retrieved.

#### Example 4: SheepRL - Using a Manifest File
This section shows how to submit a trained agent with SheepRL.

<a href="https://github.com/diambra/agents/blob/main/sheeprl/agent-ppo.py" target="_blank">Here</a> you can find an example of what the evaluation script should look like.
You need two files:
- A YAML configuration file, the one produced during training, that contains the configs of the agent and all the information needed to instantiate the environment.
- A `ckpt` file that contains the weights of the agent.

After retrieving these two files, you can load them with the script file into your huggingface repository.
An example of the files you need to retrieve is shown <a href="https://github.com/diambra/agents/blob/main/sheeprl/example-logs/runs/ppo/doapp/experiment" target="_blank">here</a>.

Assuming you are using the `arena-sheeprl-on3.10-bullseye` dependencies image and that you upload the files without subdirectories, create a file named `submission-manifest.yaml` with the following content:

```yaml
mode: AIvsCOM
image: diambra/arena-sheeprl-on3.10-bullseye:main
command:
- python
- "/sources/agent-ppo.py"
- "--cfg_path"
- "/sources/results/ppo/config.yaml"
- "--checkpoint_path"
- "/sources/results/ppo/ckpt_1024_0.ckpt"
sources:
.: git+https://username:{{.Secrets.hf_token}}@huggingface.co/username/repository_name.git#ref=branch_name
```

{{% notice note %}}
<a href="https://huggingface.co/michele-milesi/diambra-agent-example/tree/main" target="_blank">Here</a> you can find the huggingface repository on which the example is based.
{{% /notice %}}

Replace `username` and `repository_name.git#ref=branch_name` with the appropriate values, and change `image` and `command` fields according to your specific use case.

Then, submit your agent using the manifest file:

```sh
diambra agent submit --submission.secrets-from=huggingface --submission.manifest submission-manifest.yaml
```

This will automatically retrieve the Hugging Face token you saved earlier.

### GitHub

These are the steps to submit your own agent hosted on GitHub:
Expand Down
Loading

0 comments on commit a787a9d

Please sign in to comment.