refactoring

master^2
papuSpartan 2024-10-11 06:11:10 -05:00
parent 23ec02c229
commit 622827aab5
No known key found for this signature in database
GPG Key ID: CA376082283AF69A
3 changed files with 6 additions and 6 deletions

View File

@ -29,13 +29,13 @@ class Worker_Model(BaseModel):
default=False
)
state: Optional[Any] = Field(default=1, description="The last known state of this worker")
user: Optional[str] = Field(description="The username to be used when authenticating with this worker")
password: Optional[str] = Field(description="The password to be used when authenticating with this worker")
user: Optional[str] = Field(description="The username to be used when authenticating with this worker", default=None)
password: Optional[str] = Field(description="The password to be used when authenticating with this worker", default=None)
pixel_cap: Optional[int] = Field(default=-1, description="Max amount of pixels to allow one worker to handle at the same time. -1 means there is no limit")
class ConfigModel(BaseModel):
workers: List[Dict[str, Worker_Model]]
benchmark_payload: Dict = Field(
benchmark_payload: Benchmark_Payload = Field(
default=Benchmark_Payload,
description='the payload used when benchmarking a node'
)

View File

@ -65,7 +65,7 @@ samples = 3 # number of times to benchmark worker after warmup benchmarks are c
class BenchmarkPayload(BaseModel):
validate_assignment = True
# validate_assignment = True
prompt: str = Field(default="A herd of cows grazing at the bottom of a sunny valley")
negative_prompt: str = Field(default="")
steps: int = Field(default=20)

View File

@ -674,7 +674,7 @@ class World:
self.add_worker(**fields)
sh.benchmark_payload = Benchmark_Payload(**config.benchmark_payload)
sh.benchmark_payload = Benchmark_Payload(**config.benchmark_payload.dict())
self.job_timeout = config.job_timeout
self.enabled = config.enabled
self.enabled_i2i = config.enabled_i2i
@ -699,7 +699,7 @@ class World:
)
with open(self.config_path, 'w+') as config_file:
config_file.write(config.json(indent=3))
config_file.write(config.model_dump_json(indent=3))
logger.debug(f"config saved")
def ping_remotes(self, indiscriminate: bool = False):