-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeBERTa models support #1
Comments
!test -d transformers-4.19.2 || git clone -b v4.19.2 --depth=1 https://github.com/huggingface/transformers transformers-4.19.2
!test -d JGLUE || ( git clone --depth=1 https://github.com/yahoojapan/JGLUE && cat JGLUE/fine-tuning/patch/transformers-4.9.2_jglue-1.0.0.patch | ( cd transformers-4.19.2 && patch -p1 ) )
!cd transformers-4.19.2 && pip install .
!pip install -r transformers-4.19.2/examples/pytorch/text-classification/requirements.txt
!pip install protobuf==3.19.1 tensorboard
import json
for f in ["train-v1.0.json","valid-v1.0.json"]:
with open("JGLUE/datasets/jsquad-v1.0/"+f,"r",encoding="utf-8") as r:
j=json.load(r)
u=[]
for d in j["data"]:
for p in d["paragraphs"]:
for q in p["qas"]:
u.append({"id":q["id"],"title":d["title"],"context":p["context"],"question":q["question"],"answers":{"text":[x["text"] for x in q["answers"]],"answer_start":[x["answer_start"] for x in q["answers"]]}})
with open(f,"w",encoding="utf-8") as w:
json.dump({"data":u},w,ensure_ascii=False,indent=2)
!python transformers-4.19.2/examples/pytorch/question-answering/run_qa.py --model_name_or_path KoichiYasuoka/deberta-base-japanese-aozora --do_train --do_eval --max_seq_length 384 --learning_rate 5e-05 --num_train_epochs 3 --per_device_train_batch_size 16 --per_device_eval_batch_size 16 --output_dir ./output_jsquad2 --overwrite_output_dir --train_file train-v1.0.json --validation_file valid-v1.0.json --save_steps 5000 --warmup_ratio 0.1 I've just been trying the program above on Google Colaboratory, but I'm vague that the conversion is really suitable for JSQuAD. @tomohideshibata -san, does |
Thank you for trying JGLUE. For the first comment, the latest version, v4.19.2, can work. (We have updated the explanation for the huggingface versions via 53e5ecd.) For the second comment, we used
Yes. |
Thank you @tomohideshibata -san for confirming |
Yes. In the current version, |
Thank you @tomohideshibata -san for the information about [SEP]. Well, I've just made tentative https://github.com/KoichiYasuoka/JGLUE/blob/main/fine-tuning/patch/transformers-4.19.2_jglue-1.0.0.patch for |
We encountered a similar problem.
|
Thanks for reporting your results. We are also going to test |
I also tried
|
Hi @kaisugi -san, I needed some kind of conversion for
|
I confirmed your patch script worked properly, Thanks! |
Thank you for releasing JGLUE, but I could not evaluate my deberta-base-japanese-aozora. There seem two problems exist:
DeBERTaV2ForMultipleChoice
requirestransformers
v4.19.0 and after, but JGLUE requires v4.9.2DeBERTaV2TokenizerFast
) are not supported on JSQuAD with--use_fast_tokenizer
I tried to force v4.19.2 for the problems, but I could not resolve the latter. Please see detail in my diary (written in Japanese). Do you have any idea?
The text was updated successfully, but these errors were encountered: