Instructions to use RUCAIBox/Erya with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RUCAIBox/Erya with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="RUCAIBox/Erya")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("RUCAIBox/Erya") model = AutoModelForSeq2SeqLM.from_pretrained("RUCAIBox/Erya", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,7 +16,7 @@ More information about Erya dataset can be found here: [RUCAIBox/Erya-dataset ·
|
|
| 16 |
from transformers import BertTokenizer, CPTForConditionalGeneration
|
| 17 |
|
| 18 |
tokenizer = BertTokenizer.from_pretrained("RUCAIBox/Erya")
|
| 19 |
-
model = CPTForConditionalGeneration.from_pretrained("RUCAIBox/
|
| 20 |
|
| 21 |
input_ids = tokenizer("安世字子孺,少以父任为郎。", return_tensors='pt')
|
| 22 |
input_ids.pop("token_type_ids")
|
|
|
|
| 16 |
from transformers import BertTokenizer, CPTForConditionalGeneration
|
| 17 |
|
| 18 |
tokenizer = BertTokenizer.from_pretrained("RUCAIBox/Erya")
|
| 19 |
+
model = CPTForConditionalGeneration.from_pretrained("RUCAIBox/Erya")
|
| 20 |
|
| 21 |
input_ids = tokenizer("安世字子孺,少以父任为郎。", return_tensors='pt')
|
| 22 |
input_ids.pop("token_type_ids")
|