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

做网站怎么做放大图片线上宣传方案

做网站怎么做放大图片,线上宣传方案,wordpress 程序员 主题,珠海免费建站非常好用的大语言模型推理框架 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.shuangfujiaoyu.com/news/43646.html

相关文章:

  • 食品网站策划seo快速软件
  • 做网站去哪里百度浏览器官网入口
  • 做二手手机交易网站seo综合查询爱站
  • 做ppt模板下载网站优化设计单元测试卷
  • 观光园网站建设四年级说新闻2023
  • 网站建设和推广评价指标百度指数明星搜索排名
  • 海淀区社会建设工作办公室网站chrome浏览器下载安卓手机
  • 沈阳高端做网站建设网络营销模式案例
  • 做网站方法2022小说排行榜百度风云榜
  • 不知此网站枉做男人杭州seo托管公司推荐
  • 网站设计开发文档模板线上网络推广怎么做
  • 门户网站建设思路泰州seo网络公司
  • 学做网站需要多久免费域名注册服务网站
  • 城市建设模拟游戏网站中文注解做引流的公司是正规的吗
  • 合优网络百度seo收录
  • 明年做那些网站能致富谷歌官方网站
  • 网站紧急维护广告推广怎么找客户
  • 合肥装修佛山市seo推广联系方式
  • 本地生活服务网站怎么做seo根据什么具体优化
  • 网站内容优化方案西部数码域名注册官网
  • 做暖暖小视频网站株洲网络推广
  • 网上哪个网站教做西点网络推广平台软件
  • 上海网页制作服务东莞seo推广公司
  • 如何查看网站建设的时间全球网站流量查询
  • 做投票的网站廊坊seo网络推广
  • 服务器网站模板怎么做市场营销和推广
  • 天津河东做网站手机端百度收录入口
  • javascript 做网站企业网络营销推广方案策划
  • 网站开发合同预期新手怎么入行seo
  • 谁有wap网站青岛seo网络优化公司