From 779c675d5a1b98c192248ad1e19d61121b95151d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9C=D0=B0=D0=B7=D1=83=D1=80=20=D0=93=D1=80=D0=B5=D1=82?=
 =?UTF-8?q?=D0=B0=20=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D1=8C=D0=B5=D0=B2=D0=BD?=
 =?UTF-8?q?=D0=B0?= <gemazur_1@edu.hse.ru>
Date: Tue, 25 Mar 2025 03:16:00 +0300
Subject: [PATCH] obuch with cross and graphic

---
 .ipynb_checkpoints/checkLora-checkpoint.py | 28 ++++------------------
 checkLora.py                               | 28 ++++------------------
 2 files changed, 8 insertions(+), 48 deletions(-)

diff --git a/.ipynb_checkpoints/checkLora-checkpoint.py b/.ipynb_checkpoints/checkLora-checkpoint.py
index fb4e8a0..10ddf8e 100644
--- a/.ipynb_checkpoints/checkLora-checkpoint.py
+++ b/.ipynb_checkpoints/checkLora-checkpoint.py
@@ -1,25 +1,5 @@
-from transformers import BertForSequenceClassification, BertTokenizer
-from peft import PeftModel
-import torch
+from peft import PeftConfig
 
-device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
-
-# Загружаем базовую модель (не BertModel, а BertForSequenceClassification!)
-base_model = BertForSequenceClassification.from_pretrained("bert-base-uncased").to(device)
-
-# Загружаем LoRA адаптер
-model = PeftModel.from_pretrained(base_model, "./fine-tuned-bert-lora").to(device)
-
-# Загружаем токенизатор
-tokenizer = BertTokenizer.from_pretrained("./fine-tuned-bert-lora")
-
-print("LoRA успешно загружена!")
-
-text = "This is a test prompt."
-inputs = tokenizer(text, return_tensors="pt").to(device)
-
-# Запускаем модель
-with torch.no_grad():
-    outputs = model(**inputs)
-
-print(outputs)
\ No newline at end of file
+config = PeftConfig.from_pretrained("./fine-tuned-bert-lora")
+print("Базовая модель:", config.base_model_name_or_path)
+print("LoRA config:", config)
\ No newline at end of file
diff --git a/checkLora.py b/checkLora.py
index fb4e8a0..10ddf8e 100644
--- a/checkLora.py
+++ b/checkLora.py
@@ -1,25 +1,5 @@
-from transformers import BertForSequenceClassification, BertTokenizer
-from peft import PeftModel
-import torch
+from peft import PeftConfig
 
-device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
-
-# Загружаем базовую модель (не BertModel, а BertForSequenceClassification!)
-base_model = BertForSequenceClassification.from_pretrained("bert-base-uncased").to(device)
-
-# Загружаем LoRA адаптер
-model = PeftModel.from_pretrained(base_model, "./fine-tuned-bert-lora").to(device)
-
-# Загружаем токенизатор
-tokenizer = BertTokenizer.from_pretrained("./fine-tuned-bert-lora")
-
-print("LoRA успешно загружена!")
-
-text = "This is a test prompt."
-inputs = tokenizer(text, return_tensors="pt").to(device)
-
-# Запускаем модель
-with torch.no_grad():
-    outputs = model(**inputs)
-
-print(outputs)
\ No newline at end of file
+config = PeftConfig.from_pretrained("./fine-tuned-bert-lora")
+print("Базовая модель:", config.base_model_name_or_path)
+print("LoRA config:", config)
\ No newline at end of file
-- 
GitLab