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:
# pip install -U transformers accelerate # 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, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_t5.py
Browse files- modeling_t5.py +1 -1
modeling_t5.py
CHANGED
|
@@ -36,7 +36,7 @@ class T5ForConditionalGeneration(t5FCG):
|
|
| 36 |
return self.postprocess(out_text[0])
|
| 37 |
|
| 38 |
|
| 39 |
-
def chat(self, tokenizer, query: str, history: List[Tuple[str, str]] = None, sample=True, top_p=0.9, temperature=0.7,max_length=
|
| 40 |
|
| 41 |
|
| 42 |
history = history or []
|
|
|
|
| 36 |
return self.postprocess(out_text[0])
|
| 37 |
|
| 38 |
|
| 39 |
+
def chat(self, tokenizer, query: str, history: List[Tuple[str, str]] = None, sample=True, top_p=0.9, temperature=0.7,max_length=2048,no_repeat_ngram_size=12,num_beams=1, length_penalty=0.6):
|
| 40 |
|
| 41 |
|
| 42 |
history = history or []
|