Text Generation
Transformers
Safetensors
PyTorch
English
pldrllm
large-language-model
power-law-decoder-representations
power-law-graph-attention
pldr-llm
kv-cache
g-cache
kvg-cache
custom_code
Instructions to use fromthesky/PLDR-LLM-v51-110M-4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fromthesky/PLDR-LLM-v51-110M-4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fromthesky/PLDR-LLM-v51-110M-4", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("fromthesky/PLDR-LLM-v51-110M-4", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fromthesky/PLDR-LLM-v51-110M-4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fromthesky/PLDR-LLM-v51-110M-4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fromthesky/PLDR-LLM-v51-110M-4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fromthesky/PLDR-LLM-v51-110M-4
- SGLang
How to use fromthesky/PLDR-LLM-v51-110M-4 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 "fromthesky/PLDR-LLM-v51-110M-4" \ --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": "fromthesky/PLDR-LLM-v51-110M-4", "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 "fromthesky/PLDR-LLM-v51-110M-4" \ --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": "fromthesky/PLDR-LLM-v51-110M-4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fromthesky/PLDR-LLM-v51-110M-4 with Docker Model Runner:
docker model run hf.co/fromthesky/PLDR-LLM-v51-110M-4
Commit ·
dda3ae4
1
Parent(s): e0f1b57
Updated readme.
Browse files
README.md
CHANGED
|
@@ -88,8 +88,8 @@ print(tokenizer.decode(generated_ids[0], skip_special_tokens=True))
|
|
| 88 |
|
| 89 |
- `reference_rope`: If set to `True`, RoPE implementation implemented in the original paper is used. This is the case for model pretrained in this repo. If set to `False`, RoPE implementation from the Huggingface Transformers library is used.
|
| 90 |
|
| 91 |
-
- `
|
| 92 |
-
the output of the residual metric learner (metric tensor,
|
| 93 |
|
| 94 |
See config.json for other model configuration details.
|
| 95 |
|
|
@@ -105,6 +105,7 @@ We also have a fork of transformers library with PLDR-LLM model support for futu
|
|
| 105 |
```python
|
| 106 |
git clone https://github.com/burcgokden/transformers
|
| 107 |
cd transformers
|
|
|
|
| 108 |
pip install -e ".[dev]"
|
| 109 |
```
|
| 110 |
- Static cache is not supported for models with `custom_G_type=None`.
|
|
|
|
| 88 |
|
| 89 |
- `reference_rope`: If set to `True`, RoPE implementation implemented in the original paper is used. This is the case for model pretrained in this repo. If set to `False`, RoPE implementation from the Huggingface Transformers library is used.
|
| 90 |
|
| 91 |
+
- `output_pldr_attentions=True` returns the deductive outputs and learnable parameters of power law graph attention module as tuple containing:
|
| 92 |
+
the output of the residual metric learner (metric tensor, **A**), output (**A<sub>LM</sub>**) after application of iSwiGLU on metric tensor, learned exponents of potential tensor, learned weights for energy-curvature tensor, learned bias for energy-curvature tensor, energy-curvature tensor (**G<sub>LM</sub>**), and attention weights.
|
| 93 |
|
| 94 |
See config.json for other model configuration details.
|
| 95 |
|
|
|
|
| 105 |
```python
|
| 106 |
git clone https://github.com/burcgokden/transformers
|
| 107 |
cd transformers
|
| 108 |
+
git checkout add_PLDR_LLM
|
| 109 |
pip install -e ".[dev]"
|
| 110 |
```
|
| 111 |
- Static cache is not supported for models with `custom_G_type=None`.
|