/ Модель

Характеристики

Контекст
512 токенов
Лицензия
Своя лицензия
Архитектура
sinhala_gpt_instruct · dense
Базовая модель
SinhalaLM-V.0.0.1
Опубликована
4 окт 2026

SinhalaLM-V.0.0.1-it

Ответы на вопросыТекст → текст

Компактная модель HelaAI, дообученная для ответов на вопросы на сингальском языке по заданному шаблону.

60скачиваний за 30 дней0лайковвеса обновлены7 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

SinhalaLM — Instruct — модель HelaAI для ответов на вопросы на сингальском языке. Это GPT-подобный декодерный трансформер с архитектурой SinhalaLM, дообученный целиком на парах вопросов и ответов на сингальском языке. Модель содержит около 44,7 млн параметров, использует RoPE, блоки SwiGLU и собственный BPE-токенизатор; её архитектура нестандартна и требует определения модели из репозитория, а не стандартного класса transformers AutoModel.

Модель предназначена для одношагового ответа на вопрос: запрос оформляется по заданному шаблону, после чего модель генерирует ответ на сингальском без примеров в контексте. Подходит для прототипирования и применения в компактных NLP-конвейерах для сингальского языка. Репозиторий закрытый, доступ предоставляется только явно разрешённым аккаунтам. Лицензия указана как other.

Ограничения: контекст вместе с ответом не должен превышать 512 токенов; модель обучалась на небольшом наборе данных и может выдавать неточные ответы, особенно вне обучающего распределения. Она рассчитана на сингальский язык и одиночные вопросы по фиксированному шаблону, не предназначена для многоходового диалога или высокорисковых решений; фильтрация безопасности не применялась.

Сценарии применения

  • ответы на вопросы на сингальском языке
  • создание прототипа сингальского QA-сервиса
  • встраивание ответов на сингальском в NLP-конвейер
  • эксперименты с компактными языковыми моделями для сингальского

Ограничения

Контекст запроса и ответа ограничен 512 токенами; из-за небольшого обучающего набора ответы могут быть неточными. Модель предназначена для одношаговых запросов на сингальском в фиксированном формате, не имеет фильтрации безопасности и не подходит для высокорисковых решений.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

🇱🇰 SinhalaLM — Instruct

A fully fine-tuned, instruction-following Sinhala question-answering model

SinhalaLM-Instruct · by HelaAI

Language Framework License Status Params Task


📑 Table of contents


🔎 Overview

SinhalaLM — Instruct is an instruction-tuned, question-answering variant of SinhalaLM, a GPT-style decoder-only transformer built from scratch for the Sinhala language. It combines the same core architectural ingredients as the base model — Rotary Position Embeddings (RoPE), SwiGLU gated feed-forward blocks, and a custom Sinhala byte-pair encoding (BPE) tokenizer — with full fine-tuning on a Sinhala question-answer dataset, so that every parameter in the model (not just a low-rank adapter subset) adapts to the instruction-following QA task.

Given a Sinhala question wrapped in a fixed instruction template, the model generates a Sinhala answer directly, without requiring any few-shot examples at inference time.

This is a custom architecture — it is not a standard transformers (AutoModel) class. The full model definition, tokenizer, and prompt-building utilities ship in this repository as modeling_sinhalalm.py and must be imported directly (see How to use below).

⚠️ Private repository. Only Hugging Face accounts explicitly granted access can pull this repo. Do not share the access token.


🔗 Relationship to the base model

SinhalaLM — Instruct is obtained by fully fine-tuning the private base checkpoint ChamaraVishwajithRajapaksha/SinhalaLM-V.0.0.1 — a GPT-style Sinhala language model pretrained from scratch — on Sinhala question-answer data. "Full" fine-tuning means every weight in the network is updated during this stage, rather than freezing the backbone and training a small set of adapter parameters (e.g. LoRA). This is practical here specifically because the base model is small (tens of millions, not billions, of parameters), which keeps full fine-tuning affordable on a single GPU while still letting every layer specialize to the QA task.

