Text Generation
Transformers
PyTorch
English
taonet_mini_t2
taonet
taotern
ssm
state-space-model
dplr
custom_code
experimental
Instructions to use TaoTern/TaoNet-mini-T2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TaoTern/TaoNet-mini-T2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TaoTern/TaoNet-mini-T2", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("TaoTern/TaoNet-mini-T2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TaoTern/TaoNet-mini-T2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TaoTern/TaoNet-mini-T2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TaoTern/TaoNet-mini-T2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TaoTern/TaoNet-mini-T2
- SGLang
How to use TaoTern/TaoNet-mini-T2 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 "TaoTern/TaoNet-mini-T2" \ --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": "TaoTern/TaoNet-mini-T2", "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 "TaoTern/TaoNet-mini-T2" \ --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": "TaoTern/TaoNet-mini-T2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TaoTern/TaoNet-mini-T2 with Docker Model Runner:
docker model run hf.co/TaoTern/TaoNet-mini-T2
| set -Eeuo pipefail | |
| job_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| status_json="$job_dir/status.json" | |
| log_path="$job_dir/train.log" | |
| telemetry_path="$job_dir/gpu_telemetry_nvidia_smi.csv" | |
| write_status() { | |
| local state="$1" | |
| local extra="${2:-}" | |
| local now | |
| now="$(date -Iseconds)" | |
| cat > "$status_json" <<STATUS | |
| {"state":"$state","updated_at":"$now","job_dir":"$job_dir"$extra} | |
| STATUS | |
| } | |
| write_status "running" ",\"start_time\":\"$(date -Iseconds)\"" | |
| rm -f "$job_dir/DONE" "$job_dir/FAILED" | |
| monitor_pid="" | |
| if command -v nvidia-smi >/dev/null 2>&1; then | |
| ( | |
| while true; do | |
| date -Iseconds | |
| nvidia-smi --query-gpu=timestamp,name,utilization.gpu,utilization.memory,memory.used,memory.total,power.draw,temperature.gpu --format=csv,noheader,nounits | |
| sleep 5 | |
| done | |
| ) > "$telemetry_path" 2>&1 & | |
| monitor_pid="$!" | |
| fi | |
| cleanup() { | |
| if [[ -n "$monitor_pid" ]]; then | |
| kill "$monitor_pid" 2>/dev/null || true | |
| wait "$monitor_pid" 2>/dev/null || true | |
| fi | |
| } | |
| trap cleanup EXIT | |
| set +e | |
| "$job_dir/command.sh" > "$log_path" 2>&1 | |
| exit_code="$?" | |
| set -e | |
| if [[ "$exit_code" -eq 0 ]]; then | |
| touch "$job_dir/DONE" | |
| write_status "completed" ",\"exit_code\":0,\"end_time\":\"$(date -Iseconds)\"" | |
| else | |
| echo "$exit_code" > "$job_dir/FAILED" | |
| write_status "failed" ",\"exit_code\":$exit_code,\"end_time\":\"$(date -Iseconds)\"" | |
| fi | |
| exit "$exit_code" | |