Text Generation
Transformers
Safetensors
English
looplm
looped-transformer
language-model
research
from-scratch
custom_code
Instructions to use harims95/LoopLM-135M-naive with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harims95/LoopLM-135M-naive with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="harims95/LoopLM-135M-naive", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("harims95/LoopLM-135M-naive", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use harims95/LoopLM-135M-naive with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "harims95/LoopLM-135M-naive" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "harims95/LoopLM-135M-naive", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/harims95/LoopLM-135M-naive
- SGLang
How to use harims95/LoopLM-135M-naive 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 "harims95/LoopLM-135M-naive" \ --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": "harims95/LoopLM-135M-naive", "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 "harims95/LoopLM-135M-naive" \ --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": "harims95/LoopLM-135M-naive", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use harims95/LoopLM-135M-naive with Docker Model Runner:
docker model run hf.co/harims95/LoopLM-135M-naive
| { | |
| "model_type": "looplm", | |
| "architectures": ["LoopLMForCausalLM"], | |
| "auto_map": { | |
| "AutoConfig": "configuration_looplm.LoopLMConfig", | |
| "AutoModelForCausalLM": "modeling_looplm.LoopLMForCausalLM" | |
| }, | |
| "vocab_size": 50304, | |
| "d_model": 1024, | |
| "n_prelude": 4, | |
| "n_coda": 2, | |
| "mu_rec": 6, | |
| "n_q_heads": 16, | |
| "n_kv_heads": 8, | |
| "head_dim": 64, | |
| "qk_norm": true, | |
| "rope_theta": 10000.0, | |
| "dense_ffn": 2816, | |
| "tie_embeddings": true, | |
| "final_z_loss_coef": 0.0001, | |
| "use_a_matrix": false, | |
| "use_input_norm": false, | |
| "init_std": 0.02, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.40.0" | |
| } | |