Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(examples) Update package versions #4895

Merged
merged 13 commits into from
Jan 31, 2025
6 changes: 3 additions & 3 deletions examples/advanced-pytorch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = "Federated Learning with PyTorch and Flower (Advanced Example)"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
"wandb==0.17.8",
]

Expand Down
2 changes: 1 addition & 1 deletion examples/advanced-tensorflow/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Federated Learning with Tensorflow/Keras and Flower (Advanced Exa
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"flwr-datasets[vision]>=0.5.0",
"tensorflow-cpu>=2.9.1, != 2.11.1 ; platform_machine == \"x86_64\"",
"tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == \"darwin\" and platform_machine == \"arm64\"",
"wandb==0.17.8",
Expand Down
8 changes: 4 additions & 4 deletions examples/custom-metrics/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ description = "Federated Learning with Flower and Custom Metrics"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"scikit-learn>=1.2.2",
"tensorflow==2.12.1; sys_platform != 'darwin'",
"tensorflow-macos==2.12.0; sys_platform == 'darwin'",
"flwr-datasets[vision]>=0.5.0",
"scikit-learn>=1.6.0",
"tensorflow>=2.12.1; (platform_machine == \"x86_64\" or platform_machine == \"aarch64\")",
"tensorflow-macos>=2.12.1; sys_platform == \"darwin\" and platform_machine == \"arm64\"",
]

[tool.hatch.build.targets.wheel]
Expand Down
2 changes: 2 additions & 0 deletions examples/embedded-devices/embeddedexample/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def train(net, trainloader, valloader, epochs, learning_rate, device):

def test(net, testloader, device):
"""Validate the model on the test set."""
net.to(device) # move model to GPU if available
net.eval()
criterion = torch.nn.CrossEntropyLoss()
correct, loss = 0, 0.0
with torch.no_grad():
Expand Down
10 changes: 5 additions & 5 deletions examples/embedded-devices/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ version = "1.0.0"
description = "Federated AI with Embedded Devices using Flower"
license = "Apache-2.0"
dependencies = [
"flwr>=1.14.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr>=1.15.0",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
]

[tool.hatch.build]
Expand Down Expand Up @@ -41,5 +41,5 @@ batch-size = 32
default = "embedded-federation"

[tool.flwr.federations.embedded-federation]
address = "49.12.200.204:9093"
address = "127.0.0.1:9093"
insecure = true
2 changes: 1 addition & 1 deletion examples/federated-kaplan-meier-fitter/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Federated Kaplan Meier Fitter with Flower"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets>=0.3.0",
"flwr-datasets>=0.5.0",
"numpy>=1.23.2",
"pandas>=2.0.0",
"lifelines>=0.28.0",
Expand Down
6 changes: 3 additions & 3 deletions examples/fl-dp-sa/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = "Central Differential Privacy and Secure Aggregation in Flower"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
4 changes: 2 additions & 2 deletions examples/fl-tabular/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = "Adult Census Income Tabular Dataset and Federated Learning in Flo
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets>=0.3.0",
"flwr-datasets>=0.5.0",
"torch==2.5.1",
"scikit-learn==1.5.0",
"scikit-learn==1.6.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
4 changes: 2 additions & 2 deletions examples/flower-authentication/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ version = "1.0.0"
description = "Federated Learning with PyTorch and authenticated Flower "
license = "Apache-2.0"
dependencies = [
"flwr>=1.14.0",
"flwr-datasets[vision]>=0.4.0",
"flwr>=1.15.0",
"flwr-datasets[vision]>=0.5.0",
"torch>=2.5.0,<3.0.0",
"torchvision>=0.20.1,<0.21.0",
]
Expand Down
6 changes: 3 additions & 3 deletions examples/flower-secure-aggregation/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = "Secure Aggregation in Flower"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ version = "1.0.0"
description = ""
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.14.0",
"flwr-datasets[vision]>=0.4.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
"wandb",
]

Expand Down
9 changes: 5 additions & 4 deletions examples/flowertune-llm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ version = "1.0.0"
description = "FlowerTune LLM: Federated LLM Fine-tuning with Flower"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]==1.12.0",
"flwr-datasets>=0.3.0",
"flwr[simulation]==1.15.0",
"flwr-datasets>=0.5.0",
"torch==2.3.1",
"trl==0.8.1",
"bitsandbytes==0.43.0",
"bitsandbytes==0.45.0",
"scipy==1.13.0",
"peft==0.6.2",
"fschat[model_worker,webui]==0.2.35",
"transformers==4.39.3",
"transformers==4.47.0",
"sentencepiece==0.2.0",
"omegaconf==2.3.0",
"hf_transfer==0.1.8",
Expand Down
8 changes: 4 additions & 4 deletions examples/flowertune-vit/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ version = "1.0.0"
description = "Federated Finetuning of a Vision Transformer with Flower"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]==1.12.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
6 changes: 3 additions & 3 deletions examples/opacus/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = "Sample-level Differential Privacy with Opacus in Flower"

dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.1.1",
"torchvision==0.16.1",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
"opacus==v1.4.1",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = "Federated Variational Autoencoder Example with PyTorch and Flower
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
8 changes: 4 additions & 4 deletions examples/quickstart-fastai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ description = "Federated Learning with Fastai and Flower (Quickstart Example)"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"fastai==2.7.14",
"torch==2.2.0",
"torchvision==0.17.0",
"flwr-datasets[vision]>=0.5.0",
"fastai==2.7.18",
"torch==2.5.1",
"torchvision==0.20.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-huggingface/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors = [
]
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets>=0.3.0",
"flwr-datasets>=0.5.0",
"torch==2.4.0",
"transformers>=4.30.0,<5.0",
"evaluate>=0.4.0,<1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-jax/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = ""
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.4.0",
"flwr-datasets[vision]>=0.5.0",
"datasets>=2.21.0",
"jax==0.4.31",
"jaxlib==0.4.31",
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-lerobot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
]

dependencies = [
"flwr[simulation]==1.14.0",
"flwr[simulation]==1.15.0",
"transformers>=4.30.0,<5.0",
"lerobot[pusht] @ git+https://github.com/huggingface/lerobot.git@96c7052777aca85d4e55dfba8f81586103ba8f61",
"flwr-datasets>=0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-mlx/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Federated Learning with MLX and Flower (Quickstart Example)"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"flwr-datasets[vision]>=0.5.0",
"mlx==0.21.1",
]

Expand Down
3 changes: 2 additions & 1 deletion examples/quickstart-monai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ description = "Federated Learning with MONAI and Flower (Quickstart Example)"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"flwr-datasets[vision]>=0.5.0",
"monai==1.3.2",
"filelock==3.15.4",
"numpy<2.0.0",
]

[tool.hatch.build.targets.wheel]
Expand Down
6 changes: 3 additions & 3 deletions examples/quickstart-pandas/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ authors = [
]
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"numpy>=1.26.0",
"pandas==2.0.0",
"flwr-datasets[vision]>=0.5.0",
"numpy>=2.0.2",
"pandas==2.2.3",
]

[tool.hatch.build.targets.wheel]
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-pytorch-lightning/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Federated Learning with PyTorch Lightning and Flower (Quickstart
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"flwr-datasets[vision]>=0.5.0",
"pytorch-lightning<2.0.0; sys_platform == 'darwin'",
"pytorch-lightning==1.6.0; sys_platform != 'darwin'",
"torch==2.5.1",
Expand Down
6 changes: 3 additions & 3 deletions examples/quickstart-pytorch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = "Federated Learning with PyTorch and Flower (Quickstart Example)"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
"flwr-datasets[vision]>=0.5.0",
"torch==2.5.1",
"torchvision==0.20.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
4 changes: 2 additions & 2 deletions examples/quickstart-sklearn-tabular/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ description = "Federated Learning with scikit-learn and Flower (Quickstart Examp
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"scikit-learn>=1.3.0",
"flwr-datasets[vision]>=0.5.0",
"scikit-learn>=1.6.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-tensorflow/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Federated Learning with Tensorflow/Keras and Flower (Quickstart E
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"flwr-datasets[vision]>=0.5.0",
"tensorflow>=2.9.1, != 2.11.1 ; (platform_machine == \"x86_64\" or platform_machine == \"aarch64\")",
"tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == \"darwin\" and platform_machine == \"arm64\"",
]
Expand Down
4 changes: 2 additions & 2 deletions examples/sklearn-logreg-mnist/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ authors = [
]
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"flwr-datasets[vision]>=0.5.0",
"numpy>=2.0.0",
"scikit-learn~=1.2.2",
"scikit-learn>=1.6.1",
]

[tool.hatch.build.targets.wheel]
Expand Down
2 changes: 1 addition & 1 deletion examples/tensorflow-privacy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "1.0.0"
description = "Sample-level Differential Privacy with Tensorflow-Privacy in Flower"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets[vision]>=0.3.0",
"flwr-datasets[vision]>=0.5.0",
"tensorflow-estimator~=2.4",
"tensorflow-probability~=0.22.0",
"tensorflow>=2.4.0,<=2.15.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/vertical-fl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "PyTorch Vertical FL with Flower"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets>=0.3.0",
"flwr-datasets>=0.5.0",
"pandas==2.2.3",
"numpy>=1.26.0",
"scikit-learn==1.5.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/vertical-fl/vertical_fl/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _bin_age(age_series):


def _extract_title(name_series):
titles = name_series.str.extract(" ([A-Za-z]+)\.", expand=False)
titles = name_series.str.extract(r" ([A-Za-z]+)\.", expand=False)
rare_titles = {
"Lady",
"Countess",
Expand Down
2 changes: 1 addition & 1 deletion examples/xgboost-comprehensive/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Federated Learning with XGBoost and Flower (Comprehensive Example
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets>=0.3.0",
"flwr-datasets>=0.5.0",
"xgboost>=2.0.0",
]

Expand Down
2 changes: 1 addition & 1 deletion examples/xgboost-quickstart/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Federated Learning with XGBoost and Flower (Quickstart Example)"
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.15.0",
"flwr-datasets>=0.4.0",
"flwr-datasets>=0.5.0",
"xgboost>=2.0.0",
]

Expand Down