Qwen3 8b 192k Context 6X Josiefied Uncensored MLX AWQ 4bit
Qwen3-8B的4位AWQ量化版本,專為MLX庫優化,支持19.2萬詞元長上下文處理,適用於邊緣設備部署。
下載量 204
發布時間 : 5/15/2025
模型概述
基於Qwen3-8B的4位量化模型,通過MLX庫實現蘋果芯片高效推理,保留原模型核心能力的同時降低資源消耗。
模型特點
高效推理
4位量化使內存佔用較FP16降低約75%
長上下文支持
19.2萬詞元處理能力(標準版6倍)
蘋果芯片優化
通過MLX庫實現M1/M3芯片加速
邊緣設備部署
低資源消耗適合本地設備運行
模型能力
長文本生成
對話式交互
文檔分析
代碼生成
使用案例
研究
長上下文NLP實驗
支持超長文本序列的語言建模研究
模型壓縮研究
4位量化技術的效果驗證
開發
邊緣設備聊天機器人
在蘋果設備部署本地化對話系統
M3 Ultra實測112.8詞元/秒
長文檔處理
書籍/論文等長文本分析與摘要生成
企業應用
代碼生成
基於長上下文生成完整代碼片段
🚀 Qwen3-8B 4位AWQ量化版本
本項目是Qwen3-8B的4位AWQ量化版本,藉助MLX庫進行了高效推理優化。它專為處理長上下文任務(192k令牌)而設計,能在減少資源使用的同時,保留Qwen3-8B的核心能力,還支持在邊緣設備上部署。
🚀 快速開始
安裝
# 僅適用於蘋果硅芯片設備安裝MLX
pip install mlx
# 使用Hugging Face Transformers加載模型
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Goraint/Qwen3-8b-192k-Context-6X-Josiefied-Uncensored-MLX-AWQ-4bit", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("Goraint/Qwen3-8b-192k-Context-6X-Josiefied-Uncensored-MLX-AWQ-4bit")
示例用法
prompt = "Explain quantum computing in simple terms."
inputs = tokenizer(prompt, return_tensors="pt").to("mps")
outputs = model.generate(**inputs, max_length=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
✨ 主要特性
- 高效推理:4位量化與FP16相比,可減少約75%的內存佔用。
- 長上下文支持:支持192k令牌,適用於複雜任務,如文檔分析、代碼生成。
- 跨平臺:可在搭載蘋果硅芯片的macOS系統上運行,藉助MLX實現加速。
- 可定製提示:可調整提示模板,以兼容LM Studio等工具。
📦 安裝指南
# 僅適用於蘋果硅芯片設備安裝MLX
pip install mlx
# 使用Hugging Face Transformers加載模型
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Goraint/Qwen3-8b-192k-Context-6X-Josiefied-Uncensored-MLX-AWQ-4bit", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("Goraint/Qwen3-8b-192k-Context-6X-Josiefied-Uncensored-MLX-AWQ-4bit")
💻 使用示例
基礎用法
prompt = "Explain quantum computing in simple terms."
inputs = tokenizer(prompt, return_tensors="pt").to("mps")
outputs = model.generate(**inputs, max_length=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
📚 詳細文檔
概述
這是一個經過4位AWQ量化的Qwen3-8B版本,通過MLX庫進行了高效推理優化,旨在以較低的資源消耗處理長上下文任務(192k令牌)。在保留Qwen3-8B核心能力的同時,支持在邊緣設備上部署。
性能指標
指標 | 值 |
---|---|
模型大小 | ~4.38 GB(4位量化) |
推理速度 | 30.58令牌/秒(M1 MAX) 112.80令牌/秒(M3 ULTRA) gguf Q4_K_S:8.14令牌/秒(M1 MAX) |
上下文支持 | 192,000令牌 |
重要提示:LM Studio使用的提示模板
你需要修改提示模板,以確保與LM Studio的推理管道兼容。以下是所需的模板結構:
{%- if tools %}
{{- '\/system\n' }}
{%- if messages[0].role == 'system' %}
{{- messages[0].content + '\n\n' }}
{%- endif %}
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call>...</tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call>\n" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '\/system\n' + messages[0].content + '\/\n' }}
{%- endif %}
{%- endif %}
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
{%- for message in messages[::-1] %}
{%- set index = (messages|length - 1) - loop.index0 %}
{%- set tool_start = "ÔΩü" %}
{%- set tool_start_length = tool_start|length %}
{%- set start_of_message = message.content[:tool_start_length] %}
{%- set tool_end = "ÔΩ†" %}
{%- set tool_end_length = tool_end|length %}
{%- set start_pos = (message.content|length) - tool_end_length %}
{%- if start_pos < 0 %}
{%- set start_pos = 0 %}
{%- endif %}
{%- set end_of_message = message.content[start_pos:] %}
{%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
{%- set ns.multi_step_tool = false %}
{%- set ns.last_query_index = index %}
{%- endif %}
{%- endfor %}
{%- for message in messages %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
{{- '\/' + message.role + '\n' + message.content + '\/' + '\n' }}
{%- elif message.role == "assistant" %}
{%- set content = message.content %}
{%- set reasoning_content = '' %}
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
{%- set reasoning_content = message.reasoning_content %}
{%- else %}
{%- if '\/' in message.content %}
{%- set content = (message.content.split('\/')|last).lstrip('\n') %}
{%- set reasoning_content = (message.content.split('\/')|first).rstrip('\n') %}
{%- set reasoning_content = (reasoning_content.split('')|last).lstrip('\n') %}
{%- endif %}
{%- endif %}
{%- if loop.index0 > ns.last_query_index %}
{%- if loop.last or (not loop.last and reasoning_content) %}
{{- '\/' + message.role + '\n\n' + reasoning_content.strip('\n') + '\n\/\n' + content.lstrip('\n') }}
{%- else %}
{{- '\/' + message.role + '\n' + content }}
{%- endif %}
{%- else %}
{{- '\/' + message.role + '\n' + content }}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if (loop.first and content) or (not loop.first) %}
{{- '\n' }}
{%- endif %}
{%- if tool_call.function %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{%- if tool_call.arguments is string %}
{{- tool_call.arguments }}
{%- else %}
{{- tool_call.arguments | tojson }}
{%- endif %}
{{- '}\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '\/\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '\/user' }}
{%- endif %}
{{- '\nÔΩü\n' }}
{{- message.content }}
{{- '\nÔΩ†' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '\/\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '\/assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '
模型詳情
屬性 | 詳情 |
---|---|
基礎模型 | Qwen3-8B |
量化方式 | 通過MLX庫進行AWQ Q4(4位)量化 |
上下文長度 | 192,000令牌(比標準長6倍) |
庫 | MLX(針對蘋果硅芯片、macOS優化) |
許可證 | Apache 2.0 |
管道 | text-generation |
標籤 | not-for-all-audiences ,conversational ,mlx |
使用場景
- 研究:長上下文NLP實驗、模型壓縮研究。
- 開發:邊緣部署、具有擴展上下文的即時聊天機器人。
- 企業:用於文檔處理和代碼生成的經濟高效的AI解決方案。
偏差、風險與限制
潛在偏差
- 雖然在多樣化數據上進行訓練,但可能繼承社會偏差(如性別、文化假設)。
- “not-for-all-audiences”標籤表明可能生成敏感內容。
技術限制
- 4位量化可能會在複雜任務上略微降低準確性。
- 性能取決於硬件(MLX針對蘋果硅芯片進行了優化)。
緩解策略
- 審查輸出內容,檢查是否包含敏感信息。
- 在有監控的受控環境中使用。
環境影響
- 估計二氧化碳排放量:使用ML Impact Calculator計算
- 硬件:Apple M1 Pro(16GB RAM)
- 訓練時間:不適用(從預訓練模型進行量化)
社區與資源
- 文檔:Hugging Face文檔
- GitHub問題:報告錯誤或提出功能請求
- 論壇:Hugging Face討論區
🔧 技術細節
本模型是Qwen3-8B的4位AWQ量化版本,藉助MLX庫進行推理優化。4位量化減少了模型的內存佔用,使得在資源有限的設備上也能進行高效推理。MLX庫針對蘋果硅芯片和macOS系統進行了優化,提高了推理速度。同時,模型支持192k的上下文長度,適用於處理長文本任務。
📄 許可證
Apache 2.0
⚠️ 重要提示
此模型是社區貢獻,可能未得到阿里雲的官方支持。在生產環境中使用時,請始終驗證輸出的準確性和安全性。
Phi 2 GGUF
其他
Phi-2是微軟開發的一個小型但強大的語言模型,具有27億參數,專注於高效推理和高質量文本生成。
大型語言模型 支持多種語言
P
TheBloke
41.5M
205
Roberta Large
MIT
基於掩碼語言建模目標預訓練的大型英語語言模型,採用改進的BERT訓練方法
大型語言模型 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基礎模型的蒸餾版本,在保持相近性能的同時更輕量高效,適用於序列分類、標記分類等自然語言處理任務。
大型語言模型 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一個多語言大語言模型,針對多語言對話用例進行了優化,在常見的行業基準測試中表現優異。
大型語言模型 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基於100種語言的2.5TB過濾CommonCrawl數據預訓練的多語言模型,採用掩碼語言建模目標進行訓練。
大型語言模型 支持多種語言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基於Transformer架構的英語預訓練模型,通過掩碼語言建模目標在海量文本上訓練,支持文本特徵提取和下游任務微調
大型語言模型 英語
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI發佈的開放預訓練Transformer語言模型套件,參數量從1.25億到1750億,旨在對標GPT-3系列性能,同時促進大規模語言模型的開放研究。
大型語言模型 英語
O
facebook
6.3M
198
1
基於transformers庫的預訓練模型,適用於多種NLP任務
大型語言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多語言大語言模型系列,包含8B、70B和405B參數規模,支持8種語言和代碼生成,優化了多語言對話場景。
大型語言模型
Transformers 支持多種語言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基礎版是由Google開發的文本到文本轉換Transformer模型,參數規模2.2億,支持多語言NLP任務。
大型語言模型 支持多種語言
T
google-t5
5.4M
702
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98