Text Generation
Transformers
Safetensors
phi3
torchwright
compiled-transformer
calculator_advanced
text-generation-inference
Instructions to use physicsrob/torchwright-calculator-advanced-max-digits-12 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use physicsrob/torchwright-calculator-advanced-max-digits-12 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="physicsrob/torchwright-calculator-advanced-max-digits-12")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("physicsrob/torchwright-calculator-advanced-max-digits-12") model = AutoModelForCausalLM.from_pretrained("physicsrob/torchwright-calculator-advanced-max-digits-12", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use physicsrob/torchwright-calculator-advanced-max-digits-12 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "physicsrob/torchwright-calculator-advanced-max-digits-12" # 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-advanced-max-digits-12", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/physicsrob/torchwright-calculator-advanced-max-digits-12
- SGLang
How to use physicsrob/torchwright-calculator-advanced-max-digits-12 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-advanced-max-digits-12" \ --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-advanced-max-digits-12", "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-advanced-max-digits-12" \ --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-advanced-max-digits-12", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use physicsrob/torchwright-calculator-advanced-max-digits-12 with Docker Model Runner:
docker model run hf.co/physicsrob/torchwright-calculator-advanced-max-digits-12
| { | |
| "$schema": "https://json-schema.org/draft/2020-12/schema", | |
| "$id": "https://github.com/physicsrob/torchwright/blob/main/torchwright/compiler/torchwright_schematic_v1.schema.json", | |
| "title": "torchwright compiled artifact schematic v1", | |
| "type": "object", | |
| "required": [ | |
| "format", | |
| "integrity", | |
| "artifact", | |
| "build", | |
| "model", | |
| "token_io", | |
| "graphs", | |
| "schedule", | |
| "residual_stream", | |
| "physical_layout", | |
| "parameter_support", | |
| "observability", | |
| "runtime_contract", | |
| "intervention_contract", | |
| "reference_fixtures" | |
| ], | |
| "properties": { | |
| "format": {"const": "torchwright.schematic.v1"}, | |
| "$schema": {"type": "string"}, | |
| "integrity": { | |
| "type": "object", | |
| "required": ["sha256", "scope"], | |
| "properties": { | |
| "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, | |
| "scope": {"type": "string"} | |
| } | |
| }, | |
| "artifact": { | |
| "type": "object", | |
| "required": ["kind", "architecture", "files"], | |
| "properties": { | |
| "kind": {"const": "huggingface_causal_lm_bundle"}, | |
| "architecture": {"enum": ["phi3", "custom"]}, | |
| "files": { | |
| "type": "object", | |
| "additionalProperties": { | |
| "type": "object", | |
| "required": ["sha256", "bytes"], | |
| "properties": { | |
| "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, | |
| "bytes": {"type": "integer", "minimum": 0} | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "build": {"type": "object"}, | |
| "model": {"type": "object"}, | |
| "token_io": {"type": "object"}, | |
| "graphs": { | |
| "type": "object", | |
| "required": ["source", "lowered", "realization_map"], | |
| "properties": { | |
| "source": {"$ref": "#/$defs/graph"}, | |
| "lowered": {"$ref": "#/$defs/graph"}, | |
| "realization_map": {"type": "array"} | |
| } | |
| }, | |
| "schedule": { | |
| "type": "object", | |
| "required": ["assignment", "realizations", "layers"] | |
| }, | |
| "residual_stream": { | |
| "type": "object", | |
| "required": ["width", "states"] | |
| }, | |
| "physical_layout": { | |
| "type": "object", | |
| "required": ["matrices", "placements", "checkpoint_parameter_map"] | |
| }, | |
| "parameter_support": { | |
| "type": "object", | |
| "required": ["file", "format", "tensors"] | |
| }, | |
| "observability": {"type": "object"}, | |
| "runtime_contract": {"type": "object"}, | |
| "intervention_contract": {"type": "object"}, | |
| "reference_fixtures": {"type": "object"}, | |
| "metadata": {"type": "object"} | |
| }, | |
| "$defs": { | |
| "graph": { | |
| "type": "object", | |
| "required": ["root", "nodes", "sha256"], | |
| "properties": { | |
| "root": {"type": "string"}, | |
| "nodes": { | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "required": ["id", "op", "width", "inputs", "value_contract"], | |
| "properties": { | |
| "region": {"type": ["string", "null"]} | |
| } | |
| } | |
| }, | |
| "semantic_regions": { | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "required": ["id", "op", "operands", "results"], | |
| "properties": { | |
| "id": {"type": "string"}, | |
| "op": {"type": "string"}, | |
| "parent": {"type": ["string", "null"]}, | |
| "params": {"type": "object"}, | |
| "operands": {"type": "array", "items": {"type": "string"}}, | |
| "results": {"type": "array", "items": {"type": "string"}}, | |
| "annotation": {"type": ["string", "null"]} | |
| } | |
| } | |
| }, | |
| "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"} | |
| } | |
| } | |
| } | |
| } | |