模型概述
模型特點
模型能力
使用案例
🚀 MythoMax L2 13B - AWQ
本項目提供了 Gryphe 的 MythoMax L2 13B 模型的 AWQ 量化版本,能有效提升推理效率。
🚀 快速開始
從 vLLM 服務此模型
安裝和使用 vLLM 的文檔可點擊此處查看。
- 當使用 vLLM 作為服務器時,需傳遞
--quantization awq
參數,示例如下:
python3 python -m vllm.entrypoints.api_server --model TheBloke/MythoMax-L2-13B-AWQ --quantization awq
當從 Python 代碼中使用 vLLM 時,傳遞 quantization=awq
參數,示例如下:
from vllm import LLM, SamplingParams
prompts = [
"Hello, my name is",
"The president of the United States is",
"The capital of France is",
"The future of AI is",
]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
llm = LLM(model="TheBloke/MythoMax-L2-13B-AWQ", quantization="awq")
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}")
從 Python 代碼使用此 AWQ 模型
安裝必要的包
需要 AutoAWQ 0.0.2 或更高版本:
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/MythoMax-L2-13B-AWQ"
# Load model
model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
trust_remote_code=False, safetensors=True)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
prompt = "Tell me about AI"
prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{prompt}
### Response:
'''
print("\n\n*** Generate:")
tokens = tokenizer(
prompt_template,
return_tensors='pt'
).input_ids.cuda()
# Generate output
generation_output = model.generate(
tokens,
do_sample=True,
temperature=0.7,
top_p=0.95,
top_k=40,
max_new_tokens=512
)
print("Output: ", tokenizer.decode(generation_output[0]))
# Inference can also be done using transformers' pipeline
from transformers import pipeline
print("*** Pipeline:")
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.95,
top_k=40,
repetition_penalty=1.1
)
print(pipe(prompt_template)[0]['generated_text'])
✨ 主要特性
- 高效量化:採用 AWQ 量化方法,支持 4 位量化,相比 GPTQ 能提供更快的基於 Transformer 的推理。
- 多平臺支持:支持連續批處理服務器 vLLM,可在多用戶服務器場景中實現高吞吐量併發推理。
- 多格式可用:提供 AWQ、GPTQ、GGUF 等多種量化格式的模型文件,以及原始的未量化 fp16 模型。
📦 安裝指南
安裝 vLLM
安裝和使用 vLLM 的文檔可點擊此處查看。
安裝 AutoAWQ
pip3 install autoawq
若使用預構建的輪子安裝 AutoAWQ 時遇到問題,可從源代碼安裝:
pip3 uninstall -y autoawq
git clone https://github.com/casper-hansen/AutoAWQ
cd AutoAWQ
pip3 install .
📚 詳細文檔
模型信息
- 模型創建者:Gryphe
- 原始模型:MythoMax L2 13B
可用倉庫
- 用於 GPU 推理的 AWQ 模型
- 具有多種量化參數選項的 GPU 推理 GPTQ 模型
- 用於 CPU+GPU 推理的 2、3、4、5、6 和 8 位 GGUF 模型
- Gryphe 原始的未量化 fp16 格式 PyTorch 模型,用於 GPU 推理和進一步轉換
提示模板
{system_message}
### Instruction:
{prompt}
(For roleplay purposes, I suggest the following - Write <CHAR NAME>'s next reply in a chat between <YOUR NAME> and <CHAR NAME>. Write a single reply only.)
### Response:
提供的文件和 AWQ 參數
首次發佈的 AWQ 模型僅包含 128g 模型。若有需求,後續會考慮添加 32g 模型。目前 32g 模型尚未在 AutoAWQ 和 vLLM 中完全測試。 模型以分片的 safetensors 文件形式發佈。
分支 | 位數 | GS | AWQ 數據集 | 序列長度 | 大小 |
---|---|---|---|---|---|
main | 4 | 128 | wikitext | 4096 | 7.25 GB |
兼容性
提供的文件已測試可與 AutoAWQ 和 vLLM 配合使用。 Huggingface Text Generation Inference (TGI) 目前尚不支持 AWQ,但有一個 PR 正在處理中,預計很快會提供支持:TGI PR #781。
🔧 技術細節
模型合併原理
此模型是 MythoLogic-L2 和 Huginn 的合併模型,每個層由多個張量組成,這些張量負責特定功能。以 MythoLogic-L2 的強大理解能力為輸入,Huginn 的廣泛寫作能力為輸出,得到了在這兩方面都表現出色的模型。
量化方法
採用 AWQ 量化方法,這是一種高效、準確且快速的低比特權重量化方法,目前支持 4 位量化。
📄 許可證
源模型的創建者將其許可證列為 other
,因此此量化版本也使用相同的許可證。
由於該模型基於 Llama 2,它也受 Meta Llama 2 許可證條款的約束,相關許可證文件也已包含在內。因此,應認為該模型同時受這兩個許可證的約束。已聯繫 Hugging Face 以澄清雙重許可問題,但他們尚未有官方立場。若情況發生變化,或 Meta 對此情況提供任何反饋,將相應更新此部分內容。
有關許可的任何問題,特別是這兩個許可證如何相互作用的問題,應諮詢原始模型倉庫:Gryphe's MythoMax L2 13B。
Discord
如需進一步支持,或參與有關這些模型和 AI 的討論,歡迎加入: TheBloke AI 的 Discord 服務器
感謝與貢獻方式
感謝 chirper.ai 團隊! 感謝來自 gpus.llm-utils.org 的 Clay! 若您有能力且願意做出貢獻,將不勝感激,這將有助於持續提供更多模型,並開展新的 AI 項目。 捐贈者將在任何 AI/LLM/模型問題和請求上獲得優先支持,訪問私人 Discord 房間,以及其他福利。
- Patreon: https://patreon.com/TheBlokeAI
- Ko-Fi: https://ko-fi.com/TheBlokeAI
特別感謝:Aemon Algiz。 Patreon 特別提及:Alicia Loh、Stephen Murray 等眾多貢獻者。



