Text Generation
Transformers
Safetensors
Sanskrit
sansar
sanskrit
devanagari
slp1
causal-lm
base-model
custom_code
Eval Results (legacy)
Instructions to use MuseMesh/sansar-60m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MuseMesh/sansar-60m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MuseMesh/sansar-60m", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("MuseMesh/sansar-60m", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MuseMesh/sansar-60m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MuseMesh/sansar-60m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MuseMesh/sansar-60m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MuseMesh/sansar-60m
- SGLang
How to use MuseMesh/sansar-60m 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 "MuseMesh/sansar-60m" \ --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": "MuseMesh/sansar-60m", "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 "MuseMesh/sansar-60m" \ --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": "MuseMesh/sansar-60m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MuseMesh/sansar-60m with Docker Model Runner:
docker model run hf.co/MuseMesh/sansar-60m
Download configuration_sansar.py from MuseMesh/sansar-60m: direct link, hf CLI and curl.
- Browser
- Download file 2.79 kB
-
https://huggingface.co/MuseMesh/sansar-60m/resolve/main/configuration_sansar.py
- Command line
-
hf download hf://MuseMesh/sansar-60m/configuration_sansar.py
-
curl -L -o configuration_sansar.py https://huggingface.co/MuseMesh/sansar-60m/resolve/main/configuration_sansar.py
2.79 kB
| """Configuration of the Sansar Sanskrit language models (Muse Mesh). | |
| Code licence: Apache-2.0 (LICENSE-CODE). The model weights are licensed separately (LICENSE). | |
| """ | |
| from transformers import PretrainedConfig | |
| class SansarConfig(PretrainedConfig): | |
| """A compact pre-LayerNorm GPT. The flags select the two architectures the Sansar runs used: | |
| - ``rope=False, qk_norm=False, untied_head=False, relu_sq=False``: learned position table, GELU (tanh) MLP, output | |
| head tied to the token embedding (the E8 to F3 models). | |
| - ``rope=True, qk_norm=True, untied_head=True, relu_sq=True``: rotary positions, RMS-normalised queries and keys, | |
| a separate output head, squared-ReLU MLP (the F4 recipe and every model after it). | |
| ``value_embed`` and ``logit_cap`` are supported for completeness; no released model uses them. | |
| """ | |
| model_type = "sansar" | |
| attribute_map = { | |
| "hidden_size": "n_embd", | |
| "num_hidden_layers": "n_layer", | |
| "num_attention_heads": "n_head", | |
| "max_position_embeddings": "block_size", | |
| } | |
| def __init__( | |
| self, | |
| vocab_size: int = 8000, | |
| block_size: int = 512, | |
| n_layer: int = 6, | |
| n_head: int = 8, | |
| n_embd: int = 512, | |
| mlp_ratio: int = 4, | |
| bias: bool = False, | |
| rope: bool = False, | |
| rope_theta: float = 10000.0, | |
| qk_norm: bool = False, | |
| untied_head: bool = False, | |
| relu_sq: bool = False, | |
| value_embed: bool = False, | |
| value_embed_layers: str = "", | |
| logit_cap: float = 0.0, | |
| layer_norm_eps: float = 1e-5, | |
| initializer_range: float = 0.02, | |
| bos_token_id: int = 1, | |
| eos_token_id: int = 2, | |
| pad_token_id: int = 2, | |
| tie_word_embeddings=None, | |
| use_cache: bool = False, | |
| **kwargs, | |
| ): | |
| self.vocab_size = vocab_size | |
| self.block_size = block_size | |
| self.n_layer = n_layer | |
| self.n_head = n_head | |
| self.n_embd = n_embd | |
| self.mlp_ratio = mlp_ratio | |
| self.bias = bias | |
| self.rope = rope | |
| self.rope_theta = rope_theta | |
| self.qk_norm = qk_norm | |
| self.untied_head = untied_head | |
| self.relu_sq = relu_sq | |
| self.value_embed = value_embed | |
| self.value_embed_layers = value_embed_layers | |
| self.logit_cap = logit_cap | |
| self.layer_norm_eps = layer_norm_eps | |
| self.initializer_range = initializer_range | |
| self.use_cache = use_cache | |
| if tie_word_embeddings is None: | |
| tie_word_embeddings = not untied_head | |
| super().__init__( | |
| bos_token_id=bos_token_id, | |
| eos_token_id=eos_token_id, | |
| pad_token_id=pad_token_id, | |
| tie_word_embeddings=tie_word_embeddings, | |
| **kwargs, | |
| ) | |