Instructions to use xmj2002/bart_modern_classical with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xmj2002/bart_modern_classical 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="xmj2002/bart_modern_classical")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("xmj2002/bart_modern_classical") model = AutoModelForSeq2SeqLM.from_pretrained("xmj2002/bart_modern_classical", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- xmj2002/Chinese_modern_classical
|
| 5 |
+
language:
|
| 6 |
+
- zh
|
| 7 |
+
pipeline_tag: translation
|
| 8 |
+
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
使用的预训练模型为[fnlp/bart-base-chinese · Hugging Face](https://huggingface.co/fnlp/bart-base-chinese)
|
| 12 |
+
|
| 13 |
+
实现的功能为现代汉语到文言文(按照翻译任务那样训练)
|
| 14 |
+
|
| 15 |
+
## 超参数
|
| 16 |
+
|
| 17 |
+
- batch size: 32
|
| 18 |
+
- epoch: 5
|
| 19 |
+
- lr: 5e-5
|
| 20 |
+
|
| 21 |
+
由于使用的数据集样本数大,所以仅使用了10万条数据(整个数据集共有97万条数据)进行训练。
|