电商网站seo方案,网站怎么自己做优化,wordpress神级插件,东莞大岭山核酸检测点在 Windows 11 上通过 Autoawq 启动 Mixtral 8*7B 大语言模型 0. 背景1. 安装依赖2. 开发 main.py3. 运行 main.py 0. 背景
看了一些文章之后#xff0c;今天尝试在 Windows 11 上通过 Autoawq 启动 Mixtral 8*7B 大语言模型。
1. 安装依赖
pip install torch torchvision … 在 Windows 11 上通过 Autoawq 启动 Mixtral 8*7B 大语言模型 0. 背景1. 安装依赖2. 开发 main.py3. 运行 main.py 0. 背景
看了一些文章之后今天尝试在 Windows 11 上通过 Autoawq 启动 Mixtral 8*7B 大语言模型。
1. 安装依赖
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121pip install autoawq githttps://github.com/huggingface/transformers.gitpip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.2.post2-py3-none-win_amd64.whl
pip install https://github.com/bdashore3/flash-attention/releases/download/v2.4.1/flash_attn-2.4.1cu121torch2.1cxx11abiFALSE-cp310-cp310-win_amd64.whl2. 开发 main.py
from transformers import AutoModelForCausalLM,AutoTokenizer
from transformers import TextStreamer
model_id casperhansen/mixtral-instruct-awq
tokenizer AutoTokenizer.from_pretrained(model_id)
model AutoModelForCausalLM.from_pretrained(model_id,low_cpu_mem_usageTrue,device_mapauto,attn_implementationflash_attention_2)
streamer TextStreamer(tokenizer,skip_promptTrue,skip_special_tokensTrue)
text[INST] How to make the best cup of americano? [/INST]
tokens tokenizer(text,return_tensorspt).input_ids.to(cuda:0)
generation_output model.generate(tokens,streamerstreamer,max_new_tokens512)代码来自https://mp.weixin.qq.com/s/IAWJIh61_enYoyME3oJqJQ 3. 运行 main.py
python main.py输出结果示例 完成