Downloads · 30 days
11
21% of all-time downloads
ZygAI/ZygAI-OSS-2B-Encyclopedia
ZygAI-OSS-2B-Encyclopedia is a text generation model from ZygAI. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A bilingual encyclopedic language model fine-tuned from HuggingFaceTB/SmolLM2-1.7B using LoRA (PEFT). Trained on 200,000+ Wikipedia article paragraphs in Lithuanian and English.
Downloads · 30 days
11
21% of all-time downloads
All-time downloads
53
Public
Repo size
217 MB
Likes
1
Public
Click a slice to open those files.
.safetensors145 MB · 98%
From the Hugging Face model README
A bilingual encyclopedic language model fine-tuned from HuggingFaceTB/SmolLM2-1.7B using LoRA (PEFT). Trained on 200,000+ Wikipedia article paragraphs in Lithuanian and English.
This is part of the ZygAI Open Source initiative by ZygMediaGroup — an ongoing effort to build locally-runnable AI models for the Lithuanian language.
do_sample=False to maximise factual accuracyfrom transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
BASE_MODEL = "HuggingFaceTB/SmolLM2-1.7B"
PEFT_MODEL = "ZygAI/ZygAI-OSS-2B-Encyclopedia"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
model = AutoModelForCausalLM.from_pretrained(BASE_MODEL, torch_dtype=torch.float16)
model = PeftModel.from_pretrained(model, PEFT_MODEL)
model.eval()
prompt = "Vilnius is the capital of Lithuania, which"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=150,
do_sample=False,
repetition_penalty=1.3,
no_repeat_ngram_size=3,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Clone and run the full demo interface on your own machine:
# Clone the Space repository
git clone https://huggingface.co/spaces/ZygAI/ZygAI-Encyclopedia-2B-DEMO
cd ZygAI-Encyclopedia-2B-DEMO
# Create and activate a Python virtual environment
python -m venv env
source env/bin/activate # Windows: env\Scripts\activate
# Install dependencies and launch
pip install -r requirements.txt
python app.py
docker run -it -p 7860:7860 --platform=linux/amd64 --gpus all \
registry.hf.space/zygai-zygai-encyclopedia-2b-demo:latest python app.py
Note: Review the Space code before running locally. GPU (
--gpus all) is optional — the app falls back to CPU automatically.
This model is designed for encyclopedic text continuation — given a factual opening phrase, it continues in the same structured, neutral style. It works best with prompts that are:
Example prompts:
Albert Einstein was a physicist whoVilnius yra Lietuvos sostinė, kuriThe Battle of Grunwald took place inKauno pilis yra vienas seniausių| Property | Value |
|---|---|
| Base model | HuggingFaceTB/SmolLM2-1.7B |
| Fine-tuning method | LoRA (PEFT) via TRL SFT |
| Training data | 200,000+ Wikipedia paragraphs (LT + EN) |
| Hardware | NVIDIA A100 SXM (RunPod) |
| Precision | float16 |
do_sample=False (greedy); sampling may produce incoherent outputIf you use this model, please cite the base model and TRL:
@software{vonwerra2020trl,
title = {{TRL: Transformers Reinforcement Learning}},
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward
and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif
and Gallouédec, Quentin},
license = {Apache-2.0},
url = {https://github.com/huggingface/trl},
year = {2020}
}