code
Browse files
app.py
CHANGED
@@ -40,10 +40,8 @@ torch.random.manual_seed(0)
|
|
40 |
model = AutoModelForCausalLM.from_pretrained(
|
41 |
"./phi-4/phi-4", # 模型路径
|
42 |
device_map="cuda", # 使用 GPU
|
43 |
-
|
44 |
trust_remote_code=True, # 允许远程代码加载
|
45 |
-
use_safetensors=True,
|
46 |
-
torch_dtype=torch.float16,
|
47 |
)
|
48 |
tokenizer = AutoTokenizer.from_pretrained("./phi-4/phi-4")
|
49 |
|
|
|
40 |
model = AutoModelForCausalLM.from_pretrained(
|
41 |
"./phi-4/phi-4", # 模型路径
|
42 |
device_map="cuda", # 使用 GPU
|
43 |
+
torch_dtype="auto", # 自动选择数据类型
|
44 |
trust_remote_code=True, # 允许远程代码加载
|
|
|
|
|
45 |
)
|
46 |
tokenizer = AutoTokenizer.from_pretrained("./phi-4/phi-4")
|
47 |
|