Text Generation
Transformers
Safetensors
English
Arabic
quasar_long
silx-ai
quasar-preview
quasar
foundation-model
Mixture of Experts
18b
2b-active
long-context
bittensor
sn24
decentralized-training
distillation
hybrid-transformer
loop-transformer
safe-nope
drope
conversational
custom_code
Instructions to use mainline777/base_IIXIV with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mainline777/base_IIXIV with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mainline777/base_IIXIV", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mainline777/base_IIXIV", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mainline777/base_IIXIV with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mainline777/base_IIXIV" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mainline777/base_IIXIV", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mainline777/base_IIXIV
- SGLang
How to use mainline777/base_IIXIV 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 "mainline777/base_IIXIV" \ --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": "mainline777/base_IIXIV", "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 "mainline777/base_IIXIV" \ --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": "mainline777/base_IIXIV", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mainline777/base_IIXIV with Docker Model Runner:
docker model run hf.co/mainline777/base_IIXIV
| # Copyright (c) 2023-2025, Songlin Yang, Yu Zhang | |
| import warnings | |
| import torch | |
| from fla.ops.simple_gla.parallel import parallel_simple_gla | |
| def parallel_retention( | |
| q: torch.Tensor, | |
| k: torch.Tensor, | |
| v: torch.Tensor, | |
| scale: float | None = None, | |
| output_attentions: bool = False, | |
| cu_seqlens: torch.LongTensor | None = None, | |
| head_first: bool = False, | |
| ) -> tuple[torch.Tensor, torch.Tensor]: | |
| r""" | |
| Args: | |
| q (torch.Tensor): | |
| queries of shape `[B, T, H, K]`. | |
| k (torch.Tensor): | |
| keys of shape `[B, T, H, K]`. | |
| v (torch.Tensor): | |
| values of shape `[B, T, H, V]`. | |
| scale (Optional[float]): | |
| Scale factor for attention scores. | |
| If not provided, it will default to `1 / sqrt(K)`. Default: `None`. | |
| output_attentions (bool): | |
| Whether to output the materialized attention scores of shape [B, H, T, T]. Default: `False`. | |
| cu_seqlens (torch.LongTensor): | |
| Cumulative sequence lengths of shape `[N+1]` used for variable-length training, | |
| consistent with the FlashAttention API. | |
| head_first (Optional[bool]): | |
| Whether the inputs are in the head-first format. Default: `False`. | |
| This argument has been deprecated. | |
| Returns: | |
| o (torch.Tensor): | |
| Outputs of shape `[B, T, H, V]`. | |
| attn (torch.Tensor): | |
| Attention scores of shape `[B, H, T, T]` if `output_attentions=True` else `None` | |
| """ | |
| if head_first: | |
| raise DeprecationWarning( | |
| "head_first is deprecated and will be removed in a future version. " | |
| "Please use head_first=False for now instead.", | |
| ) | |
| if not head_first and q.shape[1] < q.shape[2]: | |
| warnings.warn( | |
| f"Input tensor shape suggests potential format mismatch: seq_len ({q.shape[1]}) < num_heads ({q.shape[2]}). " | |
| "This may indicate the inputs were passed in head-first format [B, H, T, ...] " | |
| "when head_first=False was specified. " | |
| "Please verify your input tensor format matches the expected shape [B, T, H, ...].", | |
| ) | |
| s = (1 - q.new_tensor(2., dtype=torch.float).pow(-5. - q.new_tensor(range(q.shape[2]), dtype=torch.float))).log() | |
| g = s[None, None, :].expand(q.shape[0], q.shape[1], q.shape[2]) | |
| o, attn = parallel_simple_gla( | |
| q=q, | |
| k=k, | |
| v=v, | |
| scale=scale, | |
| g=g, | |
| output_attentions=output_attentions, | |
| cu_seqlens=cu_seqlens, | |
| ) | |
| return o, attn | |