From 58b470a58c4831d3442a2453f0241f8d098dcbad Mon Sep 17 00:00:00 2001 From: ifrit98 Date: Mon, 8 Jan 2024 20:48:19 +0000 Subject: [PATCH] can't have leading underscore for field names in pydantic v2 --- protocol.py | 4 ++-- validator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol.py b/protocol.py index d521193..608af9d 100644 --- a/protocol.py +++ b/protocol.py @@ -40,12 +40,12 @@ class ImageToImage( TextToImage ): required_hash_fields: list[str] = pydantic.Field( ["text", "negative_prompt", "height", "width", "num_images_per_prompt", "seed", "nsfw_allowed", "image", "similarity"] , allow_mutation = False) class ValidatorSettings( bt.Synapse ): - _version: list[int] = pydantic.Field( [0, 0, 1] , allow_mutation = False) + version: list[int] = pydantic.Field( [0, 0, 1] , allow_mutation = False) nsfw_allowed: bool class MinerSettings( bt.Synapse ): - _version: list[int] = pydantic.Field( [0, 0, 1] , allow_mutation = False) + version: list[int] = pydantic.Field( [0, 0, 1] , allow_mutation = False) is_public: bool # set to true if you want anyone (non validator) to query your miner min_validator_stake: int # minimum stake required to query this miner as a validator nsfw_allowed: bool diff --git a/validator.py b/validator.py index 037bb5b..b49bf13 100644 --- a/validator.py +++ b/validator.py @@ -1098,7 +1098,7 @@ def GetImageHashesOfResponses(responses): return hashes async def forward_settings( synapse: ValidatorSettings ) -> ValidatorSettings: - synapse._version = __version__ + synapse.version = __version__ synapse.nsfw_allowed = config.miner.allow_nsfw return synapse