Text Generation
Transformers
Safetensors
phi3
torchwright
compiled-transformer
calculator_scratchpad
text-generation-inference
Instructions to use physicsrob/torchwright-calculator-scratchpad-max-digits-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use physicsrob/torchwright-calculator-scratchpad-max-digits-3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="physicsrob/torchwright-calculator-scratchpad-max-digits-3")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("physicsrob/torchwright-calculator-scratchpad-max-digits-3") model = AutoModelForCausalLM.from_pretrained("physicsrob/torchwright-calculator-scratchpad-max-digits-3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use physicsrob/torchwright-calculator-scratchpad-max-digits-3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "physicsrob/torchwright-calculator-scratchpad-max-digits-3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "physicsrob/torchwright-calculator-scratchpad-max-digits-3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/physicsrob/torchwright-calculator-scratchpad-max-digits-3
- SGLang
How to use physicsrob/torchwright-calculator-scratchpad-max-digits-3 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 "physicsrob/torchwright-calculator-scratchpad-max-digits-3" \ --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": "physicsrob/torchwright-calculator-scratchpad-max-digits-3", "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 "physicsrob/torchwright-calculator-scratchpad-max-digits-3" \ --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": "physicsrob/torchwright-calculator-scratchpad-max-digits-3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use physicsrob/torchwright-calculator-scratchpad-max-digits-3 with Docker Model Runner:
docker model run hf.co/physicsrob/torchwright-calculator-scratchpad-max-digits-3
Add explicit <unk> token
Browse filesAppend a zero-semantic unknown-token row without changing any existing token ids or transformer-layer weights.
- config.json +1 -1
- model-00019-of-00019.safetensors +2 -2
- model.safetensors.index.json +117 -1
- tokenizer.json +11 -1
- tokenizer_config.json +1 -1
config.json
CHANGED
|
@@ -29,5 +29,5 @@
|
|
| 29 |
"tie_word_embeddings": true,
|
| 30 |
"transformers_version": "5.12.1",
|
| 31 |
"use_cache": true,
|
| 32 |
-
"vocab_size":
|
| 33 |
}
|
|
|
|
| 29 |
"tie_word_embeddings": true,
|
| 30 |
"transformers_version": "5.12.1",
|
| 31 |
"use_cache": true,
|
| 32 |
+
"vocab_size": 34
|
| 33 |
}
|
model-00019-of-00019.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7007bb14771230ab3129388319b7d18a4b544ec0900c064f72d0a9cba5d7c457
|
| 3 |
+
size 585664
|
model.safetensors.index.json
CHANGED
|
@@ -1 +1,117 @@
|
|
| 1 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 2306056192
|
| 4 |
+
},
|
| 5 |
+
"weight_map": {
|
| 6 |
+
"model.embed_tokens.weight": "model-00019-of-00019.safetensors",
|
| 7 |
+
"model.layers.0.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 8 |
+
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00019.safetensors",
|
| 9 |
+
"model.layers.0.mlp.gate_up_proj.weight": "model-00001-of-00019.safetensors",
|
| 10 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 11 |
+
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00019.safetensors",
|
| 12 |
+
"model.layers.0.self_attn.qkv_proj.weight": "model-00001-of-00019.safetensors",
|
| 13 |
+
"model.layers.1.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 14 |
+
"model.layers.1.mlp.down_proj.weight": "model-00002-of-00019.safetensors",
|
| 15 |
+
"model.layers.1.mlp.gate_up_proj.weight": "model-00002-of-00019.safetensors",
|
| 16 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 17 |
+
"model.layers.1.self_attn.o_proj.weight": "model-00002-of-00019.safetensors",
|
| 18 |
+
"model.layers.1.self_attn.qkv_proj.weight": "model-00002-of-00019.safetensors",
|
| 19 |
+
"model.layers.10.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 20 |
+
"model.layers.10.mlp.down_proj.weight": "model-00011-of-00019.safetensors",
|
| 21 |
+
"model.layers.10.mlp.gate_up_proj.weight": "model-00011-of-00019.safetensors",
|
| 22 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 23 |
+
"model.layers.10.self_attn.o_proj.weight": "model-00011-of-00019.safetensors",
|
| 24 |
+
"model.layers.10.self_attn.qkv_proj.weight": "model-00011-of-00019.safetensors",
|
| 25 |
+
"model.layers.11.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 26 |
+
"model.layers.11.mlp.down_proj.weight": "model-00012-of-00019.safetensors",
|
| 27 |
+
"model.layers.11.mlp.gate_up_proj.weight": "model-00012-of-00019.safetensors",
|
| 28 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 29 |
+
"model.layers.11.self_attn.o_proj.weight": "model-00012-of-00019.safetensors",
|
| 30 |
+
"model.layers.11.self_attn.qkv_proj.weight": "model-00012-of-00019.safetensors",
|
| 31 |
+
"model.layers.12.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 32 |
+
"model.layers.12.mlp.down_proj.weight": "model-00013-of-00019.safetensors",
|
| 33 |
+
"model.layers.12.mlp.gate_up_proj.weight": "model-00013-of-00019.safetensors",
|
| 34 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 35 |
+
"model.layers.12.self_attn.o_proj.weight": "model-00013-of-00019.safetensors",
|
| 36 |
+
"model.layers.12.self_attn.qkv_proj.weight": "model-00013-of-00019.safetensors",
|
| 37 |
+
"model.layers.13.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 38 |
+
"model.layers.13.mlp.down_proj.weight": "model-00014-of-00019.safetensors",
|
| 39 |
+
"model.layers.13.mlp.gate_up_proj.weight": "model-00014-of-00019.safetensors",
|
| 40 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 41 |
+
"model.layers.13.self_attn.o_proj.weight": "model-00014-of-00019.safetensors",
|
| 42 |
+
"model.layers.13.self_attn.qkv_proj.weight": "model-00014-of-00019.safetensors",
|
| 43 |
+
"model.layers.14.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 44 |
+
"model.layers.14.mlp.down_proj.weight": "model-00015-of-00019.safetensors",
|
| 45 |
+
"model.layers.14.mlp.gate_up_proj.weight": "model-00015-of-00019.safetensors",
|
| 46 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 47 |
+
"model.layers.14.self_attn.o_proj.weight": "model-00015-of-00019.safetensors",
|
| 48 |
+
"model.layers.14.self_attn.qkv_proj.weight": "model-00015-of-00019.safetensors",
|
| 49 |
+
"model.layers.15.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 50 |
+
"model.layers.15.mlp.down_proj.weight": "model-00016-of-00019.safetensors",
|
| 51 |
+
"model.layers.15.mlp.gate_up_proj.weight": "model-00016-of-00019.safetensors",
|
| 52 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 53 |
+
"model.layers.15.self_attn.o_proj.weight": "model-00016-of-00019.safetensors",
|
| 54 |
+
"model.layers.15.self_attn.qkv_proj.weight": "model-00016-of-00019.safetensors",
|
| 55 |
+
"model.layers.16.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 56 |
+
"model.layers.16.mlp.down_proj.weight": "model-00017-of-00019.safetensors",
|
| 57 |
+
"model.layers.16.mlp.gate_up_proj.weight": "model-00017-of-00019.safetensors",
|
| 58 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 59 |
+
"model.layers.16.self_attn.o_proj.weight": "model-00017-of-00019.safetensors",
|
| 60 |
+
"model.layers.16.self_attn.qkv_proj.weight": "model-00017-of-00019.safetensors",
|
| 61 |
+
"model.layers.17.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 62 |
+
"model.layers.17.mlp.down_proj.weight": "model-00018-of-00019.safetensors",
|
| 63 |
+
"model.layers.17.mlp.gate_up_proj.weight": "model-00018-of-00019.safetensors",
|
| 64 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 65 |
+
"model.layers.17.self_attn.o_proj.weight": "model-00018-of-00019.safetensors",
|
| 66 |
+
"model.layers.17.self_attn.qkv_proj.weight": "model-00018-of-00019.safetensors",
|
| 67 |
+
"model.layers.2.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 68 |
+
"model.layers.2.mlp.down_proj.weight": "model-00003-of-00019.safetensors",
|
| 69 |
+
"model.layers.2.mlp.gate_up_proj.weight": "model-00003-of-00019.safetensors",
|
| 70 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 71 |
+
"model.layers.2.self_attn.o_proj.weight": "model-00003-of-00019.safetensors",
|
| 72 |
+
"model.layers.2.self_attn.qkv_proj.weight": "model-00003-of-00019.safetensors",
|
| 73 |
+
"model.layers.3.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 74 |
+
"model.layers.3.mlp.down_proj.weight": "model-00004-of-00019.safetensors",
|
| 75 |
+
"model.layers.3.mlp.gate_up_proj.weight": "model-00004-of-00019.safetensors",
|
| 76 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 77 |
+
"model.layers.3.self_attn.o_proj.weight": "model-00004-of-00019.safetensors",
|
| 78 |
+
"model.layers.3.self_attn.qkv_proj.weight": "model-00004-of-00019.safetensors",
|
| 79 |
+
"model.layers.4.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 80 |
+
"model.layers.4.mlp.down_proj.weight": "model-00005-of-00019.safetensors",
|
| 81 |
+
"model.layers.4.mlp.gate_up_proj.weight": "model-00005-of-00019.safetensors",
|
| 82 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 83 |
+
"model.layers.4.self_attn.o_proj.weight": "model-00005-of-00019.safetensors",
|
| 84 |
+
"model.layers.4.self_attn.qkv_proj.weight": "model-00005-of-00019.safetensors",
|
| 85 |
+
"model.layers.5.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 86 |
+
"model.layers.5.mlp.down_proj.weight": "model-00006-of-00019.safetensors",
|
| 87 |
+
"model.layers.5.mlp.gate_up_proj.weight": "model-00006-of-00019.safetensors",
|
| 88 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 89 |
+
"model.layers.5.self_attn.o_proj.weight": "model-00006-of-00019.safetensors",
|
| 90 |
+
"model.layers.5.self_attn.qkv_proj.weight": "model-00006-of-00019.safetensors",
|
| 91 |
+
"model.layers.6.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 92 |
+
"model.layers.6.mlp.down_proj.weight": "model-00007-of-00019.safetensors",
|
| 93 |
+
"model.layers.6.mlp.gate_up_proj.weight": "model-00007-of-00019.safetensors",
|
| 94 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 95 |
+
"model.layers.6.self_attn.o_proj.weight": "model-00007-of-00019.safetensors",
|
| 96 |
+
"model.layers.6.self_attn.qkv_proj.weight": "model-00007-of-00019.safetensors",
|
| 97 |
+
"model.layers.7.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 98 |
+
"model.layers.7.mlp.down_proj.weight": "model-00008-of-00019.safetensors",
|
| 99 |
+
"model.layers.7.mlp.gate_up_proj.weight": "model-00008-of-00019.safetensors",
|
| 100 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 101 |
+
"model.layers.7.self_attn.o_proj.weight": "model-00008-of-00019.safetensors",
|
| 102 |
+
"model.layers.7.self_attn.qkv_proj.weight": "model-00008-of-00019.safetensors",
|
| 103 |
+
"model.layers.8.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 104 |
+
"model.layers.8.mlp.down_proj.weight": "model-00009-of-00019.safetensors",
|
| 105 |
+
"model.layers.8.mlp.gate_up_proj.weight": "model-00009-of-00019.safetensors",
|
| 106 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 107 |
+
"model.layers.8.self_attn.o_proj.weight": "model-00009-of-00019.safetensors",
|
| 108 |
+
"model.layers.8.self_attn.qkv_proj.weight": "model-00009-of-00019.safetensors",
|
| 109 |
+
"model.layers.9.input_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 110 |
+
"model.layers.9.mlp.down_proj.weight": "model-00010-of-00019.safetensors",
|
| 111 |
+
"model.layers.9.mlp.gate_up_proj.weight": "model-00010-of-00019.safetensors",
|
| 112 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00019-of-00019.safetensors",
|
| 113 |
+
"model.layers.9.self_attn.o_proj.weight": "model-00010-of-00019.safetensors",
|
| 114 |
+
"model.layers.9.self_attn.qkv_proj.weight": "model-00010-of-00019.safetensors",
|
| 115 |
+
"model.norm.weight": "model-00019-of-00019.safetensors"
|
| 116 |
+
}
|
| 117 |
+
}
|
tokenizer.json
CHANGED
|
@@ -20,6 +20,15 @@
|
|
| 20 |
"rstrip": false,
|
| 21 |
"normalized": false,
|
| 22 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
}
|
| 24 |
],
|
| 25 |
"normalizer": null,
|
|
@@ -123,7 +132,8 @@
|
|
| 123 |
"₄ ": 29,
|
| 124 |
"₅ ": 30,
|
| 125 |
"₆ ": 31,
|
| 126 |
-
"</THINKING>": 32
|
|
|
|
| 127 |
},
|
| 128 |
"unk_token": "<unk>"
|
| 129 |
}
|
|
|
|
| 20 |
"rstrip": false,
|
| 21 |
"normalized": false,
|
| 22 |
"special": true
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"id": 33,
|
| 26 |
+
"content": "<unk>",
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"lstrip": false,
|
| 29 |
+
"rstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"special": true
|
| 32 |
}
|
| 33 |
],
|
| 34 |
"normalizer": null,
|
|
|
|
| 132 |
"₄ ": 29,
|
| 133 |
"₅ ": 30,
|
| 134 |
"₆ ": 31,
|
| 135 |
+
"</THINKING>": 32,
|
| 136 |
+
"<unk>": 33
|
| 137 |
},
|
| 138 |
"unk_token": "<unk>"
|
| 139 |
}
|
tokenizer_config.json
CHANGED
|
@@ -4,5 +4,5 @@
|
|
| 4 |
"eos_token": "<eos>",
|
| 5 |
"model_max_length": 1000000000000000019884624838656,
|
| 6 |
"tokenizer_class": "TokenizersBackend",
|
| 7 |
-
"unk_token":
|
| 8 |
}
|
|
|
|
| 4 |
"eos_token": "<eos>",
|
| 5 |
"model_max_length": 1000000000000000019884624838656,
|
| 6 |
"tokenizer_class": "TokenizersBackend",
|
| 7 |
+
"unk_token": "<unk>"
|
| 8 |
}
|