Spaces:
Sleeping
Sleeping
test2023h5
commited on
Commit
•
e4c7439
1
Parent(s):
225fa5f
Update main.py
Browse files
main.py
CHANGED
@@ -13,7 +13,7 @@ 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, torch_dtype=torch.
|
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, torch_dtype=torch.float32, device_map='auto')
|
17 |
|
18 |
# 加载适配器
|
19 |
adapter_path1 = "test2023h5/wyw2xdw"
|