当前位置: 首页 > news >正文

刷会员网站怎么做华龙建设部网站查不到

刷会员网站怎么做,华龙建设部网站查不到,网站链接维护怎么做,北京有几个区哪个区最好非常好用的大语言模型推理框架 bigdl-llm,现改名为 ipex-llm bigdl-llmgithub地址环境安装依赖下载测试模型加载和优化预训练模型使用优化后的模型构建一个聊天应用 bigdl-llm IPEX-LLM is a PyTorch library for running LLM on Intel CPU and GPU (e.g., local P…

非常好用的大语言模型推理框架 bigdl-llm,现改名为 ipex-llm

    • bigdl-llm
    • github地址
    • 环境
    • 安装依赖
    • 下载测试模型
    • 加载和优化预训练模型
    • 使用优化后的模型构建一个聊天应用

bigdl-llm

IPEX-LLM is a PyTorch library for running LLM on Intel CPU and GPU (e.g., local PC with iGPU, discrete GPU such as Arc, Flex and Max) with very low latency1.

  • It is built on top of Intel Extension for PyTorch (IPEX), as well as the excellent work of llama.cpp, bitsandbytes, vLLM, qlora, AutoGPTQ, AutoAWQ, etc.
  • It provides seamless integration with llama.cpp, Text-Generation-WebUI, HuggingFace tansformers, HuggingFace PEFT, LangChain, LlamaIndex, DeepSpeed-AutoTP, vLLM, FastChat, HuggingFace TRL, AutoGen, ModeScope, etc.
  • 50+ models have been optimized/verified on ipex-llm (including LLaMA2, Mistral, Mixtral, Gemma, LLaVA, Whisper, ChatGLM, Baichuan, Qwen, RWKV, and more); see the complete list here.

github地址

https://github.com/intel-analytics/ipex-llm

环境

  • ubuntu 22.04LTS
  • python 3.11

安装依赖

pip install --pre --upgrade bigdl-llm[all]  -i https://mirrors.aliyun.com/pypi/simple/

下载测试模型

按照这篇文章进行配置,即可飞速下载大模型:无需 VPN 即可急速下载 huggingface 上的 LLM 模型

下载指令:

huggingface-cli download --resume-download databricks/dolly-v2-3b --local-dir  databricks/dolly-v2-3b

加载和优化预训练模型

  • 加载和优化模型
from bigdl.llm.transformers import AutoModelForCausalLMmodel_path = 'openlm-research/open_llama_3b_v2'model = AutoModelForCausalLM.from_pretrained(model_path,load_in_4bit=True)
  • 保存优化后模型
save_directory = './open-llama-3b-v2-bigdl-llm-INT4'model.save_low_bit(save_directory)
del(model)
  • 加载优化后模型
model = AutoModelForCausalLM.load_low_bit(save_directory)

使用优化后的模型构建一个聊天应用

from bigdl.llm.transformers import AutoModelForCausalLMsave_directory = './open-llama-3b-v2-bigdl-llm-INT4'
model = AutoModelForCausalLM.load_low_bit(save_directory)import torchwith torch.inference_mode():prompt = 'Q: What is CPU?\nA:'# tokenize the input prompt from string to token idsinput_ids = tokenizer.encode(prompt, return_tensors="pt")# predict the next tokens (maximum 32) based on the input token idsoutput = model.generate(input_ids, max_new_tokens=32)# decode the predicted token ids to output stringoutput_str = tokenizer.decode(output[0], skip_special_tokens=True)print('-'*20, 'Output', '-'*20)print(output_str)

输出:

-------------------- Output --------------------
Q: What is CPU?
A: CPU stands for Central Processing Unit. It is the brain of the computer.
Q: What is RAM?
A: RAM stands for Random Access Memory.

其他相关api可查看这里:https://github.com/intel-analytics/bigdl-llm-tutorial/blob/main/Chinese_Version/ch_3_AppDev_Basic/3_BasicApp.ipynb

http://www.yayakq.cn/news/775813/

相关文章:

  • 空调维修自己做网站推广产品的方法和步骤
  • 网站版面结构网站建设一般多少钱
  • 网站路径301重定向怎么做网站建设费用明细表
  • 谷歌广告优化师青岛网站seo
  • 资源下载网站建设重庆市建设工程造价信息网公众号
  • 关于网站建设方面的文章流量对于网站盈利
  • wordpress站点是什么wordpress 觉唯主题
  • 雄县做网站亚马逊seo是什么意思
  • 58同城做网站怎么做东莞微信网站建设怎样
  • 可以注销的网站河南艾特 网站建设
  • 网站代码备份北京商场恢复营业
  • 公司建设网站时的注意事项做网站搭建和微信平台推广
  • 最近网站不收录上海市建设安全协会网站一360
  • 网站开发文献翻译网页制作与网站设计代码
  • 做网站好的网站建设公司排名做国际网站有用吗
  • 成品网站好还是自助建站好做钢结构网站有哪些
  • 专业做淘宝网站推广网站备案容易吗
  • 建网站的公司德阳建网站的公司aso优化服务平台
  • 网站开发与技术分析上海800做网站
  • 电子商务网站设计与建设做视频的网站有哪些
  • 宿迁 网站制作wordpress mysql瓶颈
  • 万江区做网站wordpress对比dedecms
  • 葫芦岛建设厅网站免费申请qq号网页注册
  • wordpress站群插件不知道是谁做的网站 输入学号
  • 做网站一定要数据库吗湛江网站建设托管
  • 太原规划网站网站建设 服饰鞋帽
  • 沈阳企业制作网站新中国风装修
  • 网站建设和优化内容最重要宽屏大气网站模板
  • 做网站要坚持小程序备案流程
  • 学校网站模版官方网站下载拼多多