nassimjp/nazo-istadlal-beta
Viewer • Updated • 45.5k • 725 • 1
How to use nassimjp/Nazo-LFM3-1.7B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="nassimjp/Nazo-LFM3-1.7B", trust_remote_code=True)
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("nassimjp/Nazo-LFM3-1.7B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("nassimjp/Nazo-LFM3-1.7B", trust_remote_code=True, device_map="auto")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use nassimjp/Nazo-LFM3-1.7B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "nassimjp/Nazo-LFM3-1.7B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nassimjp/Nazo-LFM3-1.7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/nassimjp/Nazo-LFM3-1.7B
How to use nassimjp/Nazo-LFM3-1.7B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "nassimjp/Nazo-LFM3-1.7B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nassimjp/Nazo-LFM3-1.7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "nassimjp/Nazo-LFM3-1.7B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "nassimjp/Nazo-LFM3-1.7B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use nassimjp/Nazo-LFM3-1.7B with Docker Model Runner:
docker model run hf.co/nassimjp/Nazo-LFM3-1.7B
# Nazo-LFM3-1.7B
A Pashto-focused instruction-tuned model for vocabulary understanding, semantic interpretation, and linguistic reasoning, built on LiquidAI/LFM3-1.7B.
## Model Details
- **Developed by:** nassimjp
- **License:** apache-2.0
- **Finetuned from model:** LiquidAI/LFM3-1.7B
- **Model size:** 1.7B parameters
- **Precision:** 16-bit (FP16)
- **Training data:** [nassimjp/nazo-istadlal-beta](https://huggingface.co/datasets/nassimjp/nazo-istadlal-beta) (single-turn samples only; 40,320 rows, ~239 MB)
- **Training framework:** [Unsloth](https://github.com/unslothai/unsloth) + Hugging Face TRL
- **Languages:** Pashto (ps), English (en)
## Intended Use
Nazo-LFM3-1.7B is intended as a **drafting and explanation aid** for Pashto vocabulary, terminology, semantics, and linguistic reasoning. It is best suited for:
- Single-turn Pashto word/term definition and explanation.
- Pashto vocabulary and collocation lookup with contextual examples.
- Drafting child-friendly explanations of Pashto terms.
- Instruction-following in Pashto on well-scoped, self-contained questions.
- Research on low-resource Pashto NLP and instruction tuning.
It is **not** recommended as an autonomous source of authoritative Pashto grammar rules or example sentences without native-speaker verification (see Limitations).
## Evaluation Summary
The model was evaluated through (a) a long multi-turn Pashto grammar conversation covering interrogative pronouns, relative pronouns, pronominal clitics, and the possessive «خپل», and (b) a single-turn terminology query on the Pashto letter «ښ».
**Observed strengths**
- Produces well-structured, sectioned Pashto explanations with headings and bullet lists.
- Correctly recalls core rules when they are in-context or supplied: direct vs. oblique case (څوک / چا), count vs. mass interrogatives (څو / څومره), place vs. time vs. reason vs. manner adverbs (چېرې / کله / ولې / څنګه).
- Acknowledges corrections and revises terminology (e.g., «خپل» as a possessive pronoun, not a "suffix pronoun").
- On a self-contained single-turn definitional query, produces usable, mostly accurate Pashto.
**Observed weaknesses**
- **Example-sentence validity:** repeatedly generates ungrammatical or meaningless example sentences and labels them as correct (e.g., «چا راغلل؟», «پر چک باندې څښتې», «هغه خپله کور ته ځي»).
- **Contradictory self-correction:** in the same turn, labels a sentence both "wrong" and "correct."
- **Multi-turn consistency:** under correction pressure, introduces new meaningless examples and meta-commentary that contradicts earlier turns; does not reliably converge.
- **Invented terminology:** produces non-standard terms that must be corrected externally.
- **Phonetic/orthographic imprecision:** single-turn «ښ» answer is broadly correct but imprecise on articulation and does not flag dialect variation.
**Interpretation:** quality is substantially higher on **single-turn** tasks than on **multi-turn revision/self-audit** tasks. This is consistent with the training set containing single-turn samples only. The dominant failure mode — meaningless examples surviving correction — is the highest-leverage target for the next data iteration.
## Limitations
- **Single-turn training distribution.** The model has no learned policy for multi-turn correction, deletion of bad examples, or consistency across turns.
- **Example generation is unreliable.** Generated Pashto example sentences must be verified by a native speaker before use.
- **No dialect tagging.** The model does not distinguish southern vs. northern Pashto realizations (e.g., /ʂ/ ~ /ʃ/ ~ /x/ for ښ) and may present one realization as universal.
- **Not a grammar authority.** Rule statements and terminology should be cross-checked against a standard Pashto grammar reference.
- **Reasoning traces.** Some training samples include `<think>` sections; downstream users should inspect and decide whether to retain or strip them.
## Training Procedure
This LFM3 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face's TRL library.
- **Base model:** LiquidAI/LFM3-1.7B
- **Fine-tuning data:** nassimjp/nazo-istadlal-beta
- **Output precision:** FP16
- **Data format:** JSONL conversational samples (`messages` with system/user/assistant roles; `meta` with generation fields)
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "nassimjp/Nazo-LFM3-1.7B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="float16",
device_map="auto",
)
messages = [
{"role": "system", "content": "ته د پښتو ژبې یو ماهر او مسلکي ډیجیټل مرستیال یې."},
{"role": "user", "content": "د 'ښ' توری څه مانا لري او له عربي 'ش' سره یې توپیر څه دی؟"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.6,
top_p=0.9,
)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
<think> traces deliberately depending on whether reasoning output is desired.nazo-istadlal-beta, a quality protocol, and the single-turn limitation.@misc{nazo_lfm3_1_7b,
author = {Nassim (nassimjp)},
title = {Nazo-LFM3-1.7B},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/nassimjp/Nazo-LFM3-1.7B}},
note = {Fine-tuned from LiquidAI/LFM3-1.7B on nassimjp/nazo-istadlal-beta}
}