Skip to content

Repository files navigation

🤗 HuggingFace Project Learning

Hands-on work from my journey through the Hugging Face LLM Course and The Reasoning Course, plus a flagship end-to-end project: fine-tuning BERT for Romanian extractive question answering on the XQuAD-ro dataset.

Companion to my GitHub profile — the HF completion certificates (LLM Course Unit 1, Unit 3, and The Reasoning Course — Fundamentals of GRPO) shown there were earned working through the notebooks in this repo.


🚀 Flagship Project — Romanian QA on XQuAD-ro

Two extractive QA models fine-tuned on the Romanian split of XQuAD, loaded directly from the DeepMind mirror as xquad.ro.json and prepared with 🤗 datasets.

Notebook Base model Approach Colab
bert-base-romanian-cased-v1.ipynb dumitrescustefan/bert-base-romanian-cased-v1 Monolingual Romanian BERT Open In Colab
multilingual-bert.ipynb bert-base-multilingual-cased Multilingual BERT baseline Open In Colab

Both notebooks cover the full pipeline: dataset download → tokenization with sliding-window context → AutoModelForQuestionAnswering fine-tuning → post- processing spans → EM / F1 evaluation. See projects/romanian-qa-xquad-ro/README.md for the model comparison.


🧠 Reasoning & GRPO (→ Reasoning Course certificate)

Group Relative Policy Optimization — the RL algorithm behind reasoning models — studied three ways: from scratch in raw PyTorch, with 🤗 trl, and with unsloth for memory-efficient training.

Notebook What it covers
GRPO_Implementation_in_PyTorch.ipynb GRPO from first principles on Qwen/Qwen2-Math-1.5B — group sampling, reward computation, advantage normalization and the policy update, written out by hand
Fine_tuning_a_model_with_GRPO.ipynb GRPOTrainer from trl + LoRA (peft) on HuggingFaceTB/SmolLM-135M-Instruct over the mlabonne/smoltldr summarization set, tracked in Weights & Biases
nb/Gemma3_(1B)-GRPO.ipynb google/gemma-3-1b-it on GSM8K with unsloth + vllm — custom reward functions for answer format and correctness, then pushing the result to the Hub

📚 HF LLM Course Notebooks

Selected chapters from the Hugging Face LLM course, reworked with my own experiments and notes.

Chapter 3 — Fine-tuning a pretrained model (→ Unit 3 certificate)

Task: GLUE / MRPC paraphrase classification with bert-base-uncased.

Chapter 4 — Sharing models and tokenizers

Chapter 5 — The 🤗 Datasets library

Chapter 6 — The 🤗 Tokenizers library

Chapter 7 — Classic NLP tasks

Each notebook fine-tunes and pushes a checkpoint to the Hub.

Chapter 8 — How to ask for help

Chapter 9 — Building demos with Gradio

Chapter 11 — Fine-tuning LLMs


🛠️ Stack

Core transformers · datasets · evaluate · accelerate · torch · tokenizers

Fine-tuning & RL trl · peft · unsloth · bitsandbytes · vllm

Tooling gradio · lighteval · faiss · wandb · scikit-learn

▶️ Running locally

pip install -r requirements.txt
jupyter lab

requirements.txt covers the core course notebooks. The GRPO, SFT and evaluation notebooks pull their heavier extras (trl, peft, unsloth, vllm, lighteval, wandb) inline with pip install in the first cell, so they run as-is in Colab.

Every notebook also carries an Open in Colab badge — a free GPU runtime is enough for most course notebooks; the QA fine-tuning and GRPO notebooks want a T4 or better.

🗂️ Repo layout

projects/   Flagship end-to-end projects (Romanian QA)
course/     HF course chapter walkthroughs (ch3–ch9, ch11)
nb/         Standalone notebooks (Gemma 3 GRPO)
*.ipynb     Reasoning course GRPO notebooks

🔗 More

📄 License

MIT.

About

A complete repo that showcases my knowledge of the Hugging Face API

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages