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

做校招的网站有哪些app拉新项目一手渠道商

做校招的网站有哪些,app拉新项目一手渠道商,代做毕业设计的网站,国内物流公司网站建设非常好用的大语言模型推理框架 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.tj-hxxt.cn/news/20752.html

相关文章:

  • 左侧菜单设置设置 wordpress网站排名优化怎么做
  • 哪里有找工作的网站百度指数查询工具
  • wordpress图片特效插件优化网站排名茂名厂商
  • 怎么免费做网站不要域名如何让别人在百度上搜到自己公司
  • 深圳商城网站建设报价互联网广告
  • 丹阳市制作网站关于进一步优化落实疫情防控措施
  • 网站服务器速度市场营销的对象有哪些
  • 贵州建设厅监理协会网站什么是淘宝seo
  • 甘肃做网站的网络公司专业做网站公司
  • 网站开发寻找潜在客户的途径百度信息流推广和搜索推广
  • 动效网站怎么做外包网
  • 有网站可以接设计的单子做吗站长工具亚洲高清
  • 网站开发方式演进seo机构
  • 做暖暖视频网站有哪些自助发稿
  • 自己建设网站企业推广是什么意思
  • 做网站竞价没有点击率各大网站推广平台
  • wordpress页面提醒404南昌seo专业团队
  • 泉州自助建站软件网站制作app免费软件
  • facebook怎么推广网站仓山区seo引擎优化软件
  • 什么网站可以做设计赚钱的吗windows7优化大师官方下载
  • 网站维护技术百度框架户开户渠道代理
  • 黔西南州建设局网站推广app赚钱的平台
  • 公司网站无法打开百度退款客服电话
  • 网站编辑怎么做详细的营销推广方案
  • 网站建设淘宝评价线上推广渠道有哪些
  • 韩国网页设计公司网站谷歌排名
  • 做设计赚钱网站软件工程培训机构哪家好
  • 网站建设营销词app营销策略有哪些
  • 哪家招聘网站的猎头做的比较好网址生成短链接
  • 国外上国内网站很慢国外网站推广平台有哪些?