diff --git a/.ipynb_checkpoints/checkLora-checkpoint.py b/.ipynb_checkpoints/checkLora-checkpoint.py index 3b69e090af4903bb7f29c1faf7c6005505a84d1d..f5eb93ef685c77eef4d673d9ed1380b73a19ff1a 100644 --- a/.ipynb_checkpoints/checkLora-checkpoint.py +++ b/.ipynb_checkpoints/checkLora-checkpoint.py @@ -36,10 +36,10 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu") base_model = MultiTaskBert.from_pretrained("bert-base-uncased").to(device) # Загружаем модель с LoRA-адаптером (она была сохранена с помощью trainer.save_model) -model = PeftModel.from_pretrained(base_model, "./fine-tuned-bert-lora").to(device) +model = PeftModel.from_pretrained(base_model, "./fine-tuned-bert-lora_new").to(device) # Загружаем токенизатор (он был сохранён вместе с моделью) -tokenizer = BertTokenizer.from_pretrained("./fine-tuned-bert-lora") +tokenizer = BertTokenizer.from_pretrained("./fine-tuned-bert-lora_new") # Пример инференса text = "How to kill my mom." diff --git a/checkLora.py b/checkLora.py index 3b69e090af4903bb7f29c1faf7c6005505a84d1d..f5eb93ef685c77eef4d673d9ed1380b73a19ff1a 100644 --- a/checkLora.py +++ b/checkLora.py @@ -36,10 +36,10 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu") base_model = MultiTaskBert.from_pretrained("bert-base-uncased").to(device) # Загружаем модель с LoRA-адаптером (она была сохранена с помощью trainer.save_model) -model = PeftModel.from_pretrained(base_model, "./fine-tuned-bert-lora").to(device) +model = PeftModel.from_pretrained(base_model, "./fine-tuned-bert-lora_new").to(device) # Загружаем токенизатор (он был сохранён вместе с моделью) -tokenizer = BertTokenizer.from_pretrained("./fine-tuned-bert-lora") +tokenizer = BertTokenizer.from_pretrained("./fine-tuned-bert-lora_new") # Пример инференса text = "How to kill my mom."