ClueAI commited on
Commit
5348be3
1 Parent(s): 313b026

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -2
README.md CHANGED
@@ -75,11 +75,14 @@ Based on the original functions of Chatyuan-large-v1, we optimized the model as
75
 
76
  ```python
77
  from transformers import AutoTokenizer, AutoModel
 
78
  import os
 
 
79
  model_dir='ClueAI/ChatYuan-large-v2'
80
- tokenizer = AutoTokenizer.from_pretrained(model_dir)
81
  # 速度会受到网络影响
82
- model = AutoModel.from_pretrained(model_dir, trust_remote_code=True)
83
  history = []
84
  print("starting")
85
  while True:
 
75
 
76
  ```python
77
  from transformers import AutoTokenizer, AutoModel
78
+ from transformers import T5Tokenizer, T5ForConditionalGeneration
79
  import os
80
+ # 加载模型
81
+
82
  model_dir='ClueAI/ChatYuan-large-v2'
83
+ tokenizer = T5Tokenizer.from_pretrained(model_dir)
84
  # 速度会受到网络影响
85
+ model = T5ForConditionalGeneration.from_pretrained(model_dir, trust_remote_code=True)
86
  history = []
87
  print("starting")
88
  while True: