base_model: cognitivecomputations/dolphin-2.7-mixtral-8x7b
datasets:
-
ehartford/dolphin
-
jondurbin/airoboros-2.2.1
-
ehartford/dolphin-coder
-
teknium/openhermes
-
ise-uiuc/Magicoder-OSS-Instruct-75K
-
ise-uiuc/Magicoder-Evol-Instruct-110K
-
LDJnr/Capybara
inference: false
language:
-
en
license: apache-2.0
model_creator: Cognitive Computations
model_name: Dolphin 2.7 Mixtral 8X7B
model_type: mixtral
prompt_template: '<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
'
quantized_by: TheBloke
Dolphin 2.7 Mixtral 8X7B - AWQ
描述
此仓库包含Cognitive Computations的Dolphin 2.7 Mixtral 8X7B的AWQ模型文件。
这些文件由Massed Compute慷慨提供的硬件进行量化。
MIXTRAL AWQ
这是一个Mixtral AWQ模型。
对于AutoAWQ推理,请安装AutoAWQ 0.1.8或更高版本。
Transformers也支持,但目前需要从Github安装Transformers:pip3 install git+https://github.com/huggingface/transformers.git
vLLM:确认版本0.2.6支持Mixtral AWQs。
TGI:我测试了版本1.3.3,它加载模型正常,但无法获取任何输出。需要进一步测试/调试。(如果你让它工作了,请告诉我!)
关于AWQ
AWQ是一种高效、准确且极速的低比特权重量化方法,目前支持4位量化。与GPTQ相比,它在基于Transformers的推理中提供更快的速度,同时保持与最常用GPTQ设置相当或更好的质量。
AWQ模型目前支持Linux和Windows,仅限NVIDIA GPU。macOS用户:请使用GGUF模型。
AWQ模型由以下支持(注意并非所有这些都可能支持Mixtral模型 - 见上文):
可用仓库
提示模板:ChatML
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
提供的文件及AWQ参数
我目前仅发布128g GEMM模型。正在积极考虑添加group_size 32模型和GEMV内核模型。
模型以分片的安全张量文件发布。
请确保你使用的是最新版本的text-generation-webui。
除非你确定知道如何进行手动安装,否则强烈建议使用text-generation-webui的一键安装程序。
- 点击模型标签。
- 在下载自定义模型或LoRA下,输入
TheBloke/dolphin-2.7-mixtral-8x7b-AWQ
。
- 点击下载。
- 模型将开始下载。完成后会显示“完成”。
- 在左上角,点击刷新图标旁边的模型。
- 在模型下拉菜单中,选择你刚刚下载的模型:
dolphin-2.7-mixtral-8x7b-AWQ
- 选择Loader: AutoAWQ。
- 点击加载,模型将加载并准备使用。
- 如果你想要任何自定义设置,设置它们后点击保存此模型的设置,然后在右上角点击重新加载模型。
- 一旦你准备好了,点击文本生成标签并输入提示开始!
多用户推理服务器:vLLM
安装和使用vLLM的文档可以在这里找到。
- 请确保你使用的是vLLM版本0.2或更高。
- 当使用vLLM作为服务器时,传递
--quantization awq
参数。
例如:
python3 -m vllm.entrypoints.api_server --model TheBloke/dolphin-2.7-mixtral-8x7b-AWQ --quantization awq --dtype auto
- 当从Python代码使用vLLM时,同样设置
quantization=awq
。
例如:
from vllm import LLM, SamplingParams
prompts = [
"告诉我关于AI",
"写一个关于美洲驼的故事",
"291 - 150等于多少?",
"如果一只土拨鼠能扔木头,它能扔多少木头?",
]
prompt_template=f'''<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
'''
prompts = [prompt_template.format(prompt=prompt) for prompt in prompts]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(model="TheBloke/dolphin-2.7-mixtral-8x7b-AWQ", quantization="awq", dtype="auto")
outputs = llm.generate(prompts, sampling_params)
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"提示: {prompt!r}, 生成文本: {generated_text!r}")
多用户推理服务器:Hugging Face Text Generation Inference (TGI)
使用TGI版本1.1.0或更高。官方Docker容器是:ghcr.io/huggingface/text-generation-inference:1.1.0
示例Docker参数:
--model-id TheBloke/dolphin-2.7-mixtral-8x7b-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
示例Python代码用于与TGI交互(需要huggingface-hub 0.17.0或更高):
pip3 install huggingface-hub
from huggingface_hub import InferenceClient
endpoint_url = "https://your-endpoint-url-here"
prompt = "告诉我关于AI"
prompt_template=f'''<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
'''
client = InferenceClient(endpoint_url)
response = client.text_generation(prompt,
max_new_tokens=128,
do_sample=True,
temperature=0.7,
top_p=0.95,
top_k=40,
repetition_penalty=1.1)
print(f"模型输出: ", response)
使用Transformers从Python代码进行推理
安装必要的包
pip3 install --upgrade "autoawq>=0.1.6" "transformers>=4.35.0"
注意,如果你使用PyTorch 2.0.1,上述AutoAWQ命令将自动升级你到PyTorch 2.1.0。
如果你使用CUDA 11.8并希望继续使用PyTorch 2.0.1,改为运行以下命令:
pip3 install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.1.6/autoawq-0.1.6+cu118-cp310-cp310-linux_x86_64.whl
如果你在使用预构建的轮子安装AutoAWQ时遇到问题,请从源代码安装:
pip3 uninstall -y autoawq
git clone https://github.com/casper-hansen/AutoAWQ
cd AutoAWQ
pip3 install .
Transformers示例代码(需要