金属SLM 3D打印在医疗行业应用的意义

核心内容摘要

基于智能AI+微信小程序+推荐算法的数字博物馆系统设计与实现 计算机毕业设计实战开发
Flutter 组件 ntlm 适配鸿蒙 HarmonyOS 实战:攻克政企认证壁垒,构建稳健的企业级网络通信防线

赶deadline必备! 降AI率软件 千笔·专业降AIGC智能体 VS 万方智搜AI

今天开始将开å�¯ç³»åˆ—AI应用开å�‘课程主è¦�基äº�LangChain框æ�¶åŸºäº�å®�战项目手把手教大家如何将AI这一新时代的基础设施应用到自己开å�‘应用中æ�¥ã€‚当下在AI应用开å�‘领域LangChain框æ�¶å�¯ä»¥è¯´æ˜¯å”¯ä¸€é€‰æ‹©ã€‚ç„¶è€Œä¸Šæ‰‹å­¦ä¹ çš„å°�伙伴们大多被拦在了第一步没有å�¯ä¾›ä½¿ç”¨çš„AI大模å�‹åº•座没有å�¯ä¾›å®�验的ç�¯å¢ƒè¿›è¡Œå®�æ“�。而å�„大å�‚商比如OpenAIæ��供的API需è¦�付费ä¸�说ä»�注册ã€�开通到使用都有诸多的ä¸�便和é™�åˆ¶ã€‚å› æ­¤å¦‚ä½•åœ¨æœ¬åœ°æˆ–è€…ç§�有网络中部署和使用AI大模å�‹æˆ�为了一个亟待解决的挑战。本文将以Baichuan

B-Chat-4bits为例介�如何进行AI大模��有部署,用�LangChain开��验��。本次课程�纲如下今天主��大模�部署的部分。基础�境�境�置�安装

python

8�以上版本官网安装�� 地�https://www.python.org/

pytorch

12�以上版本��

0�以上版本官网安装�� 地�https://pytorch.org/get-started/locally/

建议使用CUDA

1

4å�Šä»¥ä¸Šæ ¹æ�®æ˜¾å�¡åŒ¹é…�英伟达æ�¨è��驱动进行暗转 地å�€https://developer.nvidia.com/cuda-

-download-archive

建议使用linux�境安装本文示例基�linux�境演示

�定以下动作执行的当�目录为/aidev模�下载�在LangChain开��境中部署AI大模�首先需�下载模�文件和�置文件。Baichuan

B-Chat-4bits模å�‹å·²ç»�ä¸Šä¼ åˆ°äº†huggingface这个知å��çš„AI模å�‹åº“中我们å�¯ä»¥é€šè¿‡ä»¥ä¸‹æ­¥éª¤æ�¥ä¸‹è½½å®ƒä»�huggingface上下载模å�‹å�Šé…�置文件模å�‹ä¸‹è½½é“¾æ�¥å¦‚下https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits在模�页�中点击�上角的Download按钮选择Download files选项。apt-get -y install -qq aria2 aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/config.json -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o config.json aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/configuration_baichuan.py -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o configuration_baichuan.py aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/generation_config.json -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o generation_config.json aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/generation_utils.py -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o generation_utils.py aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/handler.py -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o handler.py aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/modeling_baichuan.py -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o modeling_baichuan.py aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/resolve/main/pytorch_model.bin -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o pytorch_model.bin aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/quantizer.py -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o quantizer.py aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/requirements.txt -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o requirements.txt aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/special_tokens_map.json -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o special_tokens_map.json aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/tokenization_baichuan.py -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o tokenization_baichuan.py aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/resolve/main/tokenizer.model -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o tokenizer.model aria2c --console-log-levelerror -c -x 16 -s 16 -k 1M https://huggingface.co/baichuan-inc/Baichuan

B-Chat-4bits/raw/main/tokenizer_config.json -d /content/baichuan-inc/Baichuan

B-Chat-4bits -o tokenizer_config.json基础�赖安装下载好模�文件和�置文件�主目录为/aidev文件目录为baichuan-inc/Baichuan

B-Chat-4bits备注å��ç»­å�¯åŠ¨æ¨¡å�‹ä¼šé»˜è®¤åŠ è½½æ­¤ç›®å½•è¯·æŒ‰æ­¤å‘½å��我们还需è¦�安装一些基础的ä¾�赖库以便äº�在LangChainå¼€å�‘ç�¯å¢ƒä¸­è¿�行模å�‹ã€‚我们å�¯ä»¥é€šè¿‡ä»¥ä¸‹æ­¥éª¤æ�¥å®‰è£…#pip安装模å�‹è¿�行的ä¾�èµ–requirment.txt文件 pip install -r baichuan-inc/Baichuan

