Run this model with HF Jobs

Run ritterlich/mini-tr-134M on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/ritterlich/mini-tr-134M. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/ritterlich/mini-tr-134M on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/ritterlich/mini-tr-134M. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/ritterlich/mini-tr-134M. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
mini-tr-134M / README.md
k12tr's picture
Update README.md
4681709 verified
|
Raw History Blame Contribute Delete
2.26 kB
metadata
language:
  - tr
license: apache-2.0
library_name: transformers
tags:
  - llama-3
  - turkish
  - tiny-llama
  - scratch-build
datasets:
  - TFLai/Turkish-Alpaca
metrics:
  - loss
model_type: llama

Llama-TR-Mini (134M Parameters)

Llama-TR-Mini is an experimental, ultra-lightweight Turkish language model with 134 million parameters, trained from scratch using the Llama 3 architecture.

This project was developed to explore the limits of small-scale language modeling and to understand the end-to-end pre-training/fine-tuning pipeline on consumer-grade hardware (Apple Silicon).

Model Specifications

  • Architecture: Llama 3
  • Parameters: 134,105,856
  • Hidden Size: 768
  • Intermediate Size: 2048
  • Number of Layers: 12
  • Attention Heads: 12
  • Vocabulary Size: 32,000 (Custom Turkish Tokenizer)
  • Training Epochs: 30
  • Device: MacBook Pro (MPS - Metal Performance Shaders)

Training Data

The model was trained on the Turkish-Alpaca dataset, which contains approximately 52K instruction-following pairs translated into Turkish.

Intended Use & Limitations

Important Note: Due to its extremely small size (134M parameters), this model is prone to significant hallucinations and may produce nonsensical or repetitive outputs.

  • Purpose: Educational purposes, understanding LLM mechanics.
  • Not Suited For: Production environments, factual information retrieval, or complex reasoning tasks.
  • Format: Optimized for the Llama 3 Instruct template (<|start_header_id|>user<|end_header_id|>).

How to Use

You can load this model using the transformers library:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "k12tr/mini-tr-134M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

prompt = "<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\nTürkiye'nin başkenti neresidir?<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=50, temperature=0.1, repetition_penalty=1.5)

print(tokenizer.decode(output[0], skip_special_tokens=True))