Unverified Commit b12de850 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #5992 from yuvalabou/F541

Fix F541: f-string without any placeholders
parents a66514e1 3bf5591e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ class LDSR:
        global cached_ldsr_model
        global cached_ldsr_model


        if shared.opts.ldsr_cached and cached_ldsr_model is not None:
        if shared.opts.ldsr_cached and cached_ldsr_model is not None:
            print(f"Loading model from cache")
            print("Loading model from cache")
            model: torch.nn.Module = cached_ldsr_model
            model: torch.nn.Module = cached_ldsr_model
        else:
        else:
            print(f"Loading model from {self.modelPath}")
            print(f"Loading model from {self.modelPath}")
+2 −2
Original line number Original line Diff line number Diff line
@@ -382,7 +382,7 @@ class VQAutoEncoder(nn.Module):
                self.load_state_dict(torch.load(model_path, map_location='cpu')['params'])
                self.load_state_dict(torch.load(model_path, map_location='cpu')['params'])
                logger.info(f'vqgan is loaded from: {model_path} [params]')
                logger.info(f'vqgan is loaded from: {model_path} [params]')
            else:
            else:
                raise ValueError(f'Wrong params!')
                raise ValueError('Wrong params!')




    def forward(self, x):
    def forward(self, x):
@@ -431,7 +431,7 @@ class VQGANDiscriminator(nn.Module):
            elif 'params' in chkpt:
            elif 'params' in chkpt:
                self.load_state_dict(torch.load(model_path, map_location='cpu')['params'])
                self.load_state_dict(torch.load(model_path, map_location='cpu')['params'])
            else:
            else:
                raise ValueError(f'Wrong params!')
                raise ValueError('Wrong params!')


    def forward(self, x):
    def forward(self, x):
        return self.main(x)
        return self.main(x)
 No newline at end of file
+2 −2
Original line number Original line Diff line number Diff line
@@ -277,7 +277,7 @@ def load_hypernetwork(filename):
            print(traceback.format_exc(), file=sys.stderr)
            print(traceback.format_exc(), file=sys.stderr)
    else:
    else:
        if shared.loaded_hypernetwork is not None:
        if shared.loaded_hypernetwork is not None:
            print(f"Unloading hypernetwork")
            print("Unloading hypernetwork")


        shared.loaded_hypernetwork = None
        shared.loaded_hypernetwork = None


@@ -443,7 +443,7 @@ def train_hypernetwork(hypernetwork_name, learn_rate, batch_size, gradient_step,


    initial_step = hypernetwork.step or 0
    initial_step = hypernetwork.step or 0
    if initial_step >= steps:
    if initial_step >= steps:
        shared.state.textinfo = f"Model has already been trained beyond specified max steps"
        shared.state.textinfo = "Model has already been trained beyond specified max steps"
        return hypernetwork, filename
        return hypernetwork, filename


    scheduler = LearnRateScheduler(learn_rate, steps, initial_step)
    scheduler = LearnRateScheduler(learn_rate, steps, initial_step)
+1 −1
Original line number Original line Diff line number Diff line
@@ -599,7 +599,7 @@ def read_info_from_image(image):
Negative prompt: {json_info["uc"]}
Negative prompt: {json_info["uc"]}
Steps: {json_info["steps"]}, Sampler: {sampler}, CFG scale: {json_info["scale"]}, Seed: {json_info["seed"]}, Size: {image.width}x{image.height}, Clip skip: 2, ENSD: 31337"""
Steps: {json_info["steps"]}, Sampler: {sampler}, CFG scale: {json_info["scale"]}, Seed: {json_info["seed"]}, Size: {image.width}x{image.height}, Clip skip: 2, ENSD: 31337"""
        except Exception:
        except Exception:
            print(f"Error parsing NovelAI image generation parameters:", file=sys.stderr)
            print("Error parsing NovelAI image generation parameters:", file=sys.stderr)
            print(traceback.format_exc(), file=sys.stderr)
            print(traceback.format_exc(), file=sys.stderr)


    return geninfo, items
    return geninfo, items
+1 −1
Original line number Original line Diff line number Diff line
@@ -172,7 +172,7 @@ class InterrogateModels:
                            res += ", " + match
                            res += ", " + match


        except Exception:
        except Exception:
            print(f"Error interrogating", file=sys.stderr)
            print("Error interrogating", file=sys.stderr)
            print(traceback.format_exc(), file=sys.stderr)
            print(traceback.format_exc(), file=sys.stderr)
            res += "<error>"
            res += "<error>"


Loading