code
Browse files
app.py
CHANGED
@@ -10,12 +10,12 @@ os.system('huggingface-cli download matteogeniaccio/phi-4 --local-dir ./phi-4 --
|
|
10 |
torch.random.manual_seed(0)
|
11 |
|
12 |
model = AutoModelForCausalLM.from_pretrained(
|
13 |
-
"
|
14 |
device_map="cuda", # 使用 GPU
|
15 |
torch_dtype="auto", # 自动选择数据类型
|
16 |
trust_remote_code=True, # 允许远程代码加载
|
17 |
)
|
18 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
19 |
|
20 |
# 设置 pipeline
|
21 |
|
|
|
10 |
torch.random.manual_seed(0)
|
11 |
|
12 |
model = AutoModelForCausalLM.from_pretrained(
|
13 |
+
"./phi-4/phi-4", # 模型路径
|
14 |
device_map="cuda", # 使用 GPU
|
15 |
torch_dtype="auto", # 自动选择数据类型
|
16 |
trust_remote_code=True, # 允许远程代码加载
|
17 |
)
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained("./phi-4/phi-4")
|
19 |
|
20 |
# 设置 pipeline
|
21 |
|