モデル概要
モデル特徴
モデル能力
使用事例
🚀 Deepseek Coder 6.7B Instruct - AWQ
このモデルは、DeepSeek社によって開発されたDeepseek Coder 6.7B InstructをAWQ方式で量子化したものです。高速で高精度な推論が可能で、複数の環境での利用がサポートされています。
🚀 クイックスタート
このセクションでは、Deepseek Coder 6.7B Instruct - AWQモデルの基本的な使い方を説明します。
モデルのダウンロードと利用
text-generation-webuiを使って簡単にモデルをダウンロードし、利用する方法を紹介します。
- 最新バージョンのtext-generation-webuiを使用していることを確認してください。
- Model tabをクリックします。
- Download custom model or LoRAの下に、
TheBloke/deepseek-coder-6.7B-instruct-AWQ
を入力します。 - Downloadをクリックします。
- モデルのダウンロードが完了すると、"Done"と表示されます。
- 左上のModelの横にある更新アイコンをクリックします。
- Modelのドロップダウンメニューから、先ほどダウンロードしたモデル
deepseek-coder-6.7B-instruct-AWQ
を選択します。 - Loader: AutoAWQを選択します。
- Loadをクリックすると、モデルがロードされ、使用可能になります。
- 必要な設定を行ったら、Save settings for this modelをクリックし、右上のReload the Modelをクリックします。
- 準備ができたら、Text Generationタブをクリックし、プロンプトを入力して始めましょう!
✨ 主な機能
AWQ量子化
AWQは、効率的で高精度かつ高速な低ビット量子化手法です。現在、4ビット量子化をサポートしており、GPTQと比較して、同等以上の品質で、Transformerベースの推論を高速化することができます。
複数環境サポート
このモデルは、以下の環境での利用がサポートされています。
- Text Generation Webui - Loader: AutoAWQ
- vLLM - LlamaとMistralモデルのみ
- Hugging Face Text Generation Inference (TGI)
- AutoAWQ - Pythonコードからの利用
📦 インストール
text-generation-webuiを使用する場合
上述のクイックスタートセクションを参照してください。
Pythonコードから使用する場合
AutoAWQパッケージをインストールする必要があります。
pip3 install autoawq
もし、プレビルドのホイールを使用してAutoAWQをインストールする際に問題がある場合は、ソースからインストールしてください。
pip3 uninstall -y autoawq
git clone https://github.com/casper-hansen/AutoAWQ
cd AutoAWQ
pip3 install .
💻 使用例
基本的な使用法
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer
model_name_or_path = "TheBloke/deepseek-coder-6.7B-instruct-AWQ"
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
# Load model
model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
trust_remote_code=False, safetensors=True)
prompt = "Tell me about AI"
prompt_template=f'''You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer.
### Instruction:
{prompt}
### Response:
'''
print("*** Running model.generate:")
token_input = tokenizer(
prompt_template,
return_tensors='pt'
).input_ids.cuda()
# Generate output
generation_output = model.generate(
token_input,
do_sample=True,
temperature=0.7,
top_p=0.95,
top_k=40,
max_new_tokens=512
)
# Get the tokens from the output, decode them, print them
token_output = generation_output[0]
text_output = tokenizer.decode(token_output)
print("LLM output: ", text_output)
高度な使用法
from vllm import LLM, SamplingParams
prompts = [
"Tell me about AI",
"Write a story about llamas",
"What is 291 - 150?",
"How much wood would a woodchuck chuck if a woodchuck could chuck wood?",
]
prompt_template=f'''You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer.
### Instruction:
{prompt}
### Response:
'''
prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(model="TheBloke/deepseek-coder-6.7B-instruct-AWQ", quantization="awq", dtype="auto")
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
📚 詳細ドキュメント
プロンプトテンプレート
You are an AI programming assistant, utilizing the Deepseek Coder model, developed by Deepseek Company, and you only answer questions related to computer science. For politically sensitive questions, security and privacy issues, and other non-computer science questions, you will refuse to answer.
### Instruction:
{prompt}
### Response:
提供されているファイルとAWQパラメータ
初回のAWQモデルリリースでは、128gモデルのみをリリースしています。関心があれば32gモデルも追加する予定ですが、現時点では32gモデルはAutoAWQとvLLMで完全にテストされていません。
モデルは、シャーディングされたsafetensorsファイルとしてリリースされています。
ブランチ | ビット数 | GS | AWQデータセット | シーケンス長 | サイズ |
---|---|---|---|---|---|
main | 4 | 128 | Evol Instruct Code | 16384 | 3.89 GB |
互換性
提供されているファイルは、以下の環境で動作することがテストされています。
- text-generation-webui -
Loader: AutoAWQ
を使用 - vLLMバージョン0.2.0以降
- Hugging Face Text Generation Inference (TGI)バージョン1.1.0以降
- AutoAWQバージョン0.1.1以降
🔧 技術詳細
AWQ量子化手法
AWQは、低ビット量子化手法の一つで、Transformerベースのモデルの推論を高速化することができます。4ビット量子化をサポートしており、GPTQと比較して、同等以上の品質で高速な推論を実現します。
モデルのトレーニングデータ
このモデルは、Evol Instruct Codeデータセットを使用してトレーニングされています。
📄 ライセンス
このモデルのライセンスは、DeepSeekによって提供されています。詳細はLICENSEを参照してください。
Discord
これらのモデルやAI全般に関するさらなるサポートや議論に参加するには、以下のDiscordサーバーに参加してください。
謝辞と寄付方法
chirper.aiチームに感謝します!
gpus.llm-utils.orgのClayに感謝します!
多くの人から寄付の可否を尋ねられています。私はモデルを提供し、人々の助けをすることが好きで、もっと多くの時間を費やし、微調整/トレーニングなどの新しいプロジェクトにも挑戦したいと思っています。
寄付できる方は、大歓迎です。寄付いただくと、AI/LLM/モデルに関する質問やリクエストに対する優先サポート、プライベートDiscordルームへのアクセスなどの特典を受けることができます。
- Patreon: https://patreon.com/TheBlokeAI
- Ko-Fi: https://ko-fi.com/TheBlokeAI
特別な感謝: Aemon Algiz
Patreonでの特別な言及: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
すべての寛大なパトロンと寄付者の皆様に感謝します!
そして、a16zの寛大な助成に再度感謝します。



