Instructions to use LouisML/tinyllama_32k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LouisML/tinyllama_32k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LouisML/tinyllama_32k")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LouisML/tinyllama_32k") model = AutoModelForCausalLM.from_pretrained("LouisML/tinyllama_32k") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LouisML/tinyllama_32k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LouisML/tinyllama_32k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LouisML/tinyllama_32k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LouisML/tinyllama_32k
- SGLang
How to use LouisML/tinyllama_32k 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 "LouisML/tinyllama_32k" \ --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": "LouisML/tinyllama_32k", "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 "LouisML/tinyllama_32k" \ --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": "LouisML/tinyllama_32k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LouisML/tinyllama_32k with Docker Model Runner:
docker model run hf.co/LouisML/tinyllama_32k
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,7 +10,20 @@ tags:
|
|
| 10 |
---
|
| 11 |
# TinyLlama-1.1B-32k
|
| 12 |
|
| 13 |
-
#### NOTE: This is a fork of the original model at https://huggingface.co/Doctor-Shotgun/TinyLlama-1.1B-32k but with fixed safetensors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
32k context finetune of TinyLlama-1.1B using increased rope theta (rope frequency base) meant to serve as a long-context speculative decoding model.
|
| 16 |
|
|
|
|
| 10 |
---
|
| 11 |
# TinyLlama-1.1B-32k
|
| 12 |
|
| 13 |
+
#### NOTE: This is a fork of the original model at https://huggingface.co/Doctor-Shotgun/TinyLlama-1.1B-32k but with fixed safetensors metadata using the following code:
|
| 14 |
+
|
| 15 |
+
```
|
| 16 |
+
import safetensors
|
| 17 |
+
from safetensors.torch import save_file
|
| 18 |
+
|
| 19 |
+
tensors = dict()
|
| 20 |
+
with safetensors.safe_open(safetensors_path, framework="pt") as f:
|
| 21 |
+
for key in f.keys():
|
| 22 |
+
tensors[key] = f.get_tensor(key)
|
| 23 |
+
|
| 24 |
+
save_file(tensors, safetensors_path, metadata={'format': 'pt'})
|
| 25 |
+
```
|
| 26 |
+
(from https://huggingface.co/SeaLLMs/SeaLLM-7B-Hybrid/discussions/2#65752144412ee70185d49ff5)
|
| 27 |
|
| 28 |
32k context finetune of TinyLlama-1.1B using increased rope theta (rope frequency base) meant to serve as a long-context speculative decoding model.
|
| 29 |
|