Skip to content

Commit

Permalink
Add Hugging Face tutorials.
Browse files Browse the repository at this point in the history
  • Loading branch information
zjowowen committed Dec 19, 2024
1 parent 59ac162 commit afdc245
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions grl_pipelines/tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ We provide several toy examples to demonstrate the features of the `GenerativeRL

- [Customized Neural Network Modules](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/special_usages/customized_modules.py)
- [Dict-like Structure Data Generation](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/special_usages/dict_tensor_ode.py)

## Use Hugging Face website to push and pull models

### Push a model

We provide an [example](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/huggingface/lunarlander_continuous_qgpo_huggingface_push.py) to push a trained model to the Hugging Face website.

In this example, we push a trained LunarLanderContinuous model to the Hugging Face website, and automatically generate a model card using the [template](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/huggingface/modelcard_template.md) to showcase the model's [detailed information](https://huggingface.co/OpenDILabCommunity/LunarLanderContinuous-v2-QGPO).

### Pull a model

We provide an [example](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/huggingface/lunarlander_continuous_qgpo_huggingface_pull.py) to pull a model from the Hugging Face website, and test the model's performance in the environment.
11 changes: 11 additions & 0 deletions grl_pipelines/tutorials/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,14 @@

- [自定义神经网络模块](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/special_usages/customized_modules.py)
- [类似字典结构的数据生成](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/special_usages/dict_tensor_ode.py)

## 使用 Hugging Face 网站上传和下载模型

### 上传模型
我们提供了将训练好的模型上传到 Hugging Face 网站的[示例](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/huggingface/lunarlander_continuous_qgpo_huggingface_push.py)

在这个示例中,我们将训练好的 LunarLanderContinuous 模型上传到 Hugging Face 网站,并通过[模板](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/huggingface/modelcard_template.md)自动生成模型卡片,展示模型的[详细信息](https://huggingface.co/OpenDILabCommunity/LunarLanderContinuous-v2-QGPO)

### 下载模型
我们提供了从 Hugging Face 网站下载模型的[示例](https://github.com/opendilab/GenerativeRL/tree/main/grl_pipelines/tutorials/huggingface/lunarlander_continuous_qgpo_huggingface_pull.py)
在这个示例中,我们下载了 Hugging Face 网站上的 LunarLanderContinuous 模型,并测试模型在该环境中的性能。

0 comments on commit afdc245

Please sign in to comment.