Forráskód Böngészése

convert to python v3.9

camenduru 2 éve
szülő
commit
9d7390d2d1
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      extensions-builtin/Lora/lora.py

+ 2 - 1
extensions-builtin/Lora/lora.py

@@ -2,6 +2,7 @@ import glob
 import os
 import os
 import re
 import re
 import torch
 import torch
+from typing import Union
 
 
 from modules import shared, devices, sd_models, errors
 from modules import shared, devices, sd_models, errors
 
 
@@ -235,7 +236,7 @@ def lora_calc_updown(lora, module, target):
         return updown
         return updown
 
 
 
 
-def lora_apply_weights(self: torch.nn.Conv2d | torch.nn.Linear | torch.nn.MultiheadAttention):
+def lora_apply_weights(self: Union[torch.nn.Conv2d, torch.nn.Linear, torch.nn.MultiheadAttention]):
     """
     """
     Applies the currently selected set of Loras to the weights of torch layer self.
     Applies the currently selected set of Loras to the weights of torch layer self.
     If weights already have this particular set of loras applied, does nothing.
     If weights already have this particular set of loras applied, does nothing.