Spaces:
Sleeping
Sleeping
test2023h5
commited on
Commit
•
5111cfb
1
Parent(s):
e4c7439
Update main.py
Browse files
main.py
CHANGED
@@ -13,7 +13,9 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
13 |
# 加载预训练模型
|
14 |
model_name = "Qwen/Qwen2-0.5B"
|
15 |
#model_name = "../models/qwen/Qwen2-0.5B"
|
16 |
-
base_model = AutoModelForCausalLM.from_pretrained(model_name
|
|
|
|
|
17 |
|
18 |
# 加载适配器
|
19 |
adapter_path1 = "test2023h5/wyw2xdw"
|
|
|
13 |
# 加载预训练模型
|
14 |
model_name = "Qwen/Qwen2-0.5B"
|
15 |
#model_name = "../models/qwen/Qwen2-0.5B"
|
16 |
+
base_model = AutoModelForCausalLM.from_pretrained(model_name)
|
17 |
+
|
18 |
+
base_model.to("cpu")
|
19 |
|
20 |
# 加载适配器
|
21 |
adapter_path1 = "test2023h5/wyw2xdw"
|