refactoring
parent
23ec02c229
commit
622827aab5
|
|
@ -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'
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue