Instructions to use scrallex/structural-manifold-compression with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use scrallex/structural-manifold-compression with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="scrallex/structural-manifold-compression")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("scrallex/structural-manifold-compression") model = AutoModelForCausalLM.from_pretrained("scrallex/structural-manifold-compression", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use scrallex/structural-manifold-compression with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "scrallex/structural-manifold-compression" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "scrallex/structural-manifold-compression", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/scrallex/structural-manifold-compression
- SGLang
How to use scrallex/structural-manifold-compression 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 "scrallex/structural-manifold-compression" \ --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": "scrallex/structural-manifold-compression", "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 "scrallex/structural-manifold-compression" \ --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": "scrallex/structural-manifold-compression", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use scrallex/structural-manifold-compression with Docker Model Runner:
docker model run hf.co/scrallex/structural-manifold-compression
Highlight structured quick start and upcoming Space
Browse files
README.md
CHANGED
|
@@ -29,6 +29,24 @@ Use this repo if you want to **benchmark manifold LMs** or integrate the encoder
|
|
| 29 |
|
| 30 |
---
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
## Latest Benchmarks (2025-11-05)
|
| 33 |
All evaluations ran on a single RTX 3080 Ti (12 GB) with the same environment as the training run. The raw artifacts referenced below are stored in `benchmarks/`.
|
| 34 |
|
|
|
|
| 29 |
|
| 30 |
---
|
| 31 |
|
| 32 |
+
## Quick Start & Best-Case Workloads
|
| 33 |
+
- **Optimised for structured text**: PDF/page OCR exports, news briefs, technical audits—any corpus where 512 B sliding windows capture repeated structure. Expect 30–60× token compression with 94–95 % token accuracy (Fox EN/CN/OmniDoc numbers from the main repo).
|
| 34 |
+
- **Reproduce on a sample corpus**:
|
| 35 |
+
```bash
|
| 36 |
+
git clone https://github.com/SepDynamics/structural-manifold-compression.git
|
| 37 |
+
cd structural-manifold-compression
|
| 38 |
+
python scripts/experiments/benchmark_eval.py \
|
| 39 |
+
--dataset briefs=examples/structured_demo/news_sample.jsonl \
|
| 40 |
+
--json-text-key text \
|
| 41 |
+
--window-bytes 512 --stride-bytes 384 --precision 3 \
|
| 42 |
+
--use-native \
|
| 43 |
+
--output-dir output/benchmark_runs/news_demo
|
| 44 |
+
```
|
| 45 |
+
Inspect `output/benchmark_runs/news_demo/briefs.json` for compression, fidelity, and verification stats, then replace `news_sample.jsonl` with your own JSONL dumps.
|
| 46 |
+
- **Future Hugging Face Space**: a Gradio front-end (planned) will wrap the same workflow so newcomers can upload JSONL/txt, run compression, and view reconstructions/verification without installing CUDA.
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
## Latest Benchmarks (2025-11-05)
|
| 51 |
All evaluations ran on a single RTX 3080 Ti (12 GB) with the same environment as the training run. The raw artifacts referenced below are stored in `benchmarks/`.
|
| 52 |
|