Instructions to use ViorikaAI-org/CalmaCatMath with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ViorikaAI-org/CalmaCatMath with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ViorikaAI-org/CalmaCatMath")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ViorikaAI-org/CalmaCatMath") model = AutoModelForCausalLM.from_pretrained("ViorikaAI-org/CalmaCatMath") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ViorikaAI-org/CalmaCatMath with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ViorikaAI-org/CalmaCatMath" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ViorikaAI-org/CalmaCatMath", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ViorikaAI-org/CalmaCatMath
- SGLang
How to use ViorikaAI-org/CalmaCatMath 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 "ViorikaAI-org/CalmaCatMath" \ --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": "ViorikaAI-org/CalmaCatMath", "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 "ViorikaAI-org/CalmaCatMath" \ --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": "ViorikaAI-org/CalmaCatMath", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ViorikaAI-org/CalmaCatMath with Docker Model Runner:
docker model run hf.co/ViorikaAI-org/CalmaCatMath
Update README.md
Browse files
README.md
CHANGED
|
@@ -18,25 +18,4 @@ The first generation of the CalmaCatMath series. This is an ultra-compact langua
|
|
| 18 |
### Model Features
|
| 19 |
- **Size:** ~19M parameters — runs lightning-fast even on a potato.
|
| 20 |
- **Vocabulary:** Custom Char tokenzier.
|
| 21 |
-
- **Lore:** Basic NLP, Basic Arithmetic.
|
| 22 |
-
|
| 23 |
-
## How to run
|
| 24 |
-
|
| 25 |
-
```python
|
| 26 |
-
from transformers import GPT2LMHeadModel
|
| 27 |
-
import torch
|
| 28 |
-
|
| 29 |
-
from tokenizer import CharTokenizer
|
| 30 |
-
|
| 31 |
-
model = GPT2LMHeadModel.from_pretrained("ViorikaAI-org/CalmaCatMath")
|
| 32 |
-
tokenizer = CharTokenizer()
|
| 33 |
-
|
| 34 |
-
text = "<s> 2+2="
|
| 35 |
-
|
| 36 |
-
ids = torch.tensor([tokenizer.encode(text)])
|
| 37 |
-
|
| 38 |
-
with torch.no_grad():
|
| 39 |
-
out = model.generate(ids, max_new_tokens=16)
|
| 40 |
-
|
| 41 |
-
print(tokenizer.decode(out[0].tolist()))
|
| 42 |
-
```
|
|
|
|
| 18 |
### Model Features
|
| 19 |
- **Size:** ~19M parameters — runs lightning-fast even on a potato.
|
| 20 |
- **Vocabulary:** Custom Char tokenzier.
|
| 21 |
+
- **Lore:** Basic NLP, Basic Arithmetic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|