Base modelChamaraVishwajithRajapaksha/SinhalaLM-V.0.0.1
Adaptation methodFull fine-tuning (all parameters updated)
TaskSinhala instruction-following question answering
Fine-tuning dataChamaraVishwajithRajapaksha/sinhala-question-answer-pairs, ihalage/sinhala-finetune-qa-eli5

📝 Prompt template (Alpaca-style, Sinhala)

The model was fine-tuned on prompts built like this — use the exact same format at inference time, and stop generating at <EOS>:

පහත ප්‍රශ්නයට සිංහලෙන් පිළිතුරු දෙන්න.

### ප්‍රශ්නය:
<your question here>

### පිළිතුර:
<model completes from here>

Loss was masked during training so that only the answer tokens (after ### පිළිතුර:) contributed to the loss — the model was never trained to reproduce the question or the system instruction header, only to continue them with an appropriate answer.


🏗️ Architecture

SinhalaLM — Instruct inherits its decoder-only transformer architecture directly from the SinhalaLM base model.

ComponentDesign choice
Parameters~44.7M
Embedding dim512
Attention heads8
Transformer layers8
Context length512 tokens
Vocabulary size15,000
Position encodingRotary (RoPE)
Feed-forwardSwiGLU (gated activation)
NormalizationRMSNorm (pre-norm)
Weight tyingInput token embedding tied to the output LM head

Note: the instruct checkpoint's parameter count (~44.7M) is larger than the base model's (~32.9M); the additional parameters come from task-specific components added during fine-tuning on top of the shared transformer backbone.


🎯 Fine-tuning

DatasetChamaraVishwajithRajapaksha/sinhala-question-answer-pairs / ihalage/sinhala-finetune-qa-eli5
Question columninput
Answer columntarget
Adaptation methodFull fine-tuning (all parameters trainable)
Prompt templateAlpaca-style, Sinhala system header
Loss maskingYes — answer tokens only
Training steps447
Final train loss2.254163
Final validation loss2.381392
Best validation loss2.381392
Best perplexity10.82

Full fine-tuning curves and a CSV/JSON breakdown are provided in analytics/. Example generations from the fine-tuning run are in sample_generations.txt (if included in this repo).


🚀 How to use

Install dependencies:

pip install torch huggingface_hub safetensors

Download, load, and ask a question:

from huggingface_hub import snapshot_download
import torch, json, sys

# 1. Download the repo (private — requires a token with read access)
local_dir = snapshot_download(repo_id="ChamaraVishwajithRajapaksha/SinhalaLM-V.0.0.1-it", token="YOUR_HF_TOKEN")

# 2. Import the model + tokenizer classes shipped in this repo
sys.path.insert(0, local_dir)
from modeling_sinhalalm import SinhalaGPT, FastBPETokenizer, build_prompt, get_prompt_prefix

# 3. Load config
config = json.load(open(f"{local_dir}/config.json"))

# 4. Load tokenizer
tokenizer = FastBPETokenizer.load(f"{local_dir}/bpe_vocabulary.json")

# 5. Build model + load fine-tuned weights
from safetensors.torch import load_file
state_dict = load_file(f"{local_dir}/model.safetensors")

model = SinhalaGPT(
    vocab_size=config["vocab_size"],
    embed_dim=config["n_embed"],
    n_heads=config["n_heads"],
    n_layers=config["n_layers"],
    block_size=config["block_size"],
    dropout=0.0,  # no dropout at inference
)
model.load_state_dict(state_dict)
model.eval()

# 6. Ask a question using the exact fine-tuning prompt template
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)

question = "ශ්‍රී ලංකාවේ අගනුවර කුමක්ද?"
prefix = get_prompt_prefix(question)
ids = [tokenizer.stoi.get("<BOS>", 2)] + tokenizer.encode(prefix)
ctx = torch.tensor([ids], dtype=torch.long, device=device)

