nadiva1243 commited on
Commit
36eb008
·
verified ·
1 Parent(s): ae749eb

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +17 -4
README.md CHANGED
@@ -19,7 +19,15 @@ pipeline_tag: text-generation
19
 
20
  # Phi-4 RAG (LoRA fine-tuned) — Q4_K_M GGUF
21
 
22
- Quantized **GGUF** build of **Microsoft Phi-4** with a **LoRA** adapter merged in, for **retrieval-augmented question answering**. The model answers **only from supplied document context** in **English, Spanish, or Catalan**, using the same RAG-oriented system prompt as the **MonkeyGrab** project (TFG, Universitat Politècnica de València).
 
 
 
 
 
 
 
 
23
 
24
  ## Files in this repo
25
 
@@ -27,12 +35,17 @@ Quantized **GGUF** build of **Microsoft Phi-4** with a **LoRA** adapter merged i
27
  |------|-------------|
28
  | `Phi4-Q4_K_M.gguf` | Full weights after LoRA merge, **Q4_K_M** quantization (local inference, e.g. Ollama). |
29
  | `Modelfile` | Ollama recipe: ChatML template, system prompt, sampling parameters. |
30
- | `README.md` | This model card (mirrored in the source tree under `models/gguf-output/phi-4/`). |
 
 
 
 
 
31
 
32
  ## Base model and method
33
 
34
  - **Base:** [`microsoft/phi-4`](https://huggingface.co/microsoft/phi-4) (ChatML-style; end-of-turn `<|redacted_im_end|>`).
35
- - **Adaptation:** PEFT **LoRA** → merge into dense weights → **GGUF** export and **Q4_K_M** quantization via the project toolchain (`scripts/conversion/`, llama.cpp binaries).
36
 
37
  ### LoRA configuration
38
 
@@ -63,7 +76,7 @@ Quantized **GGUF** build of **Microsoft Phi-4** with a **LoRA** adapter merged i
63
  - **Dev:** 320 samples per dataset × 5 sources = **1,600** examples (aligned with `scripts/evaluation/evaluate_baselines.py` / `training-output/baseline/` for cross-experiment comparability).
64
  - **Test:** **full** held-out splits (**8,490** examples total across sources).
65
  - **Metrics:** Token F1, ROUGE-L F1, BERTScore F1 (`microsoft/deberta-xlarge-mnli`); BERTScore computed after unloading the generative model.
66
- - **Artifacts:** `training-output/phi-4/evaluation_comparison.json` in the code repo.
67
 
68
  ## Evaluation results
69
 
 
19
 
20
  # Phi-4 RAG (LoRA fine-tuned) — Q4_K_M GGUF
21
 
22
+ Quantized **GGUF** build of **Microsoft Phi-4** with a **LoRA** adapter merged in, for **retrieval-augmented question answering**. The model answers **only from supplied document context** in **English, Spanish, or Catalan**, using the same RAG-oriented system prompt as **MonkeyGrab**, a local RAG stack developed for a **Master’s thesis (TFG) at the Universitat Politècnica de València (UPV)**.
23
+
24
+ ## Source code, thesis, and contact
25
+
26
+ The **full MonkeyGrab application repository is not public yet** (defense / publication timeline). This Hugging Face model repo therefore focuses on **inference weights** (`Phi4-Q4_K_M.gguf`), the **Ollama `Modelfile`**, and a **`reproduction/`** folder with frozen copies of the training script, merge utility, and the exported **`evaluation_comparison.json`** so methodology and metrics remain auditable without implying that the whole codebase is cloneable today.
27
+
28
+ **Contact:** [nadiva1243@gmail.com](mailto:nadiva1243@gmail.com) for questions about training, evaluation, Ollama usage, or when the full repository will be released.
29
+
30
+ **GGUF build (high level):** LoRA merge with the project’s `merge_lora.py` (see `reproduction/`) → export to GGUF (llama.cpp toolchain) → **Q4_K_M** quantize. Exact CLI flags match your local `llama.cpp` build; the merge script documents expected paths.
31
 
32
  ## Files in this repo
33
 
 
35
  |------|-------------|
36
  | `Phi4-Q4_K_M.gguf` | Full weights after LoRA merge, **Q4_K_M** quantization (local inference, e.g. Ollama). |
37
  | `Modelfile` | Ollama recipe: ChatML template, system prompt, sampling parameters. |
38
+ | `README.md` | This model card (mirrored in the author’s source tree under `models/gguf-output/phi-4/` when the repo is published). |
39
+ | `LICENSE` | MIT — applies to model card, `Modelfile`, and files added here by nadiva1243 (not to Microsoft’s base terms). |
40
+ | `reproduction/train-phi4.py` | Snapshot of `scripts/training/train-phi4.py` (v1) used for this adapter. |
41
+ | `reproduction/merge_lora.py` | Snapshot of `scripts/conversion/merge_lora.py` (merge LoRA into dense weights before GGUF export). |
42
+ | `reproduction/evaluation_comparison.json` | Frozen eval export (base vs adapted, dev/test, per dataset + aggregate). |
43
+ | `reproduction/CONVERSION.md` | Short notes linking merge → GGUF → quantization → Ollama. |
44
 
45
  ## Base model and method
46
 
47
  - **Base:** [`microsoft/phi-4`](https://huggingface.co/microsoft/phi-4) (ChatML-style; end-of-turn `<|redacted_im_end|>`).
48
+ - **Adaptation:** PEFT **LoRA** → merge into dense weights → **GGUF** export and **Q4_K_M** quantization via **merge + llama.cpp** (script snapshots under **`reproduction/`** on this Hub mirror the project’s `scripts/conversion/` layout).
49
 
50
  ### LoRA configuration
51
 
 
76
  - **Dev:** 320 samples per dataset × 5 sources = **1,600** examples (aligned with `scripts/evaluation/evaluate_baselines.py` / `training-output/baseline/` for cross-experiment comparability).
77
  - **Test:** **full** held-out splits (**8,490** examples total across sources).
78
  - **Metrics:** Token F1, ROUGE-L F1, BERTScore F1 (`microsoft/deberta-xlarge-mnli`); BERTScore computed after unloading the generative model.
79
+ - **Artifacts:** metrics and sample pairs are in **`reproduction/evaluation_comparison.json`** on this Hub repo (and will live under `training-output/phi-4/` in the future public codebase).
80
 
81
  ## Evaluation results
82