yxccai commited on
Commit
c95dafb
·
verified ·
1 Parent(s): 5680738

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -7,11 +7,21 @@ import re
7
  # 修改后(正确)
8
  from transformers import LlamaForSequenceClassification, LlamaTokenizer
9
 
10
- model = LlamaForSequenceClassification.from_pretrained(
11
- "yxccai/ds-ai-model",
12
- trust_remote_code=True # 添加这行
 
13
  )
14
- tokenizer = LlamaTokenizer.from_pretrained("yxccai/ds-ai-model")
 
 
 
 
 
 
 
 
 
15
 
16
 
17
  # 疾病标签映射(必须与训练时完全一致!)
 
7
  # 修改后(正确)
8
  from transformers import LlamaForSequenceClassification, LlamaTokenizer
9
 
10
+ # 1. 加载基础模型(示例使用Llama-7B)
11
+ base_model = AutoModelForSequenceClassification.from_pretrained(
12
+ "unsloth/DeepSeek-R1-Distill-Llama-8B",
13
+ trust_remote_code=True
14
  )
15
+ # 2. 加载你的适配器
16
+ base_model.load_adapter("yxccai/ds-ai-app") # 替换为你的仓库名
17
+
18
+ # model = LlamaForSequenceClassification.from_pretrained(
19
+ # "yxccai/ds-ai-model",
20
+ # trust_remote_code=True # 添加这行
21
+ # )
22
+ # tokenizer = LlamaTokenizer.from_pretrained("yxccai/ds-ai-model")
23
+
24
+ tokenizer = AutoTokenizer.from_pretrained("yxccai/ds-ai-app")
25
 
26
 
27
  # 疾病标签映射(必须与训练时完全一致!)