OpenMined / syft-heart-disease-tutorial

Apache License 2.0
2 stars 1 forks source link

SyntaxError in `dump_model` from `utils.py` #1

Open GiuliaGualtieri opened 5 days ago

GiuliaGualtieri commented 5 days ago

Description

I got a SyntaxError while executing the tutorial 02-Model-Training-Experiment.ipynb

from utils import dump_model

  File ~/syft-heart-disease-tutorial/utils.py:31
    return f"{datasite_name.replace(".", "").replace(" ", "_").lower()}_model.jbl"
                                     ^
SyntaxError: f-string: unmatched '('

How to Reproduce

  1. Go to 02-Model-Training-Experiment.ipynb
  2. Run the code.
  3. Scroll down to 'Step 4. Train Models on all datasites'
  4. Then you should get a SyntaxError

Expected Behavior

No errors. My suggested solution: replace

def get_model_file(datasite_name: str) -> str:
    return f"{datasite_name.replace(".", "").replace(" ", "_").lower()}_model.jbl"

with the following code

def get_model_file(datasite_name: str) -> str:
    return f"{datasite_name.replace('.', '').replace(' ', '_').lower()}_model.jbl"

System Information

bvermeul commented 5 days ago

just ran into the same with the same solution. It's also in the 01-Compare-Demographics notebook.