Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- pl
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- finetuned
|
| 8 |
+
- gguf
|
| 9 |
+
- 8bit
|
| 10 |
+
inference: false
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
base_model: speakleash/Bielik-11B-v2.3-Instruct
|
| 13 |
+
---
|
| 14 |
+
<p align="center">
|
| 15 |
+
<img src="https://huggingface.co/speakleash/Bielik-7B-Instruct-v0.1-GGUF/raw/main/speakleash_cyfronet.png">
|
| 16 |
+
</p>
|
| 17 |
+
|
| 18 |
+
# Bielik-11B-v2.2-Instruct-FP8
|
| 19 |
+
|
| 20 |
+
This model was obtained by quantizing the weights and activations of [Bielik-11B-v.2.3-Instruct](https://huggingface.co/speakleash/Bielik-11B-v2.3-Instruct) to FP8 data type, ready for inference with vLLM >= 0.5.0 or SGLang.
|
| 21 |
+
AutoFP8 is used for quantization. This optimization reduces the number of bits per parameter from 16 to 8, reducing the disk size and GPU memory requirements by approximately 50%.
|
| 22 |
+
Only the weights and activations of the linear operators within transformers blocks are quantized. Symmetric per-tensor quantization is applied, in which a single linear scaling maps the FP8 representations of the quantized weights and activations.
|
| 23 |
+
|
| 24 |
+
FP8 compuation is supported on Nvidia GPUs with compute capability > 8.9 (Ada Lovelace, Hopper).
|
| 25 |
+
|
| 26 |
+
**DISCLAIMER: Be aware that quantised models show reduced response quality and possible hallucinations!**
|
| 27 |
+
|
| 28 |
+
## Use with vLLM
|
| 29 |
+
|
| 30 |
+
This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below.
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from vllm import LLM, SamplingParams
|
| 34 |
+
from transformers import AutoTokenizer
|
| 35 |
+
|
| 36 |
+
model_id = "speakleash/Bielik-11B-v2.3-Instruct-FP8"
|
| 37 |
+
|
| 38 |
+
sampling_params = SamplingParams(temperature=0.2, top_p=0.95, max_tokens=4096)
|
| 39 |
+
|
| 40 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 41 |
+
|
| 42 |
+
messages = [
|
| 43 |
+
{"role": "system", "content": "Jesteś pomocnym asystentem Bielik."},
|
| 44 |
+
{"role": "user", "content": "Kim był Mikołaj Kopernik i z czego zasłynął?"},
|
| 45 |
+
]
|
| 46 |
+
|
| 47 |
+
prompts = tokenizer.apply_chat_template(messages, tokenize=False)
|
| 48 |
+
|
| 49 |
+
llm = LLM(model=model_id, max_model_len=4096)
|
| 50 |
+
|
| 51 |
+
outputs = llm.generate(prompts, sampling_params)
|
| 52 |
+
|
| 53 |
+
generated_text = outputs[0].outputs[0].text
|
| 54 |
+
print(generated_text)
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
vLLM aslo supports OpenAI-compatible serving. See the [documentation](https://docs.vllm.ai/en/latest/) for more details.
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
## Use with SGLang Runtime
|
| 61 |
+
Launch a server of SGLang Runtime:
|
| 62 |
+
|
| 63 |
+
```
|
| 64 |
+
python -m sglang.launch_server --model-path speakleash/Bielik-11B-v2.3-Instruct-FP8 --port 30000
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
Then you can send http request or use OpenAI Compatible API.
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
import openai
|
| 71 |
+
client = openai.Client(
|
| 72 |
+
base_url="http://127.0.0.1:30000/v1", api_key="EMPTY")
|
| 73 |
+
|
| 74 |
+
response = client.chat.completions.create(
|
| 75 |
+
model="default",
|
| 76 |
+
messages=[
|
| 77 |
+
{"role": "system", "content": "Jesteś pomocnym asystentem Bielik."},
|
| 78 |
+
{"role": "user", "content": "Kim był Mikołaj Kopernik i z czego zasłynął?"},
|
| 79 |
+
],
|
| 80 |
+
temperature=0,
|
| 81 |
+
max_tokens=4096,
|
| 82 |
+
)
|
| 83 |
+
print(response)
|
| 84 |
+
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
### Model description:
|
| 88 |
+
|
| 89 |
+
* **Developed by:** [SpeakLeash](https://speakleash.org/) & [ACK Cyfronet AGH](https://www.cyfronet.pl/)
|
| 90 |
+
* **Language:** Polish
|
| 91 |
+
* **Model type:** causal decoder-only
|
| 92 |
+
* **Quant from:** [Bielik-11B-v2.3-Instruct](https://huggingface.co/speakleash/Bielik-11B-v2.3-Instruct)
|
| 93 |
+
* **Finetuned from:** [Bielik-11B-v2](https://huggingface.co/speakleash/Bielik-11B-v2)
|
| 94 |
+
* **License:** Apache 2.0 and [Terms of Use](https://bielik.ai/terms/)
|
| 95 |
+
|
| 96 |
+
### Responsible for model quantization
|
| 97 |
+
* [Remigiusz Kinas](https://www.linkedin.com/in/remigiusz-kinas/)<sup>SpeakLeash</sup> - team leadership, conceptualizing, calibration data preparation, process creation and quantized model delivery.
|
| 98 |
+
|
| 99 |
+
## Contact Us
|
| 100 |
+
|
| 101 |
+
If you have any questions or suggestions, please use the discussion tab. If you want to contact us directly, join our [Discord SpeakLeash](https://discord.gg/CPBxPce4).
|