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

Fix Invalid syntax at convert_recipe_to_code.py #1642

Merged

Conversation

seunghalee1226
Copy link
Contributor

I added double quotes around the name parameter in dataloaders.get() in the code below.

    train_dataloader = dataloaders.get(
        name="{train_dataloader}",
        dataset_params={train_dataset_params},
        dataloader_params={train_dataloader_params},
    )
    val_dataloader = dataloaders.get(
        name="{val_dataloader}",
        dataset_params={val_dataset_params},
        dataloader_params={val_dataloader_params},
    )

@BloodAxe
Copy link
Contributor

Thanks for spotting this. I think adding quotes is not correct fix since train_dataloader can be None and wrapping quotes would make it "None" which is a string.
Instead please use wrap_in_quotes_if_string method: name={wrap_in_quotes_if_string(train_dataloader)}`. That should do the job.

@seunghalee1226
Copy link
Contributor Author

Oh, I just realized that the train/valid_dataloader variables could be None. As you mentioned earlier, I used the wrap_in_quotes_if_string method. Without wrap_in_quotes_if_string, the conversion to a string type doesn't happen in train/valid dataloader, and this was causing a bug.

Copy link
Contributor

@BloodAxe BloodAxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BloodAxe BloodAxe merged commit 8e9f9d4 into Deci-AI:master Nov 20, 2023
7 checks passed
@BloodAxe BloodAxe added the 3.5.0 label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants