Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Preserve the order of loaded openers in selfchat #3923

Merged

Conversation

skywalker023
Copy link
Contributor

@skywalker023 skywalker023 commented Aug 9, 2021

Hello! 👋🏼
I found that we get non-deterministic order of openers even though we are loading them from fixed files or tasks.
So I fixed them to be deterministic.

Patch description

set() results in non-deterministic order of openers for every run.
Use dict.fromkeys() instead to deduplicate openers and preserve order.

Testing steps

Other information

set() results in non-deterministic order of openers for every run.
Use dict.fromkeys() to deduplicate openers and preserve order.
Copy link
Contributor

@stephenroller stephenroller left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

@stephenroller
Copy link
Contributor

Since CI isn't running in your fork, can you manually run pytest tests/test_self_chat.py for me?

@skywalker023
Copy link
Contributor Author

Done!
2021-08-10 10 32 55

@stephenroller stephenroller merged commit d88cccc into facebookresearch:master Aug 10, 2021
@stephenroller
Copy link
Contributor

Thanks!

@skywalker023 skywalker023 deleted the selfchat_openers branch August 10, 2021 03:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants