Instructions to use flax-community/roberta-base-thai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flax-community/roberta-base-thai with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="flax-community/roberta-base-thai")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("flax-community/roberta-base-thai") model = AutoModelForMaskedLM.from_pretrained("flax-community/roberta-base-thai", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download run.sh from flax-community/roberta-base-thai: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/flax-community/roberta-base-thai/resolve/main/run.sh
- Command line
-
hf download hf://flax-community/roberta-base-thai/run.sh
-
curl -L -o run.sh https://huggingface.co/flax-community/roberta-base-thai/resolve/main/run.sh
721 Bytes
| python3 run_mlm_flax.py \ | |
| --output_dir="./" \ | |
| --model_type="roberta" \ | |
| --config_name="./" \ | |
| --tokenizer_name="./" \ | |
| --dataset_name="oscar" \ | |
| --dataset_config_name="unshuffled_deduplicated_th" \ | |
| --max_seq_length="128" \ | |
| --weight_decay="0.01" \ | |
| --preprocessing_num_workers="64" \ | |
| --per_device_train_batch_size="512" \ | |
| --per_device_eval_batch_size="512" \ | |
| --learning_rate="3e-5" \ | |
| --warmup_steps="312" \ | |
| --overwrite_output_dir \ | |
| --seed="19" \ | |
| --num_train_epochs="8" \ | |
| --adam_beta1="0.9" \ | |
| --adam_beta2="0.98" \ | |
| --logging_steps="31" \ | |
| --save_steps="312" \ | |
| --eval_steps="1250" \ | |
| --dtype="bfloat16" \ | |
| --push_to_hub | |