yxccai commited on
Commit
3270264
·
verified ·
1 Parent(s): 56eb9fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -4,8 +4,15 @@ import torch
4
  import re
5
 
6
  # 加载医学诊断模型
7
- model = AutoModelForSequenceClassification.from_pretrained("yxccai/ds-ai-model")
8
- tokenizer = AutoTokenizer.from_pretrained("yxccai/ds-ai-model")
 
 
 
 
 
 
 
9
 
10
  # 疾病标签映射(必须与训练时完全一致!)
11
  disease_labels = [
 
4
  import re
5
 
6
  # 加载医学诊断模型
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
  # 疾病标签映射(必须与训练时完全一致!)
18
  disease_labels = [