Text Generation
Transformers
Safetensors
PyTorch
ONNX
English
qtensorformer
q-tensorformer
high-throughput-inference
tensor-train
tensor-networks
tensorrt-llm
vllm
continuous-batching
paged-attention
speculative-decoding
zero-svd
adaptive-computation
dynamic-neural-networks
kv-cache
kv-cache-quantization
attention-sinks
lyapunov-stability
control-theory
contextual-bandits
edge-ai
edge-inference
on-device-ai
model-compression
hopper-h100
blackwell-b200
jetson-orin
jetson-thor
grouped-query-attention
rotary-position-embeddings
custom_code
academic-paper
ieee
neurips
vit-ap-university
deepseek
deepseek-r1
reasoning
chain-of-thought
gsm8k
openai-compatible
fastapi
rest-api
sse-streaming
onnx-runtime
embedded-ai
hardware-telemetry
power-efficiency
green-ai
raspberry-pi
smollm2
qwen2.5
llama-3.2
apple-silicon
Instructions to use Premchan369/Q-TensorFormer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Premchan369/Q-TensorFormer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Premchan369/Q-TensorFormer", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Premchan369/Q-TensorFormer", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Premchan369/Q-TensorFormer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Premchan369/Q-TensorFormer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Premchan369/Q-TensorFormer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Premchan369/Q-TensorFormer
- SGLang
How to use Premchan369/Q-TensorFormer 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 "Premchan369/Q-TensorFormer" \ --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": "Premchan369/Q-TensorFormer", "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 "Premchan369/Q-TensorFormer" \ --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": "Premchan369/Q-TensorFormer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Premchan369/Q-TensorFormer with Docker Model Runner:
docker model run hf.co/Premchan369/Q-TensorFormer
File size: 2,358 Bytes
114f6bd 3d24ee3 114f6bd 3d24ee3 114f6bd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | const fs = require('fs');
const path = require('path');
const scriptDir = __dirname;
const katexJsPath = path.join(scriptDir, 'assets', 'katex.min.js');
const katexCssPath = path.join(scriptDir, 'assets', 'katex.min.css');
const code = fs.readFileSync(katexJsPath, 'utf8');
const katexCss = fs.readFileSync(katexCssPath, 'utf8');
const m = { exports: {} };
const fn = new Function('module', 'exports', code);
fn(m, m.exports);
const katex = m.exports;
let eqCounter = 0;
function renderMath(text) {
eqCounter = 0;
// First replace block math $$ ... $$
let output = text.replace(/\$\$([\s\S]+?)\$\$/g, (match, eq) => {
eqCounter++;
const rawEq = eq.trim();
try {
const mathHtml = katex.renderToString(rawEq, {
displayMode: true,
output: 'htmlAndMathml',
throwOnError: false,
strict: false
});
return `<table class="eq-table"><tr><td class="eq-cell-math">${mathHtml}</td><td class="eq-cell-num">(${eqCounter})</td></tr></table>`;
} catch (e) {
console.error('KaTeX block error on:', rawEq, e);
return match;
}
});
// Next replace inline math $ ... $ (excluding escaped \$)
output = output.replace(/(?<!\\)\$([^\$\n]+?)(?<!\\)\$/g, (match, eq) => {
const rawEq = eq.trim();
try {
return katex.renderToString(rawEq, {
displayMode: false,
output: 'htmlAndMathml',
throwOnError: false,
strict: false
});
} catch (e) {
console.error('KaTeX inline error on:', rawEq, e);
return match;
}
});
// Also replace KaTeX CSS placeholder if present
if (output.includes('/* __KATEX_CSS__ */')) {
output = output.replace('/* __KATEX_CSS__ */', katexCss);
}
return output;
}
module.exports = { renderMath, katexCss };
if (require.main === module) {
const inputFile = process.argv[2];
const outputFile = process.argv[3] || inputFile;
if (inputFile) {
const raw = fs.readFileSync(inputFile, 'utf8');
const rendered = renderMath(raw);
fs.writeFileSync(outputFile, rendered, 'utf8');
console.log(`Pre-rendered KaTeX math from ${inputFile} -> ${outputFile}`);
}
}
|