Text Generation
Transformers
Safetensors
ncp_smol
next-concept-prediction
conceptlm
causal-lm
smollm2
tessera
custom_code
Instructions to use yava-code/Tessera-135M-Gate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yava-code/Tessera-135M-Gate with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yava-code/Tessera-135M-Gate", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("yava-code/Tessera-135M-Gate", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yava-code/Tessera-135M-Gate with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yava-code/Tessera-135M-Gate" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yava-code/Tessera-135M-Gate", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yava-code/Tessera-135M-Gate
- SGLang
How to use yava-code/Tessera-135M-Gate 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 "yava-code/Tessera-135M-Gate" \ --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": "yava-code/Tessera-135M-Gate", "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 "yava-code/Tessera-135M-Gate" \ --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": "yava-code/Tessera-135M-Gate", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yava-code/Tessera-135M-Gate with Docker Model Runner:
docker model run hf.co/yava-code/Tessera-135M-Gate
File size: 1,490 Bytes
7709bf3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | {
"data": {
"cache_dir": "/vol/.cache/data/tinystories-overfit",
"cache_train_tokens": 1048576,
"dataset": "roneneldan/TinyStories",
"overfit": true,
"revision": "f54c09fd23315a6f9c86f9dc80f725de7d8f9c64",
"sequence_length": 256,
"shuffle_buffer": 2000,
"subset": null,
"text_column": "text",
"train_split": "train",
"train_tokens": 16777216,
"validation_split": "validation",
"validation_tokens": 1048576
},
"model": {
"base_model": "HuggingFaceTB/SmolLM2-135M",
"chunk_size": 4,
"codebook_size": 64,
"concept_layers": 2,
"dtype": "bfloat16",
"insert_layer": 1,
"ncp_target": "continuous",
"ncp_weight": 1.0,
"revision": "93efa2f097d58c2a74874c7e644dbc9b0cee75a2",
"segments": 9,
"vq_weight": 1.0
},
"optim": {
"beta1": 0.9,
"beta2": 0.95,
"eps": 1e-08,
"grad_accum_steps": 4,
"learning_rate": 3e-05,
"max_grad_norm": 1.0,
"micro_batch_size": 4,
"min_lr_ratio": 0.1,
"warmup_ratio": 0.01,
"weight_decay": 0.1
},
"run": {
"mode": "ncp",
"name": "tinystories-overfit",
"output_dir": "/vol/runs/tinystories-overfit",
"resume": true,
"seed": 17
},
"train": {
"compile": false,
"cost_overhead": 1.15,
"eval_batches": 16,
"eval_every_tokens": 4194304,
"gpu_hourly_usd": 0.8,
"log_every_steps": 10,
"max_wall_time_minutes": 180,
"run_budget_usd": 6.0,
"save_every_tokens": 8388608
}
} |