Instructions to use utsabdahal34/NepaliGPT-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use utsabdahal34/NepaliGPT-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="utsabdahal34/NepaliGPT-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("utsabdahal34/NepaliGPT-base") model = AutoModelForCausalLM.from_pretrained("utsabdahal34/NepaliGPT-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use utsabdahal34/NepaliGPT-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "utsabdahal34/NepaliGPT-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "utsabdahal34/NepaliGPT-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/utsabdahal34/NepaliGPT-base
- SGLang
How to use utsabdahal34/NepaliGPT-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "utsabdahal34/NepaliGPT-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "utsabdahal34/NepaliGPT-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "utsabdahal34/NepaliGPT-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "utsabdahal34/NepaliGPT-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use utsabdahal34/NepaliGPT-base with Docker Model Runner:
docker model run hf.co/utsabdahal34/NepaliGPT-base
utsabdahal34/NepaliGPT-base
NepaliGPT decoder-only model exported as standard Transformers GPT-2 weights.
Install transformers, sentencepiece, torch, and huggingface_hub for the
example below. The additional native model.pt requires the source package
from https://github.com/utsab345/Nepali_GPT2.
Usage
from huggingface_hub import hf_hub_download
import sentencepiece as spm
import torch
from transformers import AutoModelForCausalLM
repo = "utsabdahal34/NepaliGPT-base"
tokenizer = spm.SentencePieceProcessor(model_file=hf_hub_download(repo, "tokenizer.model"))
model = AutoModelForCausalLM.from_pretrained(repo)
ids = torch.tensor([[tokenizer.bos_id()] + tokenizer.encode("नेपाल एक सुन्दर")])
output = model.generate(ids, max_new_tokens=40, do_sample=False)
print(tokenizer.decode(output[0].tolist()))
For an instruction-tuned checkpoint, construct the prompt with
nepali_gpt2.sft.format_prompt(instruction, context).
Architecture
{
"vocab_size": 16000,
"context_length": 512,
"emb_dim": 512,
"n_heads": 8,
"n_layers": 8,
"drop_rate": 0.1,
"qkv_bias": false
}
Data
Nepali Wikipedia and OSCAR Nepali are described in the source Colab notebook. The raw corpus and held-out split are not included in this export; verify upstream licenses before redistribution.
Training
Base checkpoint supplied by the project owner from the Colab notebook. Architecture is GPT-2 style with 16,000 SentencePiece tokens, 512 context, 512 hidden width, 8 layers and 8 heads. The exported checkpoint does not contain optimizer state or independently verifiable training-step metadata.
Evaluation
The supplied base checkpoint scores 3/5 on the repository cloze smoke set. Full generation and CPU benchmark reports are stored in docs/measurements when available. This score is not a broad quality benchmark.
Limitations
This is a base language model, not instruction tuned. It may repeat text, hallucinate facts and reflect source-data bias. Held-out perplexity, multilingual baseline, human instruction-following scores and CUDA measurements are unavailable in this export.
- Downloads last month
- 292