Instructions to use ClueAI/ChatYuan-large-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ClueAI/ChatYuan-large-v2 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("ClueAI/ChatYuan-large-v2", trust_remote_code=True) model = AutoModelForSeq2SeqLM.from_pretrained("ClueAI/ChatYuan-large-v2", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Update modeling_t5.py
Browse files- modeling_t5.py +1 -1
modeling_t5.py
CHANGED
|
@@ -22,7 +22,7 @@ class T5ForConditionalGeneration(t5FCG):
|
|
| 22 |
|
| 23 |
|
| 24 |
def get_response(self,tokenizer,text, sample=True, top_p=0.9, temperature=0.7,max_length=1024,no_repeat_ngram_size=12,num_beams=1, length_penalty=0.6):
|
| 25 |
-
|
| 26 |
text=base_info+text
|
| 27 |
text = self.preprocess(text)
|
| 28 |
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
def get_response(self,tokenizer,text, sample=True, top_p=0.9, temperature=0.7,max_length=1024,no_repeat_ngram_size=12,num_beams=1, length_penalty=0.6):
|
| 25 |
+
base_info = ""
|
| 26 |
text=base_info+text
|
| 27 |
text = self.preprocess(text)
|
| 28 |
|