Text Generation
Transformers
Safetensors
English
llama
causal-lm
slm
tiny
small
AtomixLabs
Pascal
math
mathematics
arithmetic
sequence-induction
symbolic-regression
algorithmic-reasoning
oeis
discrete-mathematics
dynamical-systems
time-series
telemetry
multi-token-prediction
muon
synthetic-data
text-generation-inference
Instructions to use AtomixLabs/Pascal-15M-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AtomixLabs/Pascal-15M-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AtomixLabs/Pascal-15M-v1.0")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AtomixLabs/Pascal-15M-v1.0") model = AutoModelForCausalLM.from_pretrained("AtomixLabs/Pascal-15M-v1.0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AtomixLabs/Pascal-15M-v1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AtomixLabs/Pascal-15M-v1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AtomixLabs/Pascal-15M-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AtomixLabs/Pascal-15M-v1.0
- SGLang
How to use AtomixLabs/Pascal-15M-v1.0 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 "AtomixLabs/Pascal-15M-v1.0" \ --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": "AtomixLabs/Pascal-15M-v1.0", "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 "AtomixLabs/Pascal-15M-v1.0" \ --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": "AtomixLabs/Pascal-15M-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AtomixLabs/Pascal-15M-v1.0 with Docker Model Runner:
docker model run hf.co/AtomixLabs/Pascal-15M-v1.0
Update README.md
Browse files
README.md
CHANGED
|
@@ -113,12 +113,16 @@ model_id = "AtomixLabs/Pascal-15M-v1.0"
|
|
| 113 |
model = AutoModelForCausalLM.from_pretrained(
|
| 114 |
model_id,
|
| 115 |
torch_dtype="auto",
|
| 116 |
-
device_map="auto"
|
|
|
|
| 117 |
)
|
| 118 |
|
| 119 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
prompt = "1, 1/2, 2/3, 3/5, 5/8,"
|
| 122 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 123 |
sep_id = tokenizer.convert_tokens_to_ids(",")
|
| 124 |
|
|
@@ -127,10 +131,10 @@ outputs = model.generate(
|
|
| 127 |
max_new_tokens=24,
|
| 128 |
do_sample=False,
|
| 129 |
eos_token_id=sep_id, # Stop immediately upon completing the next number
|
| 130 |
-
pad_token_id=tokenizer.pad_token_id
|
| 131 |
)
|
| 132 |
|
| 133 |
-
# prints the full sequence including the continuation: "1,1/2,2/3,3/5,5/8,8/13
|
| 134 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 135 |
```
|
| 136 |
|
|
|
|
| 113 |
model = AutoModelForCausalLM.from_pretrained(
|
| 114 |
model_id,
|
| 115 |
torch_dtype="auto",
|
| 116 |
+
device_map="auto",
|
| 117 |
+
trust_remote_code=False,
|
| 118 |
)
|
| 119 |
|
| 120 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 121 |
+
model_id,
|
| 122 |
+
trust_remote_code=False,
|
| 123 |
+
)
|
| 124 |
|
| 125 |
+
prompt = "1, 1/2, 2/3, 3/5, 5/8,"
|
| 126 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 127 |
sep_id = tokenizer.convert_tokens_to_ids(",")
|
| 128 |
|
|
|
|
| 131 |
max_new_tokens=24,
|
| 132 |
do_sample=False,
|
| 133 |
eos_token_id=sep_id, # Stop immediately upon completing the next number
|
| 134 |
+
pad_token_id=tokenizer.pad_token_id,
|
| 135 |
)
|
| 136 |
|
| 137 |
+
# prints the full sequence including the continuation: "1,1/2,2/3,3/5,5/8,8/13"
|
| 138 |
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 139 |
```
|
| 140 |
|