Skip to content

Commit

Permalink
Merge pull request #79 from huggingface/doc_build_workflows
Browse files Browse the repository at this point in the history
add doc-build workflows
  • Loading branch information
Mishig authored Apr 8, 2024
2 parents 475ce63 + 4320b96 commit 48d302f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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: diffusion-models-class
package_name: diffusion-course
path_to_docs: diffusion-models-class/
additional_args: --not_python_module
convert_notebooks: true
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
20 changes: 20 additions & 0 deletions .github/workflows/build_pr_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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: diffusion-models-class
package_name: diffusion-course
path_to_docs: diffusion-models-class/
additional_args: --not_python_module
convert_notebooks: true
17 changes: 17 additions & 0 deletions .github/workflows/upload_pr_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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: diffusion-course
hub_base_path: https://moon-ci-docs.huggingface.co/learn
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion _toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
newlocal: unit4/2
title: DDIM Inversion
- local: unit4/02_diffusion_for_audio
newlocal: unit4/1
newlocal: unit4/3
title: Diffusion for Audio

- title: Events related to the course
Expand Down
4 changes: 2 additions & 2 deletions unit4/02_diffusion_for_audio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1129,15 +1129,15 @@
"\n",
"## Usage\n",
"\n",
"```python\n",
"<pre>\n",
"from IPython.display import Audio\n",
"from diffusers import DiffusionPipeline\n",
"\n",
"pipe = DiffusionPipeline.from_pretrained(\"{hub_model_id}\")\n",
"output = pipe()\n",
"display(output.images[0])\n",
"display(Audio(output.audios[0], rate=pipe.mel.get_sample_rate()))\n",
"```\n",
"</pre>\n",
"\"\"\"\n",
"\n",
"card = ModelCard(content)\n",
Expand Down

0 comments on commit 48d302f

Please sign in to comment.