Spaces:
Sleeping
Sleeping
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"""### 鎸囦护:
|