Spaces:
Sleeping
Sleeping
test2023h5
commited on
Commit
•
3f19e4f
1
Parent(s):
22268b4
Update main.py
Browse files
main.py
CHANGED
@@ -6,7 +6,7 @@ from peft import PeftModel, get_peft_config
|
|
6 |
import json
|
7 |
import torch
|
8 |
|
9 |
-
|
10 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
11 |
|
12 |
|
@@ -33,7 +33,7 @@ model = base_model.to(device)
|
|
33 |
|
34 |
# 加载 tokenizer
|
35 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
36 |
-
|
37 |
|
38 |
def format_instruction(task, text):
|
39 |
string = f"""### 指令:
|
|
|
6 |
import json
|
7 |
import torch
|
8 |
|
9 |
+
|
10 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
11 |
|
12 |
|
|
|
33 |
|
34 |
# 加载 tokenizer
|
35 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
36 |
+
|
37 |
|
38 |
def format_instruction(task, text):
|
39 |
string = f"""### 指令:
|