Skip to content

Commit

Permalink
fix(framework:cli): Fix tensorflow template (#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll authored May 1, 2024
1 parent 428c506 commit bfcb4af
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
11 changes: 4 additions & 7 deletions src/py/flwr/cli/new/templates/app/code/client.tensorflow.py.tpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
"""$project_name: A Flower / TensorFlow app."""

import os

from flwr.client import NumPyClient, ClientApp

from $project_name.task import load_data, load_model

from $import_name.task import load_data, load_model

# Make TensorFlow log less verbose
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"

# Define Flower Client and client_fn
class FlowerClient(NumPyClient):
Expand Down Expand Up @@ -43,4 +38,6 @@ def client_fn(cid):


# Flower ClientApp
app = ClientApp(client_fn)
app = ClientApp(
client_fn=client_fn,
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ from flwr.common import ndarrays_to_parameters
from flwr.server import ServerApp, ServerConfig
from flwr.server.strategy import FedAvg

from $project_name.task import load_model
from $import_name.task import load_model

# Define config
config = ServerConfig(num_rounds=3)

parameters = ndarrays_to_parameters(load_model().get_weights())

Expand All @@ -19,6 +22,6 @@ strategy = FedAvg(

# Create ServerApp
app = ServerApp(
config=ServerConfig(num_rounds=3),
config=config,
strategy=strategy,
)
2 changes: 1 addition & 1 deletion src/py/flwr/cli/new/templates/app/pyproject.numpy.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = ""
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
license = {text = "Apache License (2.0)"}
license = { text = "Apache License (2.0)" }
dependencies = [
"flwr[simulation]>=1.8.0,<2.0",
"numpy>=1.21.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = ""
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
license = {text = "Apache License (2.0)"}
license = { text = "Apache License (2.0)" }
dependencies = [
"flwr[simulation]>=1.8.0,<2.0",
"flwr-datasets[vision]>=0.0.2,<1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = ""
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
license = {text = "Apache License (2.0)"}
license = { text = "Apache License (2.0)" }
dependencies = [
"flwr[simulation]>=1.8.0,<2.0",
"flwr-datasets[vision]>=0.0.2,<1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = ""
authors = [
{ name = "The Flower Authors", email = "[email protected]" },
]
license = {text = "Apache License (2.0)"}
license = { text = "Apache License (2.0)" }
dependencies = [
"flwr[simulation]>=1.8.0,<2.0",
"flwr-datasets[vision]>=0.0.2,<1.0.0",
Expand Down

0 comments on commit bfcb4af

Please sign in to comment.