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
- 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 ·
e095aa7
1
Parent(s): d6b7497
Updated readme.
Browse files
README.md
CHANGED
|
@@ -45,18 +45,18 @@ Using `pipeline`:
|
|
| 45 |
```python
|
| 46 |
from transformers import pipeline
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
)
|
| 54 |
|
| 55 |
prompt="The quick brown fox jumps over the lazy dog."
|
| 56 |
|
| 57 |
-
output=
|
| 58 |
-
|
| 59 |
-
|
| 60 |
print(output[0]["generated_text"])
|
| 61 |
```
|
| 62 |
|
|
|
|
| 45 |
```python
|
| 46 |
from transformers import pipeline
|
| 47 |
|
| 48 |
+
text_generator = pipeline(
|
| 49 |
+
task="text-generation",
|
| 50 |
+
model="fromthesky/PLDR-LLM-v51-110M-4",
|
| 51 |
+
device="cuda", # or "cpu"
|
| 52 |
+
trust_remote_code=True
|
| 53 |
+
)
|
| 54 |
|
| 55 |
prompt="The quick brown fox jumps over the lazy dog."
|
| 56 |
|
| 57 |
+
output=text_generator(prompt, top_p=0.6, top_k=0, temperature=1, do_sample=True,
|
| 58 |
+
tokenizer_encode_kwargs={"add_special_tokens":False},
|
| 59 |
+
use_cache=True, max_new_tokens=100)
|
| 60 |
print(output[0]["generated_text"])
|
| 61 |
```
|
| 62 |
|