Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
proekt
obuch
Commits
127e7a48
Commit
127e7a48
authored
2 weeks ago
by
Мазур Грета Евгеньевна
Browse files
Options
Download
Patches
Plain Diff
obuch with cross and graphic SAVING LORA
parent
2650a64c
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.ipynb_checkpoints/proverkabert-checkpoint.py
+6
-0
.ipynb_checkpoints/proverkabert-checkpoint.py
proverkabert.py
+6
-0
proverkabert.py
with
12 additions
and
0 deletions
+12
-0
.ipynb_checkpoints/proverkabert-checkpoint.py
+
6
−
0
View file @
127e7a48
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
proverkabert.py
+
6
−
0
View file @
127e7a48
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets