Instructions to use HuggingFaceFW/fineweb-edu-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceFW/fineweb-edu-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="HuggingFaceFW/fineweb-edu-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("HuggingFaceFW/fineweb-edu-classifier") model = AutoModelForSequenceClassification.from_pretrained("HuggingFaceFW/fineweb-edu-classifier", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Download src/run_edu_bert.slurm from HuggingFaceFW/fineweb-edu-classifier: direct link, hf CLI and curl.
- Browser
- Download file 793 Bytes
-
https://huggingface.co/HuggingFaceFW/fineweb-edu-classifier/resolve/refs%2Fpr%2F5/src/run_edu_bert.slurm
- Command line
-
hf download hf://HuggingFaceFW/fineweb-edu-classifier@refs/pr/5/src/run_edu_bert.slurm
-
curl -L -o run_edu_bert.slurm https://huggingface.co/HuggingFaceFW/fineweb-edu-classifier/resolve/refs%2Fpr%2F5/src/run_edu_bert.slurm
793 Bytes
| #SBATCH --job-name=run_edu_bert | |
| #SBATCH --partition hopper-prod | |
| #SBATCH --qos=normal | |
| #SBATCH --requeue | |
| #SBATCH --nodes=1 | |
| #SBATCH --ntasks-per-node=1 | |
| #SBATCH --cpus-per-task=12 | |
| #SBATCH --mem-per-cpu=20G | |
| #SBATCH --gpus=1 | |
| #SBATCH -o %x_%j.out | |
| #SBATCH -e %x_%j.err | |
| #SBATCH --time=7-00:00:00 | |
| #SBATCH --array=0-127%128 | |
| set -x -e | |
| source ~/.bashrc | |
| source "$CONDA_PREFIX/etc/profile.d/conda.sh" | |
| source activate pytorch | |
| python run_edu_bert.py \ | |
| --model_name="HuggingFaceFW/fineweb-edu-classifier" \ | |
| --dataset_name="HuggingFaceFW/fineweb" \ | |
| --dataset_config="CC-MAIN-2019-04" \ | |
| --output_dataset_name="HuggingFaceFW/fineweb-edu-annotations" \ | |
| --output_dataset_config="CC-MAIN-2019-04" \ | |
| --text_column="text" \ | |
| --shard ${SLURM_ARRAY_TASK_ID} \ | |
| --num_shards 128 |