Instructions to use PanocularAI/PanoLM-380M-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PanocularAI/PanoLM-380M-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PanocularAI/PanoLM-380M-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("PanocularAI/PanoLM-380M-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PanocularAI/PanoLM-380M-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PanocularAI/PanoLM-380M-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PanocularAI/PanoLM-380M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PanocularAI/PanoLM-380M-Base
- SGLang
How to use PanocularAI/PanoLM-380M-Base 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 "PanocularAI/PanoLM-380M-Base" \ --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": "PanocularAI/PanoLM-380M-Base", "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 "PanocularAI/PanoLM-380M-Base" \ --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": "PanocularAI/PanoLM-380M-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PanocularAI/PanoLM-380M-Base with Docker Model Runner:
docker model run hf.co/PanocularAI/PanoLM-380M-Base
Upload folder using huggingface_hub
Browse files- README.md +17 -12
- chat_template.jinja +5 -0
- sharded/shard-00001-model-00001-of-00001.safetensors +1 -1
README.md
CHANGED
|
@@ -6,13 +6,17 @@ language:
|
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
tags:
|
| 8 |
- panolm
|
| 9 |
-
-
|
| 10 |
- linear-attention
|
| 11 |
---
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
## Training Data
|
| 14 |
|
| 15 |
-
Pretrained on
|
| 16 |
|
| 17 |
| Weight | Dataset |
|
| 18 |
|-------:|------------------------|
|
|
@@ -30,11 +34,14 @@ flash-linear-attention==0.5.0
|
|
| 30 |
|
| 31 |
## Usage
|
| 32 |
|
|
|
|
|
|
|
| 33 |
```python
|
| 34 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 35 |
|
|
|
|
| 36 |
model = AutoModelForCausalLM.from_pretrained(
|
| 37 |
-
|
| 38 |
trust_remote_code=True,
|
| 39 |
).cuda() # fla's RMSNorm uses Triton kernels that only run on CUDA tensors.
|
| 40 |
print(model)
|
|
@@ -47,9 +54,7 @@ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
|
| 47 |
outputs = model.generate(
|
| 48 |
**inputs,
|
| 49 |
max_length=512,
|
| 50 |
-
|
| 51 |
-
top_k=50,
|
| 52 |
-
top_p=1.0,
|
| 53 |
use_cache=False,
|
| 54 |
do_sample=True,
|
| 55 |
trust_remote_code=True,
|
|
@@ -79,9 +84,9 @@ metric the suite was designed around.
|
|
| 79 |
|
| 80 |
| Task | Metric | Value |
|
| 81 |
|----------------|----------|-------:|
|
| 82 |
-
|
|
| 83 |
-
|
|
| 84 |
-
|
|
| 85 |
-
|
|
| 86 |
-
|
|
| 87 |
-
|
|
|
|
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
tags:
|
| 8 |
- panolm
|
| 9 |
+
- kda
|
| 10 |
- linear-attention
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# PanoLM-380M
|
| 14 |
+
|
| 15 |
+
This repo contains the base 370M PanoLM model, which is a linear-attention causal language.
|
| 16 |
+
|
| 17 |
## Training Data
|
| 18 |
|
| 19 |
+
Pretrained on a weighted mixture of three web-scale English corpora:
|
| 20 |
|
| 21 |
| Weight | Dataset |
|
| 22 |
|-------:|------------------------|
|
|
|
|
| 34 |
|
| 35 |
## Usage
|
| 36 |
|
| 37 |
+
Replace `<repo_id>` with the HF Hub identifier (e.g. `your-org/PanoLM-370M`).
|
| 38 |
+
|
| 39 |
```python
|
| 40 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 41 |
|
| 42 |
+
repo_id = "<repo_id>"
|
| 43 |
model = AutoModelForCausalLM.from_pretrained(
|
| 44 |
+
repo_id,
|
| 45 |
trust_remote_code=True,
|
| 46 |
).cuda() # fla's RMSNorm uses Triton kernels that only run on CUDA tensors.
|
| 47 |
print(model)
|
|
|
|
| 54 |
outputs = model.generate(
|
| 55 |
**inputs,
|
| 56 |
max_length=512,
|
| 57 |
+
top_k=10,
|
|
|
|
|
|
|
| 58 |
use_cache=False,
|
| 59 |
do_sample=True,
|
| 60 |
trust_remote_code=True,
|
|
|
|
| 84 |
|
| 85 |
| Task | Metric | Value |
|
| 86 |
|----------------|----------|-------:|
|
| 87 |
+
| based_drop | contains | 0.2286 |
|
| 88 |
+
| based_fda | contains | 0.0499 |
|
| 89 |
+
| based_nq_2048 | contains | 0.0687 |
|
| 90 |
+
| based_squadv2 | contains | 0.3542 |
|
| 91 |
+
| based_swde | contains | 0.2439 |
|
| 92 |
+
| based_triviaqa | contains | 0.4680 |
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% if messages[0]['role'] != 'system' %}{{ 'A chat between a curious user and an artificial intelligence assistant. The
|
| 2 |
+
assistant gives helpful, detailed, and polite answers to the user\'s questions. ' }}{% endif %}{% for message in
|
| 3 |
+
messages %}{% if message['role'] == 'system' %}{{ message['content'] + ' ' }}{% elif message['role'] == 'user' %}{{
|
| 4 |
+
'USER: ' + message['content'] + ' ' }}{% elif message['role'] == 'assistant' %}{{ 'ASSISTANT: ' + message['content'] +
|
| 5 |
+
'</s>' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ 'ASSISTANT: ' }}{% endif %}
|
sharded/shard-00001-model-00001-of-00001.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1549115704
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd0946e12a7ea0d51a3d1f827d07325d1e3e3fbca73b54d73398eb5955d7983d
|
| 3 |
size 1549115704
|