out = model.generate(ctx, max_new_tokens=200, temperature=0.7, top_k=50)
answer_ids = out[0, len(ids):].tolist()
print(tokenizer.decode(answer_ids))

Generation parameters

ParameterEffect
temperatureLower (e.g. 0.5–0.7) → more focused, deterministic answers. Higher (e.g. 1.0+) → more varied/creative phrasing.
top_kRestricts sampling to the k most likely tokens at each step. Lower = safer, less diverse.
max_new_tokensNumber of answer tokens to generate. Total context (prompt + answer) is capped at 512 tokens.

⚠️ Always build the prompt with get_prompt_prefix() (or the exact template shown above) — deviating from the fine-tuning prompt format will noticeably degrade answer quality, since the model was only trained to continue that specific structure.


🎯 Intended use

SinhalaLM — Instruct is intended for Sinhala question answering in research and prototyping contexts — e.g. exploring compact, from-scratch, instruction-tuned models for a low-resource language, or as a lightweight QA component in a larger Sinhala NLP pipeline.

Not intended for:

  • ❌ Production deployment without further evaluation, safety review, and human oversight.
  • ❌ High-stakes factual use (medical, legal, financial, or safety-critical questions) — answers are not verified or fact-checked.
  • ❌ Multi-turn dialogue or open-ended chat — the model is fine-tuned specifically for single-turn question → answer completion in the prompt format above.
  • ❌ Any use requiring inputs/outputs longer than 512 tokens total.

⚠️ Limitations and biases

  • Fine-tuned on a relatively small QA dataset (447 training steps) — coverage of topics outside the fine-tuning distribution may be shallow or inaccurate.
  • As with any fine-tuned language model, answers may be fluent but factually incorrect ("hallucinated") — always verify important claims independently.
  • Inherits any biases present in both the base pretraining corpus and the QA fine-tuning data.
  • Context window is limited to 512 tokens (prompt + answer combined).
  • Strict reliance on the exact prompt template — inputs that deviate from the trained format may produce degraded or off-format answers.
  • No safety filtering or content moderation has been applied to outputs.
  • Monolingual (Sinhala) by design — not intended for multilingual or code-switched input.

📁 Files in this repo

FileDescription
model.safetensorsFine-tuned model weights
config.jsonArchitecture + fine-tuning config
bpe_vocabulary.jsonFull tokenizer (vocab + merges + priorities) — load with FastBPETokenizer.load(...)
vocab.json, merges.txt, tokenizer.json, tokenizer_config.json, special_tokens_map.jsonHF-style tokenizer files (informational; the authoritative loader is FastBPETokenizer)
modeling_sinhalalm.pyFull source of the model, tokenizer, and prompt-template functions (SinhalaGPT, FastBPETokenizer, build_prompt, get_prompt_prefix)
images/sinhalalm_detailed_architecture.svgDetailed architecture diagram of a single SinhalaLM decoder block
sample_generations.txtExample Q&A generations from the fine-tuning run (if present)
analytics/Fine-tuning loss / validation / learning-rate / perplexity graphs, CSVs, and a text + JSON summary

📜 License

This model is released under a custom/other license. Update this section with your actual terms (e.g. permitted uses, redistribution, commercial use) before granting access to others.


📚 Citation

If you use this model, please cite:

@misc{sinhalalminstruct,
  title  = {SinhalaLM -- Instruct},
  author = {Chamara Vishwajith and Dr. Kushan Sudheera and Dineth Jayakody},
  year   = {2026},
  note   = {Instruction-tuned, fully fine-tuned Sinhala question-answering model, built on the SinhalaLM base checkpoint}
}

📬 Contact

Developed by HelaAI. For questions or access requests, contact one of the authors of the base SinhalaLM model, or the repository owner on Hugging Face.

—— SinhalaLM · Instruct · HelaAI ——

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · question-answering

Нельзя запустить

Архитектура sinhala_gpt_instruct неизвестна transformers в образе рантайма.

Класс архитектуры
SinhalaLM
Ревизия весов
f3b1f5d

0 моделей