Instructions to use Azurro/APT-1B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Azurro/APT-1B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Azurro/APT-1B-Base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Azurro/APT-1B-Base") model = AutoModelForCausalLM.from_pretrained("Azurro/APT-1B-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Azurro/APT-1B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Azurro/APT-1B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azurro/APT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Azurro/APT-1B-Base
- SGLang
How to use Azurro/APT-1B-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 "Azurro/APT-1B-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": "Azurro/APT-1B-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 "Azurro/APT-1B-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": "Azurro/APT-1B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Azurro/APT-1B-Base with Docker Model Runner:
docker model run hf.co/Azurro/APT-1B-Base
Commit ·
6b778ce
1
Parent(s): 869919c
Update README.md
Browse files
README.md
CHANGED
|
@@ -106,22 +106,38 @@ Our training dataset contains:
|
|
| 106 |
* Polish Wikipedia: 970 million tokens
|
| 107 |
* web crawl data: 813 million tokens
|
| 108 |
|
| 109 |
-
##
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
```python
|
| 116 |
-
import
|
| 117 |
-
|
|
|
|
| 118 |
```
|
| 119 |
|
| 120 |
-
|
| 121 |
|
| 122 |
```python
|
| 123 |
import transformers
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
```
|
| 126 |
|
| 127 |
## Limitations and Biases
|
|
|
|
| 106 |
* Polish Wikipedia: 970 million tokens
|
| 107 |
* web crawl data: 813 million tokens
|
| 108 |
|
| 109 |
+
### Quickstart
|
| 110 |
|
| 111 |
+
This model can be easily loaded using the AutoModelForCausalLM functionality.
|
| 112 |
|
| 113 |
+
```python
|
| 114 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 115 |
+
|
| 116 |
+
model_name = "Azurro/APT-1B-Base"
|
| 117 |
+
|
| 118 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 119 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
In order to reduce the memory usage, you can use smaller precision (`bfloat16`).
|
| 123 |
|
| 124 |
```python
|
| 125 |
+
import torch
|
| 126 |
+
|
| 127 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16)
|
| 128 |
```
|
| 129 |
|
| 130 |
+
And then you can use Hugging Face Pipelines to generate text.
|
| 131 |
|
| 132 |
```python
|
| 133 |
import transformers
|
| 134 |
+
|
| 135 |
+
text = "Najważniejszym celem człowieka na ziemi jest"
|
| 136 |
+
|
| 137 |
+
pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 138 |
+
sequences = pipeline(max_length=100, do_sample=True, top_k=10, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
|
| 139 |
+
for seq in sequences:
|
| 140 |
+
print(f"Result: {seq['generated_text']}")
|
| 141 |
```
|
| 142 |
|
| 143 |
## Limitations and Biases
|