B-Chat-4bits/requirements.txtè¿™æ ·å°±å®Œæˆ�了基础ä¾�赖库的安装。模å�‹æµ‹è¯•安装好基础ä¾�赖库å��我们å�¯ä»¥å…ˆæµ‹è¯•一下模å�‹æ˜¯å�¦èƒ½å¤Ÿæ­£å¸¸è¿�行。我们å�¯ä»¥é€šè¿‡ä»¥ä¸‹æ­¥éª¤æ�¥æµ‹è¯•基äº�官方示例创建模å�‹å¯¹è±¡å¹¶è°ƒç”¨å¯¹è¯�方法在当å‰�目录å�³/aidev中创建一个å��为app.py的文件并输入以下内容import torch from transformers import AutoModelForCausalLM, AutoTokenizer from transformers.generation.utils import GenerationConfig tokenizer AutoTokenizer.from_pretrained(baichuan-inc/Baichuan

B-Chat-4bits, use_fastFalse, trust_remote_codeTrue) model AutoModelForCausalLM.from_pretrained(baichuan-inc/Baichuan

B-Chat-4bits, device_mapauto, torch_dtypetorch.bfloat16, trust_remote_codeTrue) model.generation_config GenerationConfig.from_pretrained(baichuan-inc/Baichuan

B-Chat-4bits) messages [] messages.append({role: user, content: 解释一下“温故而知新â€�}) response model.chat(tokenizer, messages) print(response)å�¯ç”¨æµ‹è¯•python app.pyè¿�行效æ�œå¦‚下图所示基äº�FastAPI创建模å�‹è®¿é—®æ�¥å�£ç¤ºä¾‹æµ‹è¯•好模å�‹å��我们已ç»�æ�Œæ�¡äº†ä¸�大模å�‹å¯¹è¯�的入å�£å�¯ä»¥è¿›ä¸€æ­¥åŸºäº�FastAPI创建一个模å�‹è®¿é—®æ�¥å�£è¿™æ ·å°±å�¯ä»¥è®©å¤–部的应用或者用户通过网络æ�¥è°ƒç”¨æˆ‘们部署在LangChainå¼€å�‘ç�¯å¢ƒä¸­çš„AI大模å�‹ã€‚我们å�¯ä»¥é€šè¿‡ä»¥ä¸‹æ­¥éª¤æ�¥åˆ›å»ºå®‰è£…uvicornpip install uvicorn在当å‰�目录å�³/aidev中创建一个å��为api.py的文件并输入以下内容from fastapi import FastAPI from fastapi import HTTPException from pydantic import BaseModel import torch from transformers import AutoModelForCausalLM, AutoTokenizer from transformers.generation.utils import GenerationConfig tokenizer AutoTokenizer.from_pretrained(baichuan-inc/Baichuan

B-Chat-4bits, use_fastFalse, trust_remote_codeTrue) model AutoModelForCausalLM.from_pretrained(baichuan-inc/Baichuan

B-Chat-4bits, device_mapauto, torch_dtypetorch.bfloat16, trust_remote_codeTrue) model.generation_config GenerationConfig.from_pretrained(baichuan-inc/Baichuan

B-Chat-4bits) app FastAPI() # This defines the data json format expected for the endpoint, change as needed class RequestItem(BaseModel): message: str app.post(/generate/) async def generate_text(request_item: RequestItem): try: # 在这里处��收到的 JSON 请求 reqStr request_item.message messages [] messages.append({role: user, content: reqStr}) response model.chat(tokenizer,messages) return {generated_text: response} except Exception as e: raise HTTPException(status_code500, detailstr(e))�动��uvicorn app:app --host

0.

0.

0 --port 8000 server.log 21 使用测试如下图所示总结本文介�了如何在LangChain开��境中准备AI大模��有部署的技术指�以Baichuan

