Text Generation
Transformers
Safetensors
PyTorch
Vietnamese
English
llama
viena
causal-lm
chat
text-generation-inference
Instructions to use vietrix/viena-tiny-demo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vietrix/viena-tiny-demo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vietrix/viena-tiny-demo")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vietrix/viena-tiny-demo") model = AutoModelForCausalLM.from_pretrained("vietrix/viena-tiny-demo") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use vietrix/viena-tiny-demo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vietrix/viena-tiny-demo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vietrix/viena-tiny-demo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vietrix/viena-tiny-demo
- SGLang
How to use vietrix/viena-tiny-demo 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 "vietrix/viena-tiny-demo" \ --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": "vietrix/viena-tiny-demo", "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 "vietrix/viena-tiny-demo" \ --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": "vietrix/viena-tiny-demo", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vietrix/viena-tiny-demo with Docker Model Runner:
docker model run hf.co/vietrix/viena-tiny-demo
Viena Tiny Demo (SFT)
This is a tiny, demo-only Viena checkpoint fine-tuned for instruction following. It is not production quality. It is intended for smoke tests and workflow validation.
Model description
- Architecture: decoder-only Transformer (VienaModel) with RMSNorm, RoPE, SwiGLU, GQA.
- Parameters: ~10M (tiny config).
- Tokenizer: SentencePiece BPE (target vocab 2000; actual vocab may be smaller due to tiny data).
- Training: small offline synthetic dataset shipped with the repo.
Training data
- Pretrain:
viena_data/examples/pretrain_offline.jsonl - SFT:
viena_data/examples/sft_offline_train.jsonl - Validation:
viena_data/examples/sft_offline_val.jsonl
All datasets are synthetic and intended for offline tests.
Training recipe (tiny)
- Config:
configs/viena_tiny.yaml - Pretrain: 50 steps
- SFT: 20 steps
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "vietrix/viena-tiny-demo"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
device_map="auto",
)
prompt = "<|system|>
You are Viena.
<|user|>
Xin chao!
<|assistant|>
"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=128, do_sample=True, temperature=0.7, top_p=0.9)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Limitations
- Very small dataset and very few steps.
- Not suitable for real use or evaluation.
- Likely to hallucinate or be inconsistent.
License
MIT (code + demo weights). See repository license for details.
- Downloads last month
- 1