Text Generation
Transformers
PyTorch
English
multilingual
helion
deepxr
xlarge
instruction-tuned
causal-lm
conversational
custom_code
Eval Results (legacy)
bitsandbytes
Instructions to use DeepXR/Helion-V1.5-XL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DeepXR/Helion-V1.5-XL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DeepXR/Helion-V1.5-XL", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("DeepXR/Helion-V1.5-XL", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DeepXR/Helion-V1.5-XL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DeepXR/Helion-V1.5-XL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DeepXR/Helion-V1.5-XL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DeepXR/Helion-V1.5-XL
- SGLang
How to use DeepXR/Helion-V1.5-XL 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 "DeepXR/Helion-V1.5-XL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DeepXR/Helion-V1.5-XL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "DeepXR/Helion-V1.5-XL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DeepXR/Helion-V1.5-XL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use DeepXR/Helion-V1.5-XL with Docker Model Runner:
docker model run hf.co/DeepXR/Helion-V1.5-XL
| """ | |
| Helion Model Configuration | |
| """ | |
| from transformers import PretrainedConfig | |
| class HelionConfig(PretrainedConfig): | |
| """ | |
| Configuration class for Helion model. | |
| Args: | |
| vocab_size (`int`, *optional*, defaults to 100000): | |
| Vocabulary size of the Helion model. | |
| hidden_size (`int`, *optional*, defaults to 6144): | |
| Dimension of the hidden representations. | |
| intermediate_size (`int`, *optional*, defaults to 24576): | |
| Dimension of the MLP representations. | |
| num_hidden_layers (`int`, *optional*, defaults to 48): | |
| Number of hidden layers in the Transformer decoder. | |
| num_attention_heads (`int`, *optional*, defaults to 32): | |
| Number of attention heads for each attention layer. | |
| num_key_value_heads (`int`, *optional*, defaults to 8): | |
| Number of key-value heads for Grouped Query Attention. | |
| hidden_act (`str` or `function`, *optional*, defaults to `"silu"`): | |
| The non-linear activation function. | |
| max_position_embeddings (`int`, *optional*, defaults to 16384): | |
| Maximum sequence length that the model can handle. | |
| initializer_range (`float`, *optional*, defaults to 0.02): | |
| Standard deviation of the truncated_normal_initializer. | |
| rms_norm_eps (`float`, *optional*, defaults to 1e-6): | |
| Epsilon value for RMSNorm layers. | |
| use_cache (`bool`, *optional*, defaults to `True`): | |
| Whether to use cache for faster decoding. | |
| pad_token_id (`int`, *optional*, defaults to 0): | |
| Padding token id. | |
| bos_token_id (`int`, *optional*, defaults to 1): | |
| Beginning of stream token id. | |
| eos_token_id (`int`, *optional*, defaults to 2): | |
| End of stream token id. | |
| tie_word_embeddings (`bool`, *optional*, defaults to `False`): | |
| Whether to tie input and output embeddings. | |
| rope_theta (`float`, *optional*, defaults to 10000.0): | |
| The base period of the RoPE embeddings. | |
| rope_scaling (`Dict`, *optional*): | |
| Dictionary containing the scaling configuration for RoPE. | |
| attention_bias (`bool`, *optional*, defaults to `False`): | |
| Whether to use bias in attention layers. | |
| attention_dropout (`float`, *optional*, defaults to 0.0): | |
| Dropout probability for attention weights. | |
| """ | |
| model_type = "helion" | |
| keys_to_ignore_at_inference = ["past_key_values"] | |
| def __init__( | |
| self, | |
| vocab_size=100000, | |
| hidden_size=6144, | |
| intermediate_size=24576, | |
| num_hidden_layers=48, | |
| num_attention_heads=32, | |
| num_key_value_heads=8, | |
| hidden_act="silu", | |
| max_position_embeddings=16384, | |
| initializer_range=0.02, | |
| rms_norm_eps=1e-6, | |
| use_cache=True, | |
| pad_token_id=0, | |
| bos_token_id=1, | |
| eos_token_id=2, | |
| tie_word_embeddings=False, | |
| rope_theta=10000.0, | |
| rope_scaling=None, | |
| attention_bias=False, | |
| attention_dropout=0.0, | |
| **kwargs, | |
| ): | |
| self.vocab_size = vocab_size | |
| self.max_position_embeddings = max_position_embeddings | |
| self.hidden_size = hidden_size | |
| self.intermediate_size = intermediate_size | |
| self.num_hidden_layers = num_hidden_layers | |
| self.num_attention_heads = num_attention_heads | |
| # GQA parameters | |
| if num_key_value_heads is None: | |
| num_key_value_heads = num_attention_heads | |
| self.num_key_value_heads = num_key_value_heads | |
| self.hidden_act = hidden_act | |
| self.initializer_range = initializer_range | |
| self.rms_norm_eps = rms_norm_eps | |
| self.use_cache = use_cache | |
| self.rope_theta = rope_theta | |
| self.rope_scaling = rope_scaling | |
| self.attention_bias = attention_bias | |
| self.attention_dropout = attention_dropout | |
| # Validate rope_scaling | |
| if self.rope_scaling is not None: | |
| if not isinstance(self.rope_scaling, dict): | |
| raise ValueError("`rope_scaling` must be a dictionary") | |
| required_keys = {"type", "factor"} | |
| if not all(key in self.rope_scaling for key in required_keys): | |
| raise ValueError(f"`rope_scaling` must contain keys {required_keys}") | |
| if self.rope_scaling["type"] not in ["linear", "dynamic"]: | |
| raise ValueError("`rope_scaling.type` must be 'linear' or 'dynamic'") | |
| super().__init__( | |
| pad_token_id=pad_token_id, | |
| bos_token_id=bos_token_id, | |
| eos_token_id=eos_token_id, | |
| tie_word_embeddings=tie_word_embeddings, | |
| **kwargs, | |
| ) |