Instructions to use ahotrod/albert_xxlargev1_squad2_512 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ahotrod/albert_xxlargev1_squad2_512 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="ahotrod/albert_xxlargev1_squad2_512")# Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("ahotrod/albert_xxlargev1_squad2_512") model = AutoModelForQuestionAnswering.from_pretrained("ahotrod/albert_xxlargev1_squad2_512") - Notebooks
- Google Colab
- Kaggle
| export OMP_NUM_THREADS=12 | |
| EXAMPLES=/mnt/work/nlpu/transformers/examples/question-answering | |
| SQUAD=${EXAMPLES}/scripts/squad2.0 | |
| MODEL_PATH=${EXAMPLES}/scripts/runs/albert_xxlargev1_squad2_512 | |
| python ${EXAMPLES}/run_squad.py \ | |
| --model_type albert \ | |
| --model_name_or_path albert-xxlarge-v1 \ | |
| --do_train \ | |
| --do_eval \ | |
| --train_file ${SQUAD}/train-v2.0.json \ | |
| --predict_file ${SQUAD}/dev-v2.0.json \ | |
| --version_2_with_negative \ | |
| --do_lower_case \ | |
| --num_train_epochs 3 \ | |
| --max_steps 8144 \ | |
| --warmup_steps 814 \ | |
| --learning_rate 3e-5 \ | |
| --max_seq_length 512 \ | |
| --doc_stride 128 \ | |
| --per_gpu_train_batch_size 6 \ | |
| --gradient_accumulation_steps 8 \ | |
| --per_gpu_eval_batch_size 48 \ | |
| --fp16 \ | |
| --fp16_opt_level O1 \ | |
| --threads 12 \ | |
| --logging_steps 50 \ | |
| --save_steps 3000 \ | |
| --overwrite_output_dir \ | |
| --output_dir ${MODEL_PATH} | |
| $@ | |