Remek commited on
Commit
1b35365
·
verified ·
1 Parent(s): a919172

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +99 -0
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ---
13
+ <p align="center">
14
+ <img src="https://huggingface.co/speakleash/Bielik-7B-Instruct-v0.1-GGUF/raw/main/speakleash_cyfronet.png">
15
+ </p>
16
+
17
+ # Bielik-11B-v2.2-Instruct-W8A8
18
+
19
+ This model was obtained by quantizing the weights and activations of [Bielik-11B-v.2.2-Instruct](https://huggingface.co/speakleash/Bielik-11B-v2.2-Instruct) to W8A8 (int8) data type, ready for inference with vLLM >= 0.5.0.
20
+ 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%.
21
+ 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.
22
+
23
+ FP8 compuation is supported on Nvidia GPUs with compute capability > 8.9 (Ada Lovelace, Hopper).
24
+
25
+
26
+ ## Use with vLLM
27
+
28
+ This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below.
29
+
30
+ ```python
31
+ from vllm import LLM, SamplingParams
32
+ from transformers import AutoTokenizer
33
+
34
+ model_id = "speakleash/Bielik-11B-v2.2-Instruct-FP8"
35
+
36
+ sampling_params = SamplingParams(temperature=0.2, top_p=0.95, max_tokens=4096)
37
+
38
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
39
+
40
+ messages = [
41
+ {"role": "system", "content": "Jesteś pomocnym asystentem Bielik."},
42
+ {"role": "user", "content": "Kim był Mikołaj Kopernik i z czego zasłynął?"},
43
+ ]
44
+
45
+ prompts = tokenizer.apply_chat_template(messages, tokenize=False)
46
+
47
+ llm = LLM(model=model_id, max_model_len=4096)
48
+
49
+ outputs = llm.generate(prompts, sampling_params)
50
+
51
+ generated_text = outputs[0].outputs[0].text
52
+ print(generated_text)
53
+ ```
54
+
55
+ vLLM aslo supports OpenAI-compatible serving. See the [documentation](https://docs.vllm.ai/en/latest/) for more details.
56
+
57
+
58
+ ## Use with SGLang Runtime
59
+ Launch a server of SGLang Runtime:
60
+
61
+ ```
62
+ python -m sglang.launch_server --model-path speakleash/Bielik-11B-v2.2-Instruct-FP8 --port 30000
63
+ ```
64
+
65
+ Then you can send http request or use OpenAI Compatible API.
66
+
67
+ ```python
68
+ import openai
69
+ client = openai.Client(
70
+ base_url="http://127.0.0.1:30000/v1", api_key="EMPTY")
71
+
72
+ response = client.chat.completions.create(
73
+ model="default",
74
+ messages=[
75
+ {"role": "system", "content": "Jesteś pomocnym asystentem Bielik."},
76
+ {"role": "user", "content": "Kim był Mikołaj Kopernik i z czego zasłynął?"},
77
+ ],
78
+ temperature=0,
79
+ max_tokens=4096,
80
+ )
81
+ print(response)
82
+
83
+ ```
84
+
85
+ ### Model description:
86
+
87
+ * **Developed by:** [SpeakLeash](https://speakleash.org/) & [ACK Cyfronet AGH](https://www.cyfronet.pl/)
88
+ * **Language:** Polish
89
+ * **Model type:** causal decoder-only
90
+ * **Quant from:** [Bielik-11B-v2.2-Instruct](https://huggingface.co/speakleash/Bielik-11B-v2.2-Instruct)
91
+ * **Finetuned from:** [Bielik-11B-v2](https://huggingface.co/speakleash/Bielik-11B-v2)
92
+ * **License:** apache-2.0
93
+
94
+ ### Responsible for model quantization
95
+ * [Remigiusz Kinas](https://www.linkedin.com/in/remigiusz-kinas/)<sup>SpeakLeash</sup> - team leadership, conceptualizing, calibration data preparation, process creation and quantized model delivery.
96
+
97
+ ## Contact Us
98
+
99
+ 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).