Instructions to use airesearch/wangchanberta-base-wiki-20210520-spm-finetune-qa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use airesearch/wangchanberta-base-wiki-20210520-spm-finetune-qa with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" 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("question-answering", model="airesearch/wangchanberta-base-wiki-20210520-spm-finetune-qa")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("airesearch/wangchanberta-base-wiki-20210520-spm-finetune-qa") model = AutoModelForQuestionAnswering.from_pretrained("airesearch/wangchanberta-base-wiki-20210520-spm-finetune-qa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,22 +4,23 @@ widget:
|
|
| 4 |
context: "โรงเรียนสวนกุหลาบวิทยาลัย (Suankularb Wittayalai School) (อักษรย่อ : ส.ก. / S.K.) เป็นโรงเรียนชายล้วน ระดับชั้นมัธยมศึกษาขนาดใหญ่พิเศษ สังกัดสำนักงานเขตพื้นที่การศึกษามัธยมศึกษาเขต 1 สำนักงานคณะกรรมการการศึกษาขั้นพื้นฐาน (ชื่อเดิม: กรมสามัญศึกษา) กระทรวงศึกษาธิการ ก่อตั้งโดย พระบาทสมเด็จพระจุลจอมเกล้าเจ้าอยู่หัว ได้รับการสถาปนาขึ้นในวันที่ 8 มีนาคม พ.ศ. 2424 (ขณะนั้นนับวันที่ 1 เมษายน เป็นวันขึ้นปีใหม่ เมื่อนับอย่างสากลถือเป็น พ.ศ. 2425) โดยเป็นโรงเรียนรัฐบาลแห่งแรกของประเทศไทย"
|
| 5 |
---
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
Run with:
|
| 8 |
```
|
| 9 |
export WANDB_PROJECT=wangchanberta-qa
|
| 10 |
|
| 11 |
export MODEL_NAME=airesearchth/wangchanberta-base-wiki-20210520-spm
|
| 12 |
-
CUDA_LAUNCH_BLOCKING=1 python train_question_answering_lm_finetuning.py \
|
| 13 |
-
--model_name $MODEL_NAME \
|
| 14 |
-
--revision main@ckp-50000 \
|
| 15 |
-
--dataset_name iapp_thaiqa_xquad \
|
| 16 |
-
--output_dir $MODEL_NAME-finetune-iapp_thaiqa_xquad-model \
|
| 17 |
-
--log_dir $MODEL_NAME-finetune-iapp_thaiqa_xquad-log \
|
| 18 |
-
--model_max_length 400 \
|
| 19 |
-
--pad_on_right \
|
| 20 |
--fp16
|
| 21 |
-
|
| 22 |
-
echo done
|
| 23 |
```
|
| 24 |
-
|
| 25 |
-
Benchmark data: https://github.com/vistec-AI/thai2transformers/releases/tag/qa-v0.2
|
|
|
|
| 4 |
context: "โรงเรียนสวนกุหลาบวิทยาลัย (Suankularb Wittayalai School) (อักษรย่อ : ส.ก. / S.K.) เป็นโรงเรียนชายล้วน ระดับชั้นมัธยมศึกษาขนาดใหญ่พิเศษ สังกัดสำนักงานเขตพื้นที่การศึกษามัธยมศึกษาเขต 1 สำนักงานคณะกรรมการการศึกษาขั้นพื้นฐาน (ชื่อเดิม: กรมสามัญศึกษา) กระทรวงศึกษาธิการ ก่อตั้งโดย พระบาทสมเด็จพระจุลจอมเกล้าเจ้าอยู่หัว ได้รับการสถาปนาขึ้นในวันที่ 8 มีนาคม พ.ศ. 2424 (ขณะนั้นนับวันที่ 1 เมษายน เป็นวันขึ้นปีใหม่ เมื่อนับอย่างสากลถือเป็น พ.ศ. 2425) โดยเป็นโรงเรียนรัฐบาลแห่งแรกของประเทศไทย"
|
| 5 |
---
|
| 6 |
|
| 7 |
+
# wangchanberta-base-wiki-20210520-spm-finetune-qa
|
| 8 |
+
|
| 9 |
+
Finetuning `wangchanberta-base-wiki-20210520-spm` with the training set of `iapp_wiki_qa_squad`, `thaiqa`, `xquad` (removed examples which have cosine similarity with validation and test examples over 0.8). Benchmarks shared on [wandb](https://wandb.ai/cstorm125/wangchanberta-qa) using validation and test sets of `iapp_wiki_qa_squad`.
|
| 10 |
+
Trained with [thai2transformers](https://github.com/vistec-AI/thai2transformers/blob/dev/scripts/downstream/train_question_answering_lm_finetuning.py). Combined benchmark datasets downloadable at [vistec-ai/thai2transformers](https://github.com/vistec-AI/thai2transformers/releases/tag/qa-v0.2).
|
| 11 |
+
|
| 12 |
Run with:
|
| 13 |
```
|
| 14 |
export WANDB_PROJECT=wangchanberta-qa
|
| 15 |
|
| 16 |
export MODEL_NAME=airesearchth/wangchanberta-base-wiki-20210520-spm
|
| 17 |
+
CUDA_LAUNCH_BLOCKING=1 python train_question_answering_lm_finetuning.py \\
|
| 18 |
+
--model_name $MODEL_NAME \\
|
| 19 |
+
--revision main@ckp-50000 \\
|
| 20 |
+
--dataset_name iapp_thaiqa_xquad \\
|
| 21 |
+
--output_dir $MODEL_NAME-finetune-iapp_thaiqa_xquad-model \\
|
| 22 |
+
--log_dir $MODEL_NAME-finetune-iapp_thaiqa_xquad-log \\
|
| 23 |
+
--model_max_length 400 \\
|
| 24 |
+
--pad_on_right \\
|
| 25 |
--fp16
|
|
|
|
|
|
|
| 26 |
```
|
|
|
|
|
|