Text Generation
Transformers
PyTorch
hypermamba
feature-extraction
ssm
mamba
meta-learning
few-shot
experimental
custom_code
Instructions to use hoanghai2110/HyperMambaLM-300M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hoanghai2110/HyperMambaLM-300M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hoanghai2110/HyperMambaLM-300M", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hoanghai2110/HyperMambaLM-300M", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hoanghai2110/HyperMambaLM-300M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hoanghai2110/HyperMambaLM-300M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hoanghai2110/HyperMambaLM-300M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hoanghai2110/HyperMambaLM-300M
- SGLang
How to use hoanghai2110/HyperMambaLM-300M 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 "hoanghai2110/HyperMambaLM-300M" \ --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": "hoanghai2110/HyperMambaLM-300M", "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 "hoanghai2110/HyperMambaLM-300M" \ --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": "hoanghai2110/HyperMambaLM-300M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hoanghai2110/HyperMambaLM-300M with Docker Model Runner:
docker model run hf.co/hoanghai2110/HyperMambaLM-300M
| """ | |
| HyperMambaLM - v1.0.0 | |
| Simple language model | |
| """ | |
| # Import main model | |
| from .modeling_hypermamba import ( | |
| HyperMambaConfig, | |
| HyperMambaLM, | |
| MetaLearningModule, | |
| NeuroSymbolicLayer, | |
| UltraMambaBlock | |
| ) | |
| # Import utilities | |
| from .modeling_utils import ( | |
| AdvancedBPETokenizer, | |
| ModelProfiler, | |
| FewShotDataLoader, | |
| VisualizationUtils | |
| ) | |
| __version__ = "1.0.0" | |
| __author__ = "Nguyen Hai" | |
| __all__ = [ | |
| "HyperMambaConfig", | |
| "HyperMambaLM", | |
| "MetaLearningModule", | |
| "NeuroSymbolicLayer", | |
| "UltraMambaBlock", | |
| "AdvancedBPETokenizer", | |
| "ModelProfiler", | |
| "FewShotDataLoader", | |
| "VisualizationUtils", | |
| ] | |
| # Register models | |
| def register_models(): | |
| try: | |
| from transformers import AutoConfig, AutoModel, AutoModelForCausalLM | |
| AutoConfig.register("hypermamba", HyperMambaConfig) | |
| AutoModel.register(HyperMambaConfig, HyperMambaLM) | |
| AutoModelForCausalLM.register(HyperMambaConfig, HyperMambaLM) | |
| print("Models registered successfully!") | |
| except ImportError: | |
| print("Transformers library not found") | |
| register_models() |