B-Chat-4bits为例分别介ç»�了模å�‹ä¸‹è½½ã€�基础ä¾�赖安装ã€�模å�‹æµ‹è¯•和基äº�FastAPI创建模å�‹è®¿é—®æ�¥å�£çš„æ­¥éª¤å’Œä»£ç �。当然å�ªæ˜¯ç®€å�•çš„æ��供对è¯�æ�¥å�£çš„è¯�è¿˜æ— æ³•å°†å¤§æ¨¡å�‹æ�¥å…¥langchain的开å�‘æµ�程中。想入门 AI 大模å�‹å�´æ‰¾ä¸�到清晰方å�‘备考大å�‚ AI 岗还在四处æ�œé›†é›¶æ•£èµ„料别å†�浪费时间啦2026 å¹´AI 大模å�‹å…¨å¥—å­¦ä¹ èµ„æ–™å·²æ•´ç�†å®Œæ¯•ä»�å­¦ä¹ è·¯çº¿åˆ°é�¢è¯•真题ä»�工具教程到行业报告一站å¼�è¦†ç›–ä½ çš„æ‰€æœ‰éœ€æ±‚ç�°åœ¨å…¨éƒ¨å…�费分享扫ç �å…�费领å�–全部内容​一ã€�å­¦ä¹ å¿…å¤‡100本大模å�‹ç”µå­�书26 份行业报告 600 套技术PPTå¸®ä½ çœ‹é€� AI 趋势想了解大模å�‹çš„行业动æ€�ã€�商业è�½åœ°æ¡ˆä¾‹å¤§æ¨¡å�‹ç”µå­�ä¹¦è¿™ä»½èµ„æ–™å¸®ä½ ç«™åœ¨ “行业高度â€� å­¦ AI

100本大模�方�电�书

26 ä»½è¡Œä¸šç ”ç©¶æŠ¥å‘Šè¦†ç›–å¤šé¢†åŸŸå®�è·µä¸�趋势报告包å�«é˜¿é‡Œã€�DeepSeek ç­‰æ�ƒå¨�机æ�„å�‘å¸ƒçš„æ ¸å¿ƒå†…å®¹æ¶µç›–è�Œä¸šè¶‹åŠ¿ã€ŠAI è�Œä¸šè¶‹åŠ¿æŠ¥å‘Šã€‹ã€Šä¸­å›½ AI 人æ‰�粮仓模å�‹è§£æ��》商业è�½åœ°ã€Šç”Ÿæˆ�å¼� AI 商业è�½åœ°ç™½çš®ä¹¦ã€‹ã€ŠAI Agent 应用è�½åœ°æŠ€æœ¯ç™½çš®ä¹¦ã€‹é¢†åŸŸç»†åˆ†ã€ŠAGI 在金è��领域的应用报告》《AI GC å®�践案例集》行业监测《2024 年中国大模å�‹å­£åº¦ç›‘测报告》《2025 年中国技术市场å�‘展趋势》。

600套技术大会 PPT�行业大咖讲�战PPT 整�自

年热门技术大会包å�«ç™¾åº¦ã€�腾讯ã€�字节等ä¼�业的一线å®�践安全方å�‘《端侧大模å�‹çš„安全建设》《大模å�‹é©±åЍ安免å�‡çº§è…¾è®¯ä»£ç �安全å®�践》产å“�ä¸�创新《大模å�‹äº§å“�如何创新ä¸�创收》《AI 时代的新范å¼�æ�„建 AI 产å“�》多模æ€�ä¸� Agent《Step-Video å¼€æº�模å�‹è§†é¢‘生æˆ�进展》《Agentic RAG çš„ç�°åœ¨ä¸�未æ�¥ã€‹å·¥ç¨‹è�½åœ°ã€Šä»�å�Ÿå�‹åˆ°ç”Ÿäº§AgentOps åŠ é€Ÿå­—èŠ‚ AI 应用è�½åœ°ã€‹ã€Šæ™ºèƒ½ä»£ç �助手 CodeFuse çš„æ�¶æ�„设计》。二ã€�求è�Œå¿…看大å�‚ AI å²—é�¢è¯• “弹è�¯åº“â€�300 真题 107 é�“é�¢ç»�ç›´æ�¥æŠ±èµ°æƒ³å†²å­—节ã€�腾讯ã€�阿里ã€�蔚æ�¥ç­‰å¤§å�‚ AI 岗这份é�¢è¯•èµ„æ–™å¸®ä½ æ��å‰� “押题â€�æ‹’ç»�临场慌

107 �大���覆盖 Prompt�RAG�大模�应用工程师等热门岗���整�自

年真��试场景包� TPlink�字节�腾讯�蔚��虾皮�中兴�科大讯��京东等�业的高频考题��题都附带�路解�

102 é�“ AI 大模å�‹çœŸé¢˜ç›´å‡»å¤§æ¨¡å�‹æ ¸å¿ƒè€ƒç‚¹é’ˆå¯¹å¤§æ¨¡å�‹ä¸“å±�考题ä»�概念到å®�践全é�¢è¦†ç›–å¸®ä½ ç�†æ¸…底层逻辑

97 é�“ LLMs 真题è�šç„¦å¤§å�‹è¯­è¨€æ¨¡å�‹é«˜é¢‘问题专门拆解 LLMs çš„æ ¸å¿ƒç—›ç‚¹ä¸�解决方案比如让很多人头疼的 “å¤�读机问题â€�三ã€�路线必æ˜� AI 大模å�‹å­¦ä¹ 路线图1 å¼ å›¾ç�†æ¸…æ ¸å¿ƒå†…å®¹åˆšæ�¥è§¦ AI 大模å�‹ä¸�知é�“该ä»�哪学起这份「AI大模å�‹ å­¦ä¹ è·¯çº¿å›¾ã€�ç›´æ�¥å¸®ä½ 划é‡�点ä¸�用å†�盲目摸索路线图涵盖 5 å¤§æ ¸å¿ƒæ�¿å�—ä»�åŸºç¡€åˆ°è¿›é˜¶å±‚å±‚é€’è¿›ä¸€æ­¥æ­¥å¸¦ä½ ä»�入门到进阶ä»�ç�†è®ºåˆ°å®�战。L1阶段:å�¯èˆªç¯‡ä¸¨æ��é€Ÿç ´ç•ŒAI新时代L1阶段了解大模å�‹çš„基础知识以å�Šå¤§æ¨¡å�‹åœ¨å�„个行业的应用和分æ��å­¦ä¹ ç�†è§£å¤§æ¨¡å�‹çš„æ ¸å¿ƒå�Ÿç�†ã€�关键技术以å�Šå¤§æ¨¡å�‹åº”用场景。L2阶段攻å�šç¯‡ä¸¨RAGå¼€å�‘å®�战工å�ŠL2阶段AI大模å�‹RAG应用开å�‘工程主è¦�å­¦ä¹ RAG检索å¢�强生æˆ�包括Naive RAGã€�Advanced-RAG以å�ŠRAG性能评估还有GraphRAG在内的多个RAG热门项目的分æ��。L3阶段跃è¿�篇丨Agent智能体æ�¶æ�„设计L3阶段大模å�‹Agent应用æ�¶æ�„进阶å®�ç�°ä¸»è¦�å­¦ä¹ LangChainã€� LIamaIndex框æ�¶ä¹Ÿä¼šå­¦ä¹ 到AutoGPTã€� MetaGPT等多Agentç³»ç»Ÿæ‰“é€ Agent智能体。L4阶段精进篇丨模å�‹å¾®è°ƒä¸�ç§�有化部署L4阶段大模å�‹çš„微调和ç§�æœ‰åŒ–éƒ¨ç½²æ›´åŠ æ·±å…¥çš„æ�¢è®¨Transformeræ�¶æ�„å­¦ä¹ å¤§æ¨¡å�‹çš„微调技术利用DeepSpeedã€�Lamam Factory等工具快速进行模å�‹å¾®è°ƒå¹¶é€šè¿‡Ollamaã€�vLLMç­‰æ�¨ç�†éƒ¨ç½²æ¡†æ�¶å®�ç�°æ¨¡å�‹çš„快速部署。L5阶段专题集丨特训篇 ã€�录播课】四ã€�资料领å�–全套内容å…�费抱走学 AI ä¸�用å†�找第二份ä¸�ç®¡ä½ æ˜¯ 0 基础想入门 AI 大模å�‹è¿˜æ˜¯æœ‰åŸºç¡€æƒ³å†²åˆºå¤§å�‚ã€�äº†è§£è¡Œä¸šè¶‹åŠ¿è¿™ä»½èµ„æ–™éƒ½èƒ½æ»¡è¶³ä½ ç�°åœ¨å�ªéœ€æŒ‰ç…§æ��示æ“�作就能å…�费领å�–扫ç �å…�费领å�–全部内容​2026 年想抓ä½� AI 大模å�‹çš„é£�å�£åˆ«çŠ¹è±«è¿™ä»½å…�è´¹èµ„æ–™å°±æ˜¯ä½ çš„ “起跑线â€�

唐伯虎9.1免费版观看在线-唐伯虎9.1免费版观看在线应用

百度百家号客服电话人工服务

123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123 123