Text Generation
Transformers
Safetensors
English
sol2
causal-lm
decoder-only
small-language-model
recurrent-depth
grouped-query-attention
base-model
custom-code
custom_code
Instructions to use solintellegence/Sol-Lite-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use solintellegence/Sol-Lite-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="solintellegence/Sol-Lite-2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("solintellegence/Sol-Lite-2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use solintellegence/Sol-Lite-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "solintellegence/Sol-Lite-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "solintellegence/Sol-Lite-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/solintellegence/Sol-Lite-2
- SGLang
How to use solintellegence/Sol-Lite-2 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 "solintellegence/Sol-Lite-2" \ --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": "solintellegence/Sol-Lite-2", "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 "solintellegence/Sol-Lite-2" \ --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": "solintellegence/Sol-Lite-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use solintellegence/Sol-Lite-2 with Docker Model Runner:
docker model run hf.co/solintellegence/Sol-Lite-2
Download configuration_sol2.py from solintellegence/Sol-Lite-2: direct link, hf CLI and curl.
- Browser
- Download file 917 Bytes
-
https://huggingface.co/solintellegence/Sol-Lite-2/resolve/main/configuration_sol2.py
- Command line
-
hf download hf://solintellegence/Sol-Lite-2/configuration_sol2.py
-
curl -L -o configuration_sol2.py https://huggingface.co/solintellegence/Sol-Lite-2/resolve/main/configuration_sol2.py
917 Bytes
| from transformers import PretrainedConfig | |
| class Sol2Config(PretrainedConfig): | |
| model_type = "sol2" | |
| def __init__(self, vocab_size=4096, width=256, heads=8, kv_heads=4, | |
| blocks=10, ffn_width=1552, recurrent_start=1, recurrent_blocks=4, | |
| passes=2, loop_conditioning=True, rope_theta=20000.0, | |
| max_context=2048, backend="sdpa", **kwargs): | |
| kwargs.pop("tie_word_embeddings", None) | |
| kwargs.pop("is_decoder", None) | |
| super().__init__(tie_word_embeddings=True, is_decoder=True, **kwargs) | |
| for key,value in locals().copy().items(): | |
| if key not in ("self", "kwargs", "__class__"): setattr(self,key,value) | |
| self.hidden_size=width | |
| self.num_attention_heads=heads | |
| self.num_key_value_heads=kv_heads | |
| self.num_hidden_layers=blocks | |
| self.max_position_embeddings=max_context | |
| self.use_cache=False | |