From e329a432ae48a3066a83474f19f9169632c9100f Mon Sep 17 00:00:00 2001 From: Nathan Lambert Date: Tue, 29 Aug 2023 12:44:34 -0700 Subject: [PATCH 1/3] init --- .github/workflows/build_documentation.yml | 20 +++++++++++++++++++ .github/workflows/build_pr_documentation.yml | 17 ++++++++++++++++ .../workflows/delete_doc_comment_trigger.yml | 12 +++++++++++ .github/workflows/upload_pr_documentation.yml | 16 +++++++++++++++ .gitignore | 2 +- chapters/en/_toctree.yml | 4 ++++ 6 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_documentation.yml create mode 100644 .github/workflows/build_pr_documentation.yml create mode 100644 .github/workflows/delete_doc_comment_trigger.yml create mode 100644 .github/workflows/upload_pr_documentation.yml create mode 100644 chapters/en/_toctree.yml diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml new file mode 100644 index 0000000..4f89961 --- /dev/null +++ b/.github/workflows/build_documentation.yml @@ -0,0 +1,20 @@ +name: Build documentation + +on: + push: + branches: + - main + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main + with: + commit_sha: ${{ github.sha }} + package: rlhf-handbook +# package_name: rlhf-handbook # commented from audio-course + path_to_docs: rlhf-handbook/chapters/ +# additional_args: --not_python_module + languages: en + secrets: + token: ${{ secrets.HUGGINGFACE_PUSH }} + hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} \ No newline at end of file diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml new file mode 100644 index 0000000..9e5f9ea --- /dev/null +++ b/.github/workflows/build_pr_documentation.yml @@ -0,0 +1,17 @@ +name: Build PR Documentation + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main + with: + commit_sha: ${{ github.event.pull_request.head.sha }} + pr_number: ${{ github.event.number }} + package: rlhf-handbook + languages: en \ No newline at end of file diff --git a/.github/workflows/delete_doc_comment_trigger.yml b/.github/workflows/delete_doc_comment_trigger.yml new file mode 100644 index 0000000..5e39e25 --- /dev/null +++ b/.github/workflows/delete_doc_comment_trigger.yml @@ -0,0 +1,12 @@ +name: Delete doc comment trigger + +on: + pull_request: + types: [ closed ] + + +jobs: + delete: + uses: huggingface/doc-builder/.github/workflows/delete_doc_comment_trigger.yml@main + with: + pr_number: ${{ github.event.number }} \ No newline at end of file diff --git a/.github/workflows/upload_pr_documentation.yml b/.github/workflows/upload_pr_documentation.yml new file mode 100644 index 0000000..3d63bc7 --- /dev/null +++ b/.github/workflows/upload_pr_documentation.yml @@ -0,0 +1,16 @@ +name: Upload PR Documentation + +on: + workflow_run: + workflows: ["Build PR Documentation"] + types: + - completed + +jobs: + build: + uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main + with: + package_name: rlhf-handbook + secrets: + hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }} + comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 68bc17f..2dc53ca 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,4 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +.idea/ diff --git a/chapters/en/_toctree.yml b/chapters/en/_toctree.yml new file mode 100644 index 0000000..7dd7c2e --- /dev/null +++ b/chapters/en/_toctree.yml @@ -0,0 +1,4 @@ +- title: Unit 0. Welcome to the course! + sections: + - local: chapter0/introduction + title: What to expect from the course \ No newline at end of file From c3fb7849985f75c0ea99586b2654bcd29aaef4df Mon Sep 17 00:00:00 2001 From: Nathan Lambert Date: Tue, 29 Aug 2023 16:30:18 -0700 Subject: [PATCH 2/3] fixes --- .github/workflows/build_documentation.yml | 2 +- .github/workflows/build_pr_documentation.yml | 1 + README.md | 17 +++++++++++++++++ chapters/en/chapter0/introduction.mdx | 3 ++- requirements.txt | 3 +++ 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index 4f89961..35f291c 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -13,7 +13,7 @@ jobs: package: rlhf-handbook # package_name: rlhf-handbook # commented from audio-course path_to_docs: rlhf-handbook/chapters/ -# additional_args: --not_python_module + additional_args: --not_python_module languages: en secrets: token: ${{ secrets.HUGGINGFACE_PUSH }} diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index 9e5f9ea..e405e4e 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -14,4 +14,5 @@ jobs: commit_sha: ${{ github.event.pull_request.head.sha }} pr_number: ${{ github.event.number }} package: rlhf-handbook + additional_args: --not_python_module languages: en \ No newline at end of file diff --git a/README.md b/README.md index 7f49320..f6606aa 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # The RLHF Handbook Robust recipes for RLHF + +## Developing +To view this locally, run the following (need to point to a specific language if previewing only one section, preview/`build_doc` does not use the `--language` flag): +```shell +doc-builder preview rlhf-handbook {docs_dir} --not_python_module +``` +Example `docs_dir` is `~/Documents/HuggingFace/dev/rlhf-handbook/chapters/en` + +## Installation +Create a new conda environment with: +```shell +conda create -n rlhf-handbook python=3.10 +``` +Install the limited requirements with +```shell +pip install -r requirements.txt +``` \ No newline at end of file diff --git a/chapters/en/chapter0/introduction.mdx b/chapters/en/chapter0/introduction.mdx index 5846ae8..8d0d381 100644 --- a/chapters/en/chapter0/introduction.mdx +++ b/chapters/en/chapter0/introduction.mdx @@ -1 +1,2 @@ -# Welcome to the RLHF Handbook! \ No newline at end of file +# Welcome to the RLHF Handbook! +We are going to... \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..cac6b3a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +hf-doc-builder==0.4.0 +black==23.3.0 +watchdog==3.0.0 \ No newline at end of file From d2fed11ce07ee2ab1b802c4dfa4f4ecab9de5cd9 Mon Sep 17 00:00:00 2001 From: Nathan Lambert Date: Tue, 29 Aug 2023 16:38:28 -0700 Subject: [PATCH 3/3] update dir --- .github/workflows/build_pr_documentation.yml | 1 + requirements.txt | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index e405e4e..038ffd4 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -14,5 +14,6 @@ jobs: commit_sha: ${{ github.event.pull_request.head.sha }} pr_number: ${{ github.event.number }} package: rlhf-handbook + path_to_docs: rlhf-handbook/chapters/ additional_args: --not_python_module languages: en \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index cac6b3a..8244fc6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -hf-doc-builder==0.4.0 -black==23.3.0 -watchdog==3.0.0 \ No newline at end of file +hf-doc-builder>=0.4.0 +black>=23.3.0 +watchdog>=3.0.0 \ No newline at end of file