CoolFace
Modelpublic

solvrays/solvrays-finetuned-pdf

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes21downloads
README.md71 linesDownload Raw Back to root
1---2base_model: google/gemma-2b-it3language: en4library_name: transformers5license: apache-2.06pipeline_tag: text-generation7tags:8- precision-grounding9- document-qa10- zero-hallucination11- legal-tech12- technical-analysis13---14 15# ๐Ÿ“‚ Solvrays Finetuned Pdf - Document AI16 17## ๐ŸŒŸ Model Overview18This model is a high-precision fine-tuning of **google/gemma-2b-it**, specifically architected for **Zero-Hallucination Technical Retrieval**. It has been trained on a proprietary dataset of technical and architectural documentation to ensure deep contextual grounding.19 20### ๐Ÿš€ Key Capabilities21- **Technical Grounding**: Prioritizes factual documentation over generative speculation.22- **Chunk-Aware Memory**: Optimized for overlapping document segments (256-token window).23- **Deterministic Precision**: Best used with `do_sample=False` for architectural accuracy.24 25## ๐Ÿ’ป Professional Implementation26The model requires specific prompt construction to trigger its 'Knowledge Retrieval' mode:27 28```python29from transformers import AutoTokenizer, AutoModelForCausalLM30import torch31 32model_id = 'solvrays/solvrays-finetuned-pdf'33tokenizer = AutoTokenizer.from_pretrained(model_id)34model = AutoModelForCausalLM.from_pretrained(35    model_id, 36    device_map='auto', 37    torch_dtype=torch.bfloat16, 38    quantization_config={'load_in_4bit': True}39)40 41def query_model(user_query):42    # High-Precision Retrieval Template43    prompt = f'### Knowledge Retrieval Content: {user_query}\n### Verified Response: '44    inputs = tokenizer(prompt, return_tensors='pt').to(model.device)45    outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)46    return tokenizer.decode(outputs[0], skip_special_tokens=True).split('### Verified Response:')[-1].strip()47```48 49## ๐Ÿ“Š Technical Specifications50| Feature | Configuration |51| :--- | :--- |52| **Base Model** | google/gemma-2b-it |53| **Precision** | BrainFloat16 (BF16) |54| **Fine-tuning** | QLoRA (4-bit Normalized Float) |55| **LoRA Rank (r)** | 16 |56| **LoRA Alpha** | 32 |57| **Target Modules** | q, k, v, o, gate, up, down |58| **Training Epochs** | 25 |59 60## ๐Ÿ›  Training Environment61- **Hardware**: NVIDIA L4 x 2 (Dual GPU Architecture)62- **Optimizer**: Paged AdamW 8-bit63- **Context Length**: 256 tokens per block64 65## โš ๏ธ Constraints & Risk Mitigation66- **Out-of-Scope**: This model is not intended for general conversation or creative writing. It is a specialized document analyst.67- **Hallucination Control**: If information is not present in the internal weights, the model is trained to state 'Not Documented' or provide an empty response for verification.68- **Numerical Accuracy**: Always cross-verify critical measurements with original PDF source material.69 70---71**Senior AI Architect & Developer**: Solvrays