Update README.md
Browse files12345678910---base_model: unsloth/llama-3.2-1b-bnb-4bittags:- text-generation-inference- transformers- llamalicense: apache-2.0language:- en---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115# Expanded README with heavy focus on technical architecture and Hebrew linguistic nuancesbig_readme_content = """---language:- he- enlicense: llama3.2base_model: meta-llama/Llama-3.2-1B-Instructtags:- llama-3.2- hebrew- instruction-tuned- sft- safetensors- nlpmodel_name: Hebrew-GPTmodel_type: causal-lmprecision: bfloat16---# Hebrew-GPT: Specialized 1B Hebrew Instruction Model 馃嚠馃嚤**Hebrew-GPT** is a state-of-the-art, instruction-tuned Small Language Model (SLM) based on the **Llama-3.2-1B** architecture. It has been engineered to bridge the gap in low-parameter Hebrew linguistic performance, providing a compact yet powerful solution for Hebrew natural language understanding and generation.---## 馃拵 Model Highlights* **Linguistic Specialization:** Specifically tuned to handle the Morphologically Rich Language (MRL) features of Hebrew, including prefix-suffix handling and correct right-to-left (RTL) context awareness.* **16-bit Precision:** Unlike many quantized small models, this version features **Full Merged BFloat16 weights**, ensuring no loss of intelligence from the fine-tuning process.* **Instruction Optimized:** Trained specifically to follow complex prompts, summarize documents, and engage in dialogue, rather than just basic text completion.* **Efficiency:** At 1 billion parameters, it is optimized for edge deployment, providing high-speed inference on standard consumer hardware.---## 馃洜 Technical Specifications### Architecture- **Base Architecture:** Llama 3.2- **Parameters:** 1.23 Billion- **Context Length:** 128k tokens (native support)- **Weight Format:** Safetensors (Standalone)- **Precision:** BFloat16 ($BF16$)### Training MethodologyThe model underwent **Supervised Fine-Tuning (SFT)** using a curated multi-source dataset strategy to ensure high-quality Hebrew output without compromising logical reasoning:* **Hebrew Instruction Set (70%):** Extensive Alpaca-formatted datasets translated and corrected for Hebrew grammar.* **Hebrew Contextual Knowledge (20%):** Fact-based data from Hebrew wikis and structured Q&A.* **Logic Preservation (10%):** High-quality English instructional data to maintain cross-lingual reasoning and mathematical stability.---## 馃搱 Performance & MonitoringDuring the development phase, the model was monitored via detailed telemetry to ensure stable convergence. Key metrics tracked included:- **Gradient Norm Stability:** Monitored to prevent exploding gradients in RTL text generation.- **VRAM Optimization:** Efficiently managed to maximize batch size and learning stability.- **Loss Decay:** Consistent downward trend in cross-entropy loss across all three data streams.---## 馃殌 Quick Start Guide### Installation```bashpip install transformers torch accelerate```### Basic Usage (Python)```import torchfrom transformers import AutoModelForCausalLM, AutoTokenizermodel_id = "XythicK/Hebrew-GPT"# Load model and tokenizertokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id,torch_dtype=torch.bfloat16,device_map="auto")# Standard Llama-3.2 Chat Templatemessages = [{"role": "system", "content": "讗转讛 注讜讝专 讞讻诐 讜诪拽爪讜注讬 讘注讘专讬转."},{"role": "user", "content": "讻转讜讘 诇讬 诪转讻讜谉 拽爪专 诇讞诇讛 诇砖讘转."},]input_ids = tokenizer.apply_chat_template(messages,add_generation_prompt=True,return_tensors="pt").to(model.device)outputs = model.generate(input_ids,max_new_tokens=256,do_sample=True,temperature=0.7,top_p=0.9,)print(tokenizer.decode(outputs[0], skip_special_tokens=True))```### 鈿栵笍 Ethics and LimitationsWhile Hebrew-GPT is highly capable for its size, users should note:Hallucination: Like all LLMs, it can generate incorrect facts. Verify critical information.Bias: The model reflects the biases present in its training data.Parameter Constraints: As a 1B model, it may struggle with highly technical academic subjects compared to 70B+ models.
README.md+113-8