kishizaki-sci commited on
Commit
958af28
·
verified ·
1 Parent(s): c889139

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +66 -3
README.md CHANGED
@@ -1,3 +1,66 @@
1
- ---
2
- license: llama3.1
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ base_model:
4
+ - meta-llama/Llama-3.1-405B-Instruct
5
+ language:
6
+ - ja
7
+ - en
8
+ pipeline_tag: text-generation
9
+ library_name: transformers
10
+ tags:
11
+ - llama-3
12
+ - pytorch
13
+ - llama-3.1
14
+ - autoawq
15
+ - meta
16
+ ---
17
+ # kishizaki-sci/Llama-3.1-405B-Instruct-AWQ-4bit-JP-EN
18
+
19
+ ## model information
20
+ [Llama-3.1-405B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-405B-Instruct)を[AutoAWQ](https://github.com/casper-hansen/AutoAWQ)で4bit 量子化したモデル。量子化の際のキャリブレーションデータに日本語と英語を含むデータを使用。
21
+ A model of Llama-3.1-405B-Instruct quantized to 4 bits using AutoAWQ. Calibration data containing Japanese and English was used during the quantization process.
22
+
23
+ ## usage
24
+
25
+ ### vLLM
26
+ ```python
27
+ from vllm import LLM, SamplingParams
28
+ llm = LLM(
29
+ model="kishizaki-sci/Llama-3.1-405B-Instruct-AWQ-4bit-JP-EN",
30
+ tensor_parallel_size=4,
31
+ gpu_memory_utilization=0.97,
32
+ quantization="awq"
33
+ )
34
+ tokenizer = llm.get_tokenizer()
35
+ messages = [
36
+ {"role": "system", "content": "あなたは日本語で応答するAIチャットボットです。ユーザをサポートしてください。"},
37
+ {"role": "user", "content": "plotly.graph_objectsを使って散布図を作るサンプルコードを書いてください。"},
38
+ ]
39
+ prompt = tokenizer.apply_chat_template(
40
+ messages,
41
+ tokenize=False,
42
+ add_generation_prompt=True
43
+ )
44
+ sampling_params = SamplingParams(
45
+ temperature=0.6,
46
+ top_p=0.9,
47
+ max_tokens=1024
48
+ )
49
+ outputs = llm.generate(prompt, sampling_params)
50
+ print(outputs[0].outputs[0].text)
51
+ ```
52
+ H100 (94GB)を4基積んだインスタンスでの実行はこちらの[notebook](https://huggingface.co/kishizaki-sci/Llama-3.1-405B-Instruct-AWQ-4bit-JP-EN/blob/main/inference_vLLM.ipynb)をご覧ください。
53
+ Please refer to this notebook for execution on an instance equipped with a four H100 (94GB).
54
+
55
+ ## calibration data
56
+ 以下のデータセットから512個のデータ,プロンプトを抽出。1つのデータのトークン数は最大350制限。
57
+ Extract 512 data points and prompts from the following dataset. The maximum token limit per data point is 350.
58
+ - [TFMC/imatrix-dataset-for-japanese-llm](https://huggingface.co/datasets/TFMC/imatrix-dataset-for-japanese-llm)
59
+ - [meta-math/MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA)
60
+ - [m-a-p/CodeFeedback-Filtered-Instruction](https://huggingface.co/datasets/m-a-p/CodeFeedback-Filtered-Instruction)
61
+ - [kunishou/databricks-dolly-15k-ja](https://huggingface.co/datasets/kunishou/databricks-dolly-15k-ja)
62
+ - その他日本語版・英語版のwikipedia記事から作成したオリジナルデータ,有害プロンプト回避のためのオリジナルデータを使用。 Original data created from Japanese and English Wikipedia articles, as well as original data for avoiding harmful prompts, is used.
63
+
64
+ ## License
65
+ [MIT License](https://opensource.org/license/mit)を適用する。ただし量子化のベースモデルに適用されている[Llama 3.1 Community License Agreement](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE)に従ってください。
66
+ The MIT License is applied. However, obey the Llama 3.1 Community License Agreement applied to the base model of quantization.