Text Generation
Transformers
Safetensors
Chinese
English
granite
mixture-of-experts
Mixture of Experts
looped-transformer
recurrent-depth
attention-residuals
Instructions to use tysgydke/Granite-1B-LoopAttnRes with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tysgydke/Granite-1B-LoopAttnRes with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tysgydke/Granite-1B-LoopAttnRes")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tysgydke/Granite-1B-LoopAttnRes", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tysgydke/Granite-1B-LoopAttnRes with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tysgydke/Granite-1B-LoopAttnRes" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tysgydke/Granite-1B-LoopAttnRes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tysgydke/Granite-1B-LoopAttnRes
- SGLang
How to use tysgydke/Granite-1B-LoopAttnRes 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 "tysgydke/Granite-1B-LoopAttnRes" \ --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": "tysgydke/Granite-1B-LoopAttnRes", "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 "tysgydke/Granite-1B-LoopAttnRes" \ --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": "tysgydke/Granite-1B-LoopAttnRes", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tysgydke/Granite-1B-LoopAttnRes with Docker Model Runner:
docker model run hf.co/tysgydke/Granite-1B-LoopAttnRes
Download loop-g3-r2/config.json from tysgydke/Granite-1B-LoopAttnRes: direct link, hf CLI and curl.
- Browser
- Download file 998 Bytes
-
https://huggingface.co/tysgydke/Granite-1B-LoopAttnRes/resolve/main/loop-g3-r2/config.json
- Command line
-
hf download hf://tysgydke/Granite-1B-LoopAttnRes/loop-g3-r2/config.json
-
curl -L -o config.json https://huggingface.co/tysgydke/Granite-1B-LoopAttnRes/resolve/main/loop-g3-r2/config.json
998 Bytes
| { | |
| "architectures": [ | |
| "GraniteLoopForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attention_multiplier": 0.015625, | |
| "attnres": true, | |
| "attnres_blocks": 8, | |
| "bos_token_id": 0, | |
| "cross_round": true, | |
| "dtype": "bfloat16", | |
| "embedding_multiplier": 12.0, | |
| "eos_token_id": 0, | |
| "hidden_act": "silu", | |
| "hidden_size": 1024, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 512, | |
| "logits_scaling": 6.0, | |
| "loop_rounds": 4, | |
| "max_position_embeddings": 4096, | |
| "model_type": "granitemoe", | |
| "num_attention_heads": 16, | |
| "num_experts_per_tok": 8, | |
| "num_hidden_layers": 24, | |
| "num_key_value_heads": 8, | |
| "num_local_experts": 32, | |
| "output_router_logits": false, | |
| "pad_token_id": 0, | |
| "residual_multiplier": 0.22, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "rope_theta": 10000, | |
| "rope_type": "default" | |
| }, | |
| "router_aux_loss_coef": 0.001, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.14.1", | |
| "use_cache": true, | |
| "vocab_size": 49152 | |
| } | |