Kaynağa Gözat

Fix torch.compile call on windows (#81)

* Windows not support compile

* Fix code style
Kohaku-Blueleaf 3 yıl önce
ebeveyn
işleme
450206caaf
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      finetune.py

+ 2 - 1
finetune.py

@@ -1,4 +1,5 @@
 import os
+import sys
 
 import torch
 import torch.nn as nn
@@ -195,7 +196,7 @@ model.state_dict = (
     lambda self, *_, **__: get_peft_model_state_dict(self, old_state_dict())
 ).__get__(model, type(model))
 
-if torch.__version__ >= "2":
+if torch.__version__ >= "2" and sys.platform != 'win32':
     model = torch.compile(model)
 
 trainer.train()