Conversation
Greptile SummaryThis PR updates the NVFlare Astro web page to align the "Getting Started" and "Series" examples with the new Recipe API ( Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User visits web page] --> B{Select Framework}
B -->|PyTorch| C[Show PT sections]
B -->|Lightning| D[Show Lightning sections]
B -->|TensorFlow| E[Show TF sections]
C --> C1[Install tab]
C --> C2[Client tab\nclient.py]
C --> C3[Model tab\nmodel.py]
C --> C4[Job tab\nFedAvgRecipe / job.py]
C --> C5[Run tab\npython job.py]
C --> C6[Colab button visible\nhello-pt.ipynb]
C --> C7[GitHub button\nhello-pt.ipynb]
D --> D1[Install / Client / Server tabs]
D --> D2[Model tab shows legacy\nserver/workflow code]
D --> D3[Colab button visible\nhello_lightning.ipynb]
E --> E1[Install / Client / Server tabs]
E --> E2[Model tab shows legacy\nserver/workflow code]
E --> E3[Colab button HIDDEN\nno TF notebook available]
E --> E4[GitHub button\nhello-tf tree]
|
web/src/components/code.astro
Outdated
| id: "tensorflow", | ||
| colab_link: `https://colab.research.google.com/github/NVIDIA/NVFlare/blob/${gh_branch}/examples/getting_started/tf/nvflare_tf_getting_started.ipynb`, | ||
| github_link: `https://github.com/NVIDIA/NVFlare/blob/${gh_branch}/examples/getting_started/tf/nvflare_tf_getting_started.ipynb`, | ||
| colab_link: `https://colab.research.google.com/github/NVIDIA/NVFlare/blob/${gh_branch}/examples/hello-world/hello-pt/hello-pt.ipynb`, |
There was a problem hiding this comment.
TensorFlow Colab link points to PyTorch notebook
The colab_link for the TensorFlow framework was updated to examples/hello-world/hello-pt/hello-pt.ipynb, which is the PyTorch notebook. This appears to be a copy-paste error — users selecting the TensorFlow tab and clicking "Open in Google Colab" will land in a PyTorch notebook. The github_link was correctly set to examples/hello-world/hello-tf, but the Colab link needs a corresponding TF notebook path.
| colab_link: `https://colab.research.google.com/github/NVIDIA/NVFlare/blob/${gh_branch}/examples/hello-world/hello-pt/hello-pt.ipynb`, | |
| colab_link: `https://colab.research.google.com/github/NVIDIA/NVFlare/blob/${gh_branch}/examples/hello-world/hello-tf/hello_tf.ipynb`, |
If a TF-specific Colab notebook doesn't exist yet at that path, the link should at minimum point to the TF tree (/tree/…) or be removed until the notebook is available, rather than silently redirecting to the PT notebook.
There was a problem hiding this comment.
Pull request overview
Updates the Astro-based website examples to reference NVFlare’s newer Recipe API and the hello-world example set, so the web walkthrough and example links better match the current recommended workflow.
Changes:
- Update “Getting Started” and series cards to point to
examples/hello-worldand Recipe-based FedAvg content. - Replace the PyTorch “server” code block with a Recipe-oriented “model + job” presentation and update Colab/GitHub links accordingly.
- Adjust UI tab labeling from “Server” to “Model” in the example code component.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| web/src/components/series.astro | Updates series descriptions/links to hello-world + Recipe-based FedAvg. |
| web/src/components/gettingStarted.astro | Updates walkthrough step titles/descriptions and source links to Recipe-based hello-pt example. |
| web/src/components/code.astro | Refactors displayed example code/links toward Recipe API and renames “Server” tab to “Model”. |
Comments suppressed due to low confidence (2)
web/src/components/code.astro:708
- Lightning code sections are still describing/showing legacy "server" + BaseFedJob-style file names (e.g., cifar10_lightning_fl.py, fedavg.py), but the framework links now point to the hello-lightning Recipe API notebook. Align the displayed Lightning code snippets/titles with examples/hello-world/hello-lightning (client.py, model.py, job.py) so the page content matches the linked source.
colab_link: `https://colab.research.google.com/github/NVIDIA/NVFlare/blob/${gh_branch}/examples/hello-world/hello-lightning/hello_lightning.ipynb`,
github_link: `https://github.com/NVIDIA/NVFlare/blob/${gh_branch}/examples/hello-world/hello-lightning/hello_lightning.ipynb`,
sections: [
{
id: "install-lightning",
type: "install",
framework: "lightning",
title: "Installation",
description:
"Install the required PyTorch Lightning dependencies for this example.",
code: installCode_lt,
},
{
id: "client-lightning",
type: "client",
framework: "lightning",
title: "Client Code (cifar10_lightning_fl.py)",
description:
"We use the Client API to convert the centralized training PyTorch Lightning code into federated learning code with only a few lines of changes highlighted below. Essentially the client will receive a model from NVIDIA FLARE, perform local training and validation, and then send the model back.",
code: clientCode_lt,
highlighted_lines: "97,116,118,123",
},
{
id: "server-lightning",
type: "server",
framework: "lightning",
title: "Server Code (fedavg.py)",
description:
"The ModelController API is used to write a federated routine with mechanisms for distributing and receiving models from clients. Here we implement the basic FedAvg algorithm using some helper functions from BaseFedAvg..",
code: serverCode_lt,
web/src/components/code.astro:772
- TensorFlow framework now links to examples/hello-world/hello-tf, but the displayed TensorFlow code sections still show the older BaseFedJob/ModelController-based scripts (cifar10_tf_fl.py, fedavg_cifar10_tf_job.py, etc.). Update the TensorFlow snippets/titles to match hello-tf’s Recipe API files (client.py, model.py, job.py) so users don’t see code that doesn’t correspond to the linked example.
colab_link: `https://colab.research.google.com/github/NVIDIA/NVFlare/blob/${gh_branch}/examples/hello-world/hello-pt/hello-pt.ipynb`,
github_link: `https://github.com/NVIDIA/NVFlare/tree/${gh_branch}/examples/hello-world/hello-tf`,
sections: [
{
id: "install-tensorflow",
type: "install",
framework: "tensorflow",
title: "Installation",
description:
"Install the required TensorFlow dependencies for this example.",
code: installCode_tf,
},
{
id: "client-tensorflow",
type: "client",
framework: "tensorflow",
title: "Client Code (cifar10_tf_fl.py)",
description:
"We use the Client API to convert the centralized training TensorFlow code into federated learning code with only a few lines of changes highlighted below. Essentially the client will receive a model from NVIDIA FLARE, perform local training and validation, and then send the model back.",
code: clientCode_tf,
highlighted_lines: "31,46,49,50,78-81,83",
},
{
id: "server-tensorflow",
type: "server",
framework: "tensorflow",
title: "Server Code (fedavg.py)",
description:
"The ModelController API is used to write a federated routine with mechanisms for distributing and receiving models from clients. Here we implement the basic FedAvg algorithm using some helper functions from BaseFedAvg..",
code: serverCode_tf,
highlighted_lines: "7,17,23",
},
{
id: "job-tensorflow",
type: "job",
framework: "tensorflow",
title: "Job Code (fedavg_cifar10_tf_job.py)",
description:
"Lastly we construct the job with our 'cifar10_tf_fl.py' client script and 'FedAvg' server controller. The BaseFedJob automatically configures components for model persistence, model selection, and TensorBoard streaming. We then run the job with the FL simulator.",
code: jobCode_tf,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/build |
Update astro web page example to use the latest Recipe API.
Description
Update astro web page example to use the latest Recipe API.
Types of changes
./runtest.sh.