Commit 127e7a48 authored by Мазур Грета Евгеньевна's avatar Мазур Грета Евгеньевна
Browse files

obuch with cross and graphic SAVING LORA

parent 2650a64c
No related merge requests found
Showing with 12 additions and 0 deletions
+12 -0
......@@ -4,6 +4,12 @@ from peft import get_peft_model, LoraConfig, TaskType
import torch.nn as nn
from transformers import BertModel, BertPreTrainedModel
# Очистка кеша
torch.cuda.empty_cache()
# Определяем устройство (GPU или CPU)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Убедитесь, что класс MultiTaskBert определён, как в вашем первоначальном коде
class MultiTaskBert(BertPreTrainedModel):
def __init__(self, config):
......
......@@ -4,6 +4,12 @@ from peft import get_peft_model, LoraConfig, TaskType
import torch.nn as nn
from transformers import BertModel, BertPreTrainedModel
# Очистка кеша
torch.cuda.empty_cache()
# Определяем устройство (GPU или CPU)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Убедитесь, что класс MultiTaskBert определён, как в вашем первоначальном коде
class MultiTaskBert(BertPreTrainedModel):
def __init__(self, config):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment