From cfa5259fb328402e5ca58eaa9995524f2d039385 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Sat, 29 Aug 2026 17:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: Flexan/DoodDood-TOMAGPT-GGUF Source: Original Platform --- .gitattributes | 49 ++++++++++++++ README.md | 161 ++++++++++++++++++++++++++++++++++++++++++++ TOMAGPT.IQ3_M.gguf | 3 + TOMAGPT.IQ3_S.gguf | 3 + TOMAGPT.IQ4_XS.gguf | 3 + TOMAGPT.Q2_K.gguf | 3 + TOMAGPT.Q3_K_L.gguf | 3 + TOMAGPT.Q3_K_M.gguf | 3 + TOMAGPT.Q3_K_S.gguf | 3 + TOMAGPT.Q4_K_M.gguf | 3 + TOMAGPT.Q4_K_S.gguf | 3 + TOMAGPT.Q5_K_M.gguf | 3 + TOMAGPT.Q5_K_S.gguf | 3 + TOMAGPT.Q6_K.gguf | 3 + TOMAGPT.Q8_0.gguf | 3 + TOMAGPT.f16.gguf | 3 + 16 files changed, 252 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 TOMAGPT.IQ3_M.gguf create mode 100644 TOMAGPT.IQ3_S.gguf create mode 100644 TOMAGPT.IQ4_XS.gguf create mode 100644 TOMAGPT.Q2_K.gguf create mode 100644 TOMAGPT.Q3_K_L.gguf create mode 100644 TOMAGPT.Q3_K_M.gguf create mode 100644 TOMAGPT.Q3_K_S.gguf create mode 100644 TOMAGPT.Q4_K_M.gguf create mode 100644 TOMAGPT.Q4_K_S.gguf create mode 100644 TOMAGPT.Q5_K_M.gguf create mode 100644 TOMAGPT.Q5_K_S.gguf create mode 100644 TOMAGPT.Q6_K.gguf create mode 100644 TOMAGPT.Q8_0.gguf create mode 100644 TOMAGPT.f16.gguf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..59853ce --- /dev/null +++ b/.gitattributes @@ -0,0 +1,49 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +TOMAGPT.f16.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.IQ3_M.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.IQ3_S.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.IQ4_XS.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text +TOMAGPT.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..79b1db0 --- /dev/null +++ b/README.md @@ -0,0 +1,161 @@ +--- +license: apache-2.0 +base_model: DoodDood/TOMAGPT +datasets: + - DoodDood/HearsayGRPOTrainingData2 +tags: + - legal + - hearsay + - classification + - grpo + - reinforcement-learning + - legalbench + - lora +pipeline_tag: text-generation +model-index: + - name: TOMAGPT + results: + - task: + type: text-classification + name: Hearsay Classification + dataset: + name: LegalBench Hearsay + type: nguha/legalbench + split: test + metrics: + - type: accuracy + value: 77.7 + name: Decomposed Accuracy +--- + +# GGUF Files for TOMAGPT + +These are the GGUF files for [DoodDood/TOMAGPT](https://huggingface.co/DoodDood/TOMAGPT). + +## Downloads + +| GGUF Link | Quantization | Description | +| ---- | ----- | ----------- | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q2_K.gguf) | Q2_K | Lowest quality | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q3_K_S.gguf) | Q3_K_S | | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.IQ3_S.gguf) | IQ3_S | Integer quant, preferable over Q3_K_S | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.IQ3_M.gguf) | IQ3_M | Integer quant | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q3_K_M.gguf) | Q3_K_M | | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q3_K_L.gguf) | Q3_K_L | | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.IQ4_XS.gguf) | IQ4_XS | Integer quant | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q4_K_S.gguf) | Q4_K_S | Fast with good performance | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q4_K_M.gguf) | Q4_K_M | **Recommended:** Perfect mix of speed and performance | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q5_K_S.gguf) | Q5_K_S | | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q5_K_M.gguf) | Q5_K_M | | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q6_K.gguf) | Q6_K | Very good quality | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.Q8_0.gguf) | Q8_0 | Best quality | +| [Download](https://huggingface.co/Flexan/DoodDood-TOMAGPT-GGUF/resolve/main/TOMAGPT.f16.gguf) | f16 | Full precision, don't bother; use a quant | + +## Note from Flexan + +I provide GGUFs and quantizations of publicly available models that do not have a GGUF equivalent available yet. +This process is not yet automated and I download, convert, quantize, and upload them **by hand**, usually for models **I deem interesting and wish to try out**. + +If there are some quants missing that you'd like me to add, you may request one in the community tab. +If you want to request a public model to be converted, you can also request that in the community tab. +If you have questions regarding the model, please refer to the original model repo. + +# TOMAGPT + +A **Qwen3-4B-Instruct-2507** model fine-tuned with GRPO (Group Relative Policy Optimization) to classify legal hearsay by decomposing it into three sub-elements under the U.S. Federal Rules of Evidence. + +## What It Does + +TOMAGPT classifies whether a statement is hearsay by analyzing three sub-elements: + +1. **Assertion** -- Is the statement an assertion? +2. **Out-of-court** -- Was the statement made out of court? +3. **TOMA** -- Is the statement offered to prove the truth of the matter asserted? + +Hearsay = YES only if all three sub-elements are YES. + +## Results + +Evaluated on the [LegalBench hearsay test set](https://huggingface.co/datasets/nguha/legalbench) (94 examples): + +| Metric | Base Model | TOMAGPT | Delta | +|--------|-----------|---------|-------| +| **Overall accuracy** | 71.3% | **77.7%** | +6.4% | +| **TOMA sub-element** | 78.0% | **95.1%** | +17.1% | +| Assertion sub-element | 90.2% | 95.1% | +4.9% | +| Non-verbal hearsay | 33.3% | 83.3% | +50.0% | +| Standard hearsay | 93.1% | 100.0% | +6.9% | +| Non-assertive conduct | 89.5% | 100.0% | +10.5% | + +## Training Details + +- **Method**: GRPO (Group Relative Policy Optimization) +- **Platform**: [Prime Intellect Lab](https://lab.primeintellect.ai) +- **Environment**: `smolclaims/TOMAGPT` (v0.3.0) +- **Base model**: Qwen/Qwen3-4B-Instruct-2507 +- **Training data**: [DoodDood/HearsayGRPOTrainingData2](https://huggingface.co/datasets/DoodDood/HearsayGRPOTrainingData2) (3,140 examples) +- **Steps**: 500 +- **Learning rate**: 1e-5 +- **Batch size**: 128 +- **Rollouts per example**: 16 + +### LoRA Configuration + +- **Rank (r)**: 16 +- **Alpha**: 32 +- **Dropout**: 0.0 +- **Target modules**: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj + +### Reward Functions + +| Function | Weight | Description | +|----------|--------|-------------| +| assertion_reward | 1.5 | +1/-1 on assertion accuracy | +| out_of_court_reward | 1.0 | +1/-1 on out-of-court accuracy | +| toma_reward | 2.0 | +1/-1 on TOMA accuracy | +| consistency_penalty | 1.0 | -0.5 for contradictory outputs | +| format_compliance | 1.0 | -0.25 per missing field | +| constraint_penalty | 1.0 | -0.5 for logical violations | + +## Usage + +```python +from transformers import AutoModelForCausalLM, AutoTokenizer +import torch + +model = AutoModelForCausalLM.from_pretrained( + "DoodDood/TOMAGPT", torch_dtype=torch.bfloat16, device_map="auto") +tokenizer = AutoTokenizer.from_pretrained("DoodDood/TOMAGPT") + +system_prompt = ( + "You are a legal assistant identifying hearsay. Hearsay is defined as " + "an out-of-court statement introduced to prove the truth of the matter " + "asserted.\n\n" + "Respond in EXACTLY this format (semicolon-separated):\n" + "is_hearsay: YES/NO; an_assertion: YES/NO; made_out_of_court: YES/NO; " + "is_for_toma: YES/NO" +) + +scenario = "At trial, the prosecution presents testimony from a police officer who states that a bystander at the scene told him, 'The defendant ran the red light.'" + +messages = [ + {"role": "system", "content": system_prompt}, + {"role": "user", "content": scenario} +] + +text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) +inputs = tokenizer([text], return_tensors="pt").to(model.device) + +with torch.no_grad(): + output = model.generate(**inputs, max_new_tokens=128, do_sample=False) + +response = tokenizer.decode(output[0][len(inputs.input_ids[0]):], skip_special_tokens=True) +print(response) +# Expected: is_hearsay: YES; an_assertion: YES; made_out_of_court: YES; is_for_toma: YES +``` + +## Links + +- **Training data**: [DoodDood/HearsayGRPOTrainingData2](https://huggingface.co/datasets/DoodDood/HearsayGRPOTrainingData2) +- **GRPO environment**: `smolclaims/TOMAGPT` on [Prime Intellect](https://lab.primeintellect.ai) +- **Eval benchmark**: [nguha/legalbench](https://huggingface.co/datasets/nguha/legalbench) (hearsay subset) \ No newline at end of file diff --git a/TOMAGPT.IQ3_M.gguf b/TOMAGPT.IQ3_M.gguf new file mode 100644 index 0000000..10c7292 --- /dev/null +++ b/TOMAGPT.IQ3_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecfc2bd2b750ed79ef21d044875c79f87ab5ffd5300d09489cbb548d5bf2dcea +size 1962894912 diff --git a/TOMAGPT.IQ3_S.gguf b/TOMAGPT.IQ3_S.gguf new file mode 100644 index 0000000..7c544b1 --- /dev/null +++ b/TOMAGPT.IQ3_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c126f00cdaafe634f0ce50ded77dd1a0d0521cc257ca9e6b269cf0412ed79a03 +size 1899529792 diff --git a/TOMAGPT.IQ4_XS.gguf b/TOMAGPT.IQ4_XS.gguf new file mode 100644 index 0000000..02ac735 --- /dev/null +++ b/TOMAGPT.IQ4_XS.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1792ea57d0135390cbcb5c5410c85ec4eb5e2aa8207e7cf9345bedfae78a637f +size 2286315072 diff --git a/TOMAGPT.Q2_K.gguf b/TOMAGPT.Q2_K.gguf new file mode 100644 index 0000000..ba58e23 --- /dev/null +++ b/TOMAGPT.Q2_K.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6417cc56f5b021111a3d81f4e8598b855995bd2ed97b00a235b29743da9a3fe5 +size 1669498432 diff --git a/TOMAGPT.Q3_K_L.gguf b/TOMAGPT.Q3_K_L.gguf new file mode 100644 index 0000000..a10fbf5 --- /dev/null +++ b/TOMAGPT.Q3_K_L.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00aed792a00fb4f3c71d04c0ccd1bb366bd134d8b5e24e9958d55319f8bab6cc +size 2239784512 diff --git a/TOMAGPT.Q3_K_M.gguf b/TOMAGPT.Q3_K_M.gguf new file mode 100644 index 0000000..5481d77 --- /dev/null +++ b/TOMAGPT.Q3_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58c2c03e96662e4dc835139a94fdf86efb86302703bf3487bbf2343384f54e9a +size 2075616832 diff --git a/TOMAGPT.Q3_K_S.gguf b/TOMAGPT.Q3_K_S.gguf new file mode 100644 index 0000000..3ba0848 --- /dev/null +++ b/TOMAGPT.Q3_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9c5acd646d51fdca444bd113d66d92eab1092390e9e1f39fcb5b06dc190034f +size 1886996032 diff --git a/TOMAGPT.Q4_K_M.gguf b/TOMAGPT.Q4_K_M.gguf new file mode 100644 index 0000000..cf7568e --- /dev/null +++ b/TOMAGPT.Q4_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d2810fa4b7ad5b6b04b4e2074aeff6e843eff6952186a9afd23a7ce060dd661 +size 2497279552 diff --git a/TOMAGPT.Q4_K_S.gguf b/TOMAGPT.Q4_K_S.gguf new file mode 100644 index 0000000..260dd2b --- /dev/null +++ b/TOMAGPT.Q4_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c84df91c282e639c289d8d970297aabdadac4869fefbbf10170f8d3a0b10683 +size 2383308352 diff --git a/TOMAGPT.Q5_K_M.gguf b/TOMAGPT.Q5_K_M.gguf new file mode 100644 index 0000000..4bbeac2 --- /dev/null +++ b/TOMAGPT.Q5_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a346bee109b482d84851eacb608c2107c60a505d1817f6a408e2f172cc5a4da +size 2889512512 diff --git a/TOMAGPT.Q5_K_S.gguf b/TOMAGPT.Q5_K_S.gguf new file mode 100644 index 0000000..6ed39c7 --- /dev/null +++ b/TOMAGPT.Q5_K_S.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2922e6c9daa99d7bd71777ba4342b2cb53ce6cc3b89a4628aaead5e307379c4 +size 2823710272 diff --git a/TOMAGPT.Q6_K.gguf b/TOMAGPT.Q6_K.gguf new file mode 100644 index 0000000..afa2332 --- /dev/null +++ b/TOMAGPT.Q6_K.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5938c85b6286037495d025bc5b1654ab9ab65db3448759d25318521b2cb194b9 +size 3306260032 diff --git a/TOMAGPT.Q8_0.gguf b/TOMAGPT.Q8_0.gguf new file mode 100644 index 0000000..73e8560 --- /dev/null +++ b/TOMAGPT.Q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3df3917fb6e978dd28e4c20c1dfb3413fd73be97310973092ded11de09707358 +size 4280404032 diff --git a/TOMAGPT.f16.gguf b/TOMAGPT.f16.gguf new file mode 100644 index 0000000..216ada8 --- /dev/null +++ b/TOMAGPT.f16.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17b86450724f0bf0232f90e9470c4a9cdae4466e835a796b1e13b6b6fc3fbdd6 +size 8051284032