Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama2
|
3 |
+
---
|
4 |
+
# japanese-stablelm-base-ja_vocab-beta-7b-GPTQ-calib-ja-1k
|
5 |
+
[stabilityaiさんが公開しているjapanese-stablelm-base-ja_vocab-beta-7b](https://huggingface.co/stabilityai/japanese-stablelm-base-ja_vocab-beta-7b)を
|
6 |
+
日本語のキャリブレーションセットで生成したGPTQモデルになります。
|
7 |
+
|
8 |
+
キャリブレーションセットは[izumi-lab/wikipedia-ja-20230720](https://huggingface.co/datasets/izumi-lab/wikipedia-ja-20230720)から、
|
9 |
+
1kほどランダムサンプリングしたものと、
|
10 |
+
[ELYZA-tasks-100](https://huggingface.co/datasets/elyza/ELYZA-tasks-100)のinput/outputを計200ほど追加しています。
|
11 |
+
[mmnga/wikipedia-ja-20230720-1k](https://huggingface.co/datasets/mmnga/wikipedia-ja-20230720-1k)
|
12 |
+
|
13 |
+
モデル一覧
|
14 |
+
GPTQ
|
15 |
+
[mmnga/japanese-stablelm-base-ja_vocab-beta-7b-GPTQ-calib-ja-1k](https://huggingface.co/mmnga/japanese-stablelm-base-ja_vocab-beta-7b-GPTQ-calib-ja-1k)
|
16 |
+
[mmnga/japanese-stablelm-instruct-ja_vocab-beta-7b-GPTQ-calib-ja-1k](https://huggingface.co/mmnga/japanese-stablelm-instruct-ja_vocab-beta-7b-GPTQ-calib-ja-1k)
|
17 |
+
|
18 |
+
GGUF
|
19 |
+
[mmnga/japanese-stablelm-base-ja_vocab-beta-7b-gguf](https://huggingface.co/mmnga/japanese-stablelm-base-ja_vocab-beta-7b-gguf)
|
20 |
+
[mmnga/japanese-stablelm-instruct-ja_vocab-beta-7b-gguf](https://huggingface.co/mmnga/japanese-stablelm-instruct-ja_vocab-beta-7b-gguf)
|
21 |
+
|
22 |
+
## Usage
|
23 |
+
|
24 |
+
~~~Bash
|
25 |
+
pip install auto-gptq==0.4.2 transformers
|
26 |
+
~~~
|
27 |
+
|
28 |
+
~~~python
|
29 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
30 |
+
from transformers import AutoTokenizer
|
31 |
+
|
32 |
+
model_name_or_path = "mmnga/japanese-stablelm-base-ja_vocab-beta-7b-GPTQ-calib-ja-1k"
|
33 |
+
|
34 |
+
# Tokenizer
|
35 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
|
36 |
+
|
37 |
+
# Model
|
38 |
+
model = AutoGPTQForCausalLM.from_quantized(model_name_or_path, use_safetensors=True, device="cuda:0")
|
39 |
+
|
40 |
+
# Your test prompt
|
41 |
+
prompt = """今日の夕食のレシピをご紹介します。"""
|
42 |
+
print(tokenizer.decode(model.generate(**tokenizer(prompt, return_tensors="pt").to(model.device), max_length=128)[0]))
|
43 |
+
~~~
|