初始化项目,由ModelHub XC社区提供模型
Model: AhiskaAI/AhiskaAI-65m-IT-v0.1 Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
*.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
|
||||||
100
README.md
Normal file
100
README.md
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
language:
|
||||||
|
- tr
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
tags:
|
||||||
|
- llama
|
||||||
|
- slm
|
||||||
|
- alpaca
|
||||||
|
- instruction-tuning
|
||||||
|
- causal-lm
|
||||||
|
- tr-llm
|
||||||
|
- Ahıska
|
||||||
|
- AhiskaTurks
|
||||||
|
- MeskhetianTurks
|
||||||
|
- AhıskaTürkleri
|
||||||
|
datasets:
|
||||||
|
- custom-filtered-turkish-alpaca
|
||||||
|
library_name: transformers
|
||||||
|
---
|
||||||
|
|
||||||
|
# AhiskaAI 65m IT v0.1 (Instruction Tuned)
|
||||||
|
|
||||||
|
**AhiskaAI 65m IT v0.1** is a highly efficient, custom-aligned Small Language Model (SLM) for the Turkish language ecosystem.
|
||||||
|
|
||||||
|
This model was NOT fine-tuned on top of generic open-source weights. Instead, it was instruction-tuned directly over our proprietary foundation model, **AhıskaAI 65m Base v0.1** (which was pre-trained from scratch for 1 full epoch on a 5.3 GB Turkish corpus). For this alignment phase (SFT), we utilized a strictly **filtered and curated Turkish Alpaca dataset** to maximize procedural logic, formatting accuracy, and structural fluidity while eliminating noisy data tokens.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧬 The Pipeline: From Scratch to Instruction
|
||||||
|
|
||||||
|
Our research lab follows a strict vertical integration philosophy:
|
||||||
|
1. **Phase 1 (Base Model):** Initialized `LlamaForCausalLM` from zero variables. Pre-trained on 5.3 GB of clean Turkish text matrix to lock down grammar, token-nesting patterns, and core semantics (**AhıskaAI 65m Base v0.1**).
|
||||||
|
2. **Phase 2 (Instruction Tuning):** Supervised Fine-Tuning (SFT) over the base checkpoint using our custom-filtered Alpaca instructions. This phase injected formatting discipline, listing mechanics (`1. 2. 3.`), and multi-turn response compliance.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Technical Architecture & Hyperparameters
|
||||||
|
|
||||||
|
Directly extracted from the native `config.json`, the model utilizes a pure modern LLaMA layout optimized for fast local compute:
|
||||||
|
|
||||||
|
* **Architecture:** `LlamaForCausalLM`
|
||||||
|
* **Parameters:** ~65 Million
|
||||||
|
* **Context Length (`max_position_embeddings`):** 1024 tokens (Double the capacity of legacy GPT-2 baselines)
|
||||||
|
* **Vocabulary Size:** 32,000 tokens (Custom BPE trained for Turkish root-suffix morphology)
|
||||||
|
* **Hidden Dimension (`hidden_size`):** 512
|
||||||
|
* **Intermediate Layer Dimension (`intermediate_size`):** 1376
|
||||||
|
* **Hidden Layers (`num_hidden_layers`):** 12
|
||||||
|
* **Attention Heads:** 8 (`num_attention_heads` / `num_key_value_heads`)
|
||||||
|
* **Activation Function:** SiLU (`silu`)
|
||||||
|
* **Normalization EPS:** `rms_norm_eps: 1e-06` (RMSNorm architecture)
|
||||||
|
* **Positional Embeddings:** RoPE (`rope_type: default`, theta: 10000.0)
|
||||||
|
* **Data Precision:** `float32`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💻 Hardware Efficiency & "Build in Public"
|
||||||
|
|
||||||
|
* **Training & Alignment Hardware:** NVIDIA GeForce RTX 4050 Laptop GPU (6GB VRAM)
|
||||||
|
* **Inference Footprint:** Merely **~202 MB** in size! It runs at lightning-fast tokens-per-second even on **Hugging Face Free CPU Spaces**, bypassing the need for expensive cloud GPU hosting.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠️ Quickstart Usage (Alpaca Format)
|
||||||
|
|
||||||
|
To interact with the instruction-tuned layer smoothly, invoke the model with the exact token structure it was aligned with:
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import LlamaForCausalLM, AutoTokenizer
|
||||||
|
import torch
|
||||||
|
|
||||||
|
model_name = "AhiskaAI/AhiskaAI-65m-IT-v0.1"
|
||||||
|
|
||||||
|
# Load the custom-built architecture and vocabulary
|
||||||
|
model = LlamaForCausalLM.from_pretrained(model_name).to("cuda" if torch.cuda.is_available() else "cpu")
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||||
|
|
||||||
|
def ask_ahiska_it(instruction):
|
||||||
|
# Strict Alpaca Template
|
||||||
|
prompt = f"<|im_start|>user\n{user_input}<|im_end|>\n<|im_start|>assistant\n"
|
||||||
|
|
||||||
|
|
||||||
|
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
||||||
|
|
||||||
|
with torch.no_grad():
|
||||||
|
outputs = model.generate(
|
||||||
|
**inputs,
|
||||||
|
max_length=250,
|
||||||
|
do_sample=True,
|
||||||
|
top_k=40,
|
||||||
|
top_p=0.92,
|
||||||
|
temperature=0.55, # Low temp keeps the 65m nodes highly focused
|
||||||
|
repetition_penalty=1.18
|
||||||
|
)
|
||||||
|
|
||||||
|
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
||||||
|
return response.split("### Response:\n")[-1].strip()
|
||||||
|
|
||||||
|
# Run a test inference
|
||||||
|
print(ask_ahiska_it("Sağlıklı yaşamak için 3 ipucu ver"))
|
||||||
32
config.json
Normal file
32
config.json
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"LlamaForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_bias": false,
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 5,
|
||||||
|
"dtype": "float32",
|
||||||
|
"eos_token_id": 6,
|
||||||
|
"head_dim": 64,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 512,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 1376,
|
||||||
|
"max_position_embeddings": 1024,
|
||||||
|
"mlp_bias": false,
|
||||||
|
"model_type": "llama",
|
||||||
|
"num_attention_heads": 8,
|
||||||
|
"num_hidden_layers": 12,
|
||||||
|
"num_key_value_heads": 8,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"pretraining_tp": 1,
|
||||||
|
"rms_norm_eps": 1e-06,
|
||||||
|
"rope_parameters": {
|
||||||
|
"rope_theta": 10000.0,
|
||||||
|
"rope_type": "default"
|
||||||
|
},
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"transformers_version": "5.5.0",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 32000
|
||||||
|
}
|
||||||
10
generation_config.json
Normal file
10
generation_config.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 5,
|
||||||
|
"eos_token_id": 6,
|
||||||
|
"output_attentions": false,
|
||||||
|
"output_hidden_states": false,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"transformers_version": "5.5.0",
|
||||||
|
"use_cache": true
|
||||||
|
}
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:ed690ed3882594f8aa98c2d825a039586daa4f9add3308687890801322dc2200
|
||||||
|
size 282916896
|
||||||
159231
tokenizer.json
Normal file
159231
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
9
tokenizer_config.json
Normal file
9
tokenizer_config.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"backend": "tokenizers",
|
||||||
|
"bos_token": "<|im_start|>",
|
||||||
|
"eos_token": "<|im_end|>",
|
||||||
|
"is_local": true,
|
||||||
|
"model_max_length": 1000000000000000019884624838656,
|
||||||
|
"pad_token": "[PAD]",
|
||||||
|
"tokenizer_class": "TokenizersBackend"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user