Instructions to use vtava/SmolLM2-135M-MemoryFusion-Sequential-R64 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vtava/SmolLM2-135M-MemoryFusion-Sequential-R64 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vtava/SmolLM2-135M-MemoryFusion-Sequential-R64")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("vtava/SmolLM2-135M-MemoryFusion-Sequential-R64", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vtava/SmolLM2-135M-MemoryFusion-Sequential-R64 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vtava/SmolLM2-135M-MemoryFusion-Sequential-R64" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vtava/SmolLM2-135M-MemoryFusion-Sequential-R64", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vtava/SmolLM2-135M-MemoryFusion-Sequential-R64
- SGLang
How to use vtava/SmolLM2-135M-MemoryFusion-Sequential-R64 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 "vtava/SmolLM2-135M-MemoryFusion-Sequential-R64" \ --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": "vtava/SmolLM2-135M-MemoryFusion-Sequential-R64", "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 "vtava/SmolLM2-135M-MemoryFusion-Sequential-R64" \ --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": "vtava/SmolLM2-135M-MemoryFusion-Sequential-R64", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vtava/SmolLM2-135M-MemoryFusion-Sequential-R64 with Docker Model Runner:
docker model run hf.co/vtava/SmolLM2-135M-MemoryFusion-Sequential-R64
Download prompt_smoke_test.json from vtava/SmolLM2-135M-MemoryFusion-Sequential-R64: direct link, hf CLI and curl.
- Browser
- Download file 2.7 kB
-
https://huggingface.co/vtava/SmolLM2-135M-MemoryFusion-Sequential-R64/resolve/3d11298efc6d764d107a03b3e62ebff1fa979cd7/prompt_smoke_test.json
- Command line
-
hf download hf://vtava/SmolLM2-135M-MemoryFusion-Sequential-R64@3d11298efc6d764d107a03b3e62ebff1fa979cd7/prompt_smoke_test.json
-
curl -L -o prompt_smoke_test.json https://huggingface.co/vtava/SmolLM2-135M-MemoryFusion-Sequential-R64/resolve/3d11298efc6d764d107a03b3e62ebff1fa979cd7/prompt_smoke_test.json
2.7 kB
| { | |
| "status": "prompt_generation_completed", | |
| "base_model": "HuggingFaceTB/SmolLM2-135M", | |
| "accepted_layers": [ | |
| 0 | |
| ], | |
| "memory_fusion_config": { | |
| "feature_dim": 32, | |
| "memory_rank": 64, | |
| "dilations": [ | |
| 1, | |
| 2, | |
| 4, | |
| 8, | |
| 16, | |
| 32, | |
| 64, | |
| 128 | |
| ], | |
| "shifted_window": 8, | |
| "train_output_projection": true | |
| }, | |
| "last_accepted_report": { | |
| "layer": 0, | |
| "accepted": true, | |
| "steps": 125, | |
| "nmse": 0.018665021285414696, | |
| "cosine": 0.9919254779815674, | |
| "probe_nll": 2.9270507097244263, | |
| "incremental_delta_nll": 0.01395869255065918, | |
| "cumulative_delta_nll": 0.01395869255065918, | |
| "round": 4 | |
| }, | |
| "tests": [ | |
| { | |
| "prompt": "Austria is a country in Central Europe. The capital of Austria is", | |
| "baseline": "Austria is a country in Central Europe. The capital of Austria is Vienna.\n\nAustria is a country in Central Europe. The capital of Austria is Vienna.\n\nAustria", | |
| "memory_fusion": "Austria is a country in Central Europe. The capital of Austria is Vienna. The country is bordered by Germany to the north, Italy to the east, Slovenia to the south, and Hungary" | |
| }, | |
| { | |
| "prompt": "Question: What is the capital of Austria?\nAnswer:", | |
| "baseline": "Question: What is the capital of Austria?\nAnswer: Vienna.\n\nQuestion: What is the capital of Austria?\nAnswer: Vienna.\n\nQuestion: What is", | |
| "memory_fusion": "Question: What is the capital of Austria?\nAnswer: Vienna.\n\nQuestion: What is the capital of Austria?\nAnswer: Vienna.\n\nQuestion: What is" | |
| }, | |
| { | |
| "prompt": "Paris is the capital of France. Vienna is the capital of", | |
| "baseline": "Paris is the capital of France. Vienna is the capital of Austria. Paris is the capital of France.\n\nThe capital of France is Paris. The capital of Austria is Vienna", | |
| "memory_fusion": "Paris is the capital of France. Vienna is the capital of Austria.\n\nThe capital of the Czech Republic is Prague.\n\nThe capital of the United States is Washington," | |
| }, | |
| { | |
| "prompt": "The largest planet in the Solar System is", | |
| "baseline": "The largest planet in the Solar System is Jupiter. It is the largest planet in the Solar System and the largest planet in the Solar System. It is the largest", | |
| "memory_fusion": "The largest planet in the Solar System is Jupiter, which is 11 times the mass of Earth. The largest planet in the Solar System is Saturn, which" | |
| }, | |
| { | |
| "prompt": "2 + 2 =", | |
| "baseline": "2 + 2 = 10\n\nThe sum of the first 10 natural numbers is 1 + 2 + 3", | |
| "memory_fusion": "2 + 2 = 3\n\nThe sum of the first 3 terms of the sequence is 1 + 2 + 3" | |
| } | |
| ] | |
| } |