Nanbeige4.1-3B代码实例:用pipeline接口封装推理服务,支持HTTP API调用
Nanbeige4.1-3B代码实例用pipeline接口封装推理服务支持HTTP API调用1. 引言如果你正在寻找一个既小巧又强大的开源语言模型Nanbeige4.1-3B绝对值得你花时间了解一下。这个只有30亿参数的模型在推理、代码生成和对话任务上的表现常常能给你带来惊喜。但模型本身再强大如果每次调用都要写一堆加载、分词、生成的代码那也太麻烦了。想象一下你开发了一个应用需要频繁调用模型来回答问题、生成代码或者处理长文本每次都去写那些重复的代码不仅效率低还容易出错。有没有一种方法能把模型封装成一个标准的服务像调用一个普通的Web API那样简单答案是肯定的。这篇文章我就带你一步步用Hugging Face的pipeline接口把Nanbeige4.1-3B封装成一个独立的推理服务并给它加上一个标准的HTTP API接口。这样一来无论是Python脚本、Web应用还是其他任何能发送HTTP请求的程序都能轻松调用这个模型。2. 为什么需要封装推理服务在直接动手写代码之前我们先聊聊为什么要把模型封装成服务。这不仅仅是“为了封装而封装”而是有实实在在的好处。2.1 传统调用方式的痛点我们先看看通常是怎么调用一个模型的import torch from transformers import AutoModelForCausalLM, AutoTokenizer # 1. 加载模型和分词器每次都要做耗时耗资源 model AutoModelForCausalLM.from_pretrained(...) tokenizer AutoTokenizer.from_pretrained(...) # 2. 准备输入 messages [{role: user, content: 你的问题}] input_ids tokenizer.apply_chat_template(...) # 3. 生成回复 outputs model.generate(...) # 4. 解码输出 response tokenizer.decode(...)这种方式有几个明显的问题资源浪费每次调用都要加载模型或者需要自己管理一个长期运行的模型实例代码复杂。耦合度高模型调用逻辑和你的业务代码紧紧绑在一起想换模型或者升级版本都很麻烦。难以复用其他语言比如JavaScript、Go写的程序很难直接调用你的Python代码。缺乏标准每个人封装的函数接口可能都不一样团队协作成本高。2.2 服务化封装的优势把模型封装成一个HTTP服务就像给你的模型装了一个标准的“插座”一次加载多次服务服务启动时加载一次模型之后所有请求都复用这个实例极大节省资源和时间。标准接口提供统一的HTTP API通常是RESTful风格任何能发送HTTP请求的客户端都能调用语言无关。解耦与复用业务代码不再关心模型加载和推理的细节只负责发送请求和接收结果。模型服务可以独立部署、升级和扩展。易于集成可以轻松集成到Web应用、移动App、自动化脚本或其他微服务中。集中管理方便进行日志记录、性能监控、权限控制和流量管理。简单来说服务化就是把模型的“黑盒子”能力通过一个标准的“窗口”暴露出来让调用变得简单、统一和高效。3. 项目准备与环境搭建好了道理讲清楚了我们开始动手。首先确保你有一个合适的环境。3.1 基础环境检查你需要一个Linux服务器比如Ubuntu 20.04或以上并且有NVIDIA GPU建议显存8GB以上因为模型加载就需要6GB。通过以下命令检查# 检查Python版本需要3.8以上 python3 --version # 检查CUDA是否可用如果你用GPU nvidia-smi # 检查pip版本 pip3 --version3.2 创建项目目录与虚拟环境为了环境干净我们创建一个独立的项目目录和Python虚拟环境。# 创建项目目录 mkdir nanbeige-api-service cd nanbeige-api-service # 创建虚拟环境这里用venv你也可以用conda python3 -m venv venv # 激活虚拟环境 source venv/bin/activate # 激活后命令行提示符前通常会出现 (venv)3.3 安装依赖包接下来安装必要的Python包。我们主要需要transformers来加载模型和使用pipeline需要torch作为深度学习框架还需要fastapi和uvicorn来构建HTTP服务。# 升级pip pip install --upgrade pip # 安装核心依赖 # 根据你的CUDA版本安装对应的torch例如CUDA 11.8 pip install torch2.0.1cu118 --index-url https://download.pytorch.org/whl/cu118 pip install transformers4.51.0 accelerate0.20.0 # 安装Web框架和服务器 pip install fastapi uvicorn # 可选用于处理CORS如果从浏览器调用API pip install pydantic安装完成后可以写一个简单的测试脚本确认transformers和torch能正常导入并且CUDA可用。# test_env.py import torch from transformers import __version__ as tf_version print(fTransformers version: {tf_version}) print(fPyTorch version: {torch.__version__}) print(fCUDA available: {torch.cuda.is_available()}) if torch.cuda.is_available(): print(fCUDA device: {torch.cuda.get_device_name(0)})运行它python test_env.py你应该能看到类似下面的输出确认环境OK。Transformers version: 4.51.0 PyTorch version: 2.0.1cu118 CUDA available: True CUDA device: NVIDIA GeForce RTX 40904. 核心实现用Pipeline封装模型推理环境准备好了现在进入核心部分——用pipeline来封装模型。pipeline是Hugging Facetransformers库提供的一个高级抽象它把模型加载、预处理分词、推理和后处理解码这些步骤打包成了一个简单的接口。4.1 创建模型服务类我们创建一个Python文件比如叫model_service.py在里面定义一个类来管理模型的生命周期。# model_service.py import torch from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM from typing import List, Dict, Any, Optional import logging logging.basicConfig(levellogging.INFO) logger logging.getLogger(__name__) class NanbeigeInferenceService: Nanbeige4.1-3B 模型推理服务封装类 使用 transformers pipeline 简化调用流程 def __init__(self, model_path: str, device: str auto): 初始化服务加载模型和分词器 Args: model_path: 模型本地路径例如 /root/ai-models/nanbeige/Nanbeige4___1-3B device: 设备类型auto自动选择, cudaGPU, cpu self.model_path model_path self.device device self.pipe None self.tokenizer None self.model None logger.info(f开始加载模型: {model_path}) self._load_model() logger.info(模型加载完成) def _load_model(self): 加载模型和分词器并创建pipeline try: # 1. 单独加载分词器用于后续的模板处理 self.tokenizer AutoTokenizer.from_pretrained( self.model_path, trust_remote_codeTrue ) # 2. 单独加载模型以便更精细地控制设备映射和数据类型 self.model AutoModelForCausalLM.from_pretrained( self.model_path, torch_dtypetorch.bfloat16, # 使用bfloat16节省显存 device_mapself.device, # 自动设备映射 trust_remote_codeTrue ) # 3. 创建text-generation pipeline # pipeline会自动处理tokenization和generation的细节 self.pipe pipeline( text-generation, modelself.model, tokenizerself.tokenizer, device_mapself.device ) except Exception as e: logger.error(f模型加载失败: {e}) raise def apply_chat_template(self, messages: List[Dict[str, str]]) - str: 将对话消息列表转换为模型需要的提示文本格式 Args: messages: 对话消息列表例如: [ {role: user, content: 你好}, {role: assistant, content: 你好有什么可以帮助你的}, {role: user, content: 介绍下你自己} ] Returns: 格式化后的提示文本 # 使用tokenizer内置的apply_chat_template方法 # 如果模型有特定的对话模板这里会自动应用 prompt self.tokenizer.apply_chat_template( messages, tokenizeFalse, # 不进行tokenize只返回文本 add_generation_promptTrue # 添加生成提示 ) return prompt def generate( self, messages: List[Dict[str, str]], max_new_tokens: int 512, temperature: float 0.6, top_p: float 0.95, do_sample: bool True, **kwargs ) - str: 生成文本回复 Args: messages: 对话消息列表 max_new_tokens: 最大生成token数 temperature: 温度参数控制随机性 (0.0-2.0) top_p: 核采样参数控制多样性 (0.0-1.0) do_sample: 是否使用采样 **kwargs: 其他生成参数 Returns: 模型生成的文本回复 # 1. 将消息转换为提示文本 prompt self.apply_chat_template(messages) # 2. 使用pipeline生成 # 注意pipeline的generate参数可能略有不同我们通过**kwargs传递 generation_config { max_new_tokens: max_new_tokens, temperature: temperature, top_p: top_p, do_sample: do_sample, **kwargs } try: # 调用pipeline进行生成 results self.pipe( prompt, **generation_config ) # 3. 提取生成的文本 # pipeline返回的是一个列表每个元素是一个字典 generated_text results[0][generated_text] # 4. 移除输入的prompt只返回新生成的部分 # 注意这里需要根据实际返回格式做调整 if generated_text.startswith(prompt): response generated_text[len(prompt):].strip() else: # 有些模型或模板可能返回的格式不同 response generated_text.strip() return response except Exception as e: logger.error(f文本生成失败: {e}) return f生成过程中出现错误: {str(e)} def batch_generate( self, messages_list: List[List[Dict[str, str]]], **kwargs ) - List[str]: 批量生成文本回复 Args: messages_list: 多个对话消息列表的列表 **kwargs: 生成参数 Returns: 模型生成的文本回复列表 prompts [self.apply_chat_template(msgs) for msgs in messages_list] try: results self.pipe(prompts, **kwargs) responses [] for prompt, result in zip(prompts, results): generated_text result[generated_text] if generated_text.startswith(prompt): response generated_text[len(prompt):].strip() else: response generated_text.strip() responses.append(response) return responses except Exception as e: logger.error(f批量生成失败: {e}) return [f生成错误: {str(e)}] * len(messages_list)这个服务类做了几件关键的事情初始化加载在__init__方法中一次性加载模型、分词器并创建pipeline。对话模板处理apply_chat_template方法负责把[{role: user, content: ...}]这样的对话列表转换成模型能理解的文本格式。单次生成generate方法是你最常用的输入对话历史和参数输出模型回复。批量生成batch_generate可以一次处理多个请求效率更高。4.2 编写测试脚本验证功能类写好了我们写个简单的测试脚本来验证它是否能正常工作。# test_service.py import sys sys.path.append(.) # 确保可以导入当前目录的模块 from model_service import NanbeigeInferenceService import time def main(): # 指定你的模型路径 MODEL_PATH /root/ai-models/nanbeige/Nanbeige4___1-3B print(正在初始化模型服务...) start_time time.time() # 创建服务实例这会加载模型耗时较长 service NanbeigeInferenceService( model_pathMODEL_PATH, deviceauto # 自动选择GPU或CPU ) load_time time.time() - start_time print(f模型加载完成耗时: {load_time:.2f} 秒) # 测试1: 简单问答 print(\n 测试1: 简单问答 ) messages [ {role: user, content: 请用一句话介绍你自己} ] response service.generate(messages, max_new_tokens100) print(f用户: {messages[0][content]}) print(f模型: {response}) # 测试2: 多轮对话 print(\n 测试2: 多轮对话 ) messages [ {role: user, content: Python里怎么读取文件}, {role: assistant, content: 在Python中可以使用open()函数来读取文件。基本语法是with open(filename.txt, r) as file: content file.read()}, {role: user, content: 那怎么写入文件呢} ] response service.generate(messages, max_new_tokens150) print(f最后一条用户消息: {messages[-1][content]}) print(f模型回复: {response}) # 测试3: 代码生成 print(\n 测试3: 代码生成 ) messages [ {role: user, content: 写一个Python函数计算列表的平均值} ] response service.generate( messages, max_new_tokens200, temperature0.3, # 温度调低让代码更确定 top_p0.9 ) print(f用户请求: {messages[0][content]}) print(f生成的代码:\n{response}) # 测试4: 批量生成 print(\n 测试4: 批量生成2个请求) messages_list [ [{role: user, content: 今天天气怎么样}], [{role: user, content: 讲一个简短的笑话}] ] responses service.batch_generate( messages_list, max_new_tokens50, temperature0.7 ) for i, (msg, resp) in enumerate(zip(messages_list, responses)): print(f批量请求 {i1}:) print(f 输入: {msg[0][content]}) print(f 输出: {resp}) print() if __name__ __main__: main()运行这个测试脚本python test_service.py如果一切正常你会看到模型加载的日志然后依次输出四个测试的结果。这证明我们的NanbeigeInferenceService类工作正常已经成功用pipeline封装了模型的推理能力。5. 构建HTTP API服务模型服务类准备好了但它现在还只是一个Python类只能在Python代码里调用。接下来我们用FastAPI给它套上一个HTTP的“外壳”让任何能发送HTTP请求的程序都能调用它。5.1 创建FastAPI应用FastAPI是一个现代、快速高性能的Web框架特别适合构建API。我们创建一个新的文件api_server.py。# api_server.py from fastapi import FastAPI, HTTPException from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel, Field from typing import List, Dict, Any, Optional import uvicorn import logging import sys sys.path.append(.) from model_service import NanbeigeInferenceService # 配置日志 logging.basicConfig( levellogging.INFO, format%(asctime)s - %(name)s - %(levelname)s - %(message)s ) logger logging.getLogger(__name__) # 定义请求和响应的数据模型使用Pydantic class Message(BaseModel): 单条消息 role: str Field(..., description消息角色如 user, assistant, system) content: str Field(..., description消息内容) class ChatRequest(BaseModel): 聊天请求体 messages: List[Message] Field(..., description对话消息列表) max_new_tokens: Optional[int] Field(512, ge1, le131072, description最大生成token数1-131072) temperature: Optional[float] Field(0.6, ge0.0, le2.0, description温度参数0.0-2.0) top_p: Optional[float] Field(0.95, ge0.0, le1.0, description核采样参数0.0-1.0) do_sample: Optional[bool] Field(True, description是否使用采样) stream: Optional[bool] Field(False, description是否使用流式输出) class BatchChatRequest(BaseModel): 批量聊天请求体 requests: List[ChatRequest] Field(..., description多个聊天请求列表) class ChatResponse(BaseModel): 聊天响应体 success: bool Field(..., description请求是否成功) response: str Field(..., description模型生成的回复) error: Optional[str] Field(None, description错误信息如果success为False) usage: Optional[Dict[str, Any]] Field(None, description使用量统计) class BatchChatResponse(BaseModel): 批量聊天响应体 success: bool Field(..., description整体请求是否成功) responses: List[ChatResponse] Field(..., description每个请求的响应列表) error: Optional[str] Field(None, description整体错误信息) # 创建FastAPI应用实例 app FastAPI( titleNanbeige4.1-3B API服务, description基于Nanbeige4.1-3B模型封装的HTTP API服务, version1.0.0 ) # 添加CORS中间件允许跨域请求方便前端调用 app.add_middleware( CORSMiddleware, allow_origins[*], # 生产环境应该指定具体域名 allow_credentialsTrue, allow_methods[*], allow_headers[*], ) # 全局模型服务实例 service None app.on_event(startup) async def startup_event(): 应用启动时加载模型 global service try: # 模型路径根据你的实际路径修改 MODEL_PATH /root/ai-models/nanbeige/Nanbeige4___1-3B logger.info(f正在启动模型服务加载模型: {MODEL_PATH}) service NanbeigeInferenceService( model_pathMODEL_PATH, deviceauto ) logger.info(模型服务启动完成API已就绪) except Exception as e: logger.error(f模型服务启动失败: {e}) raise app.get(/) async def root(): 根路径返回服务信息 return { service: Nanbeige4.1-3B API, status: running, model: Nanbeige4.1-3B, endpoints: { /chat: POST - 单次聊天, /batch_chat: POST - 批量聊天, /health: GET - 健康检查 } } app.get(/health) async def health_check(): 健康检查端点 if service is None: raise HTTPException(status_code503, detail服务未就绪) # 可以添加更详细的健康检查比如模型是否正常响应 try: # 快速测试一下模型 test_messages [{role: user, content: ping}] # 这里我们只是检查服务是否初始化不实际生成 return { status: healthy, model_loaded: True, service: Nanbeige4.1-3B API } except Exception as e: raise HTTPException(status_code503, detailf服务异常: {str(e)}) app.post(/chat, response_modelChatResponse) async def chat_completion(request: ChatRequest): 单次聊天补全端点 接收对话历史和生成参数返回模型回复 if service is None: raise HTTPException(status_code503, detail服务未就绪) try: logger.info(f收到聊天请求消息数: {len(request.messages)}) # 将Pydantic模型转换为普通字典列表 messages [{role: msg.role, content: msg.content} for msg in request.messages] # 调用模型服务生成回复 response_text service.generate( messagesmessages, max_new_tokensrequest.max_new_tokens, temperaturerequest.temperature, top_prequest.top_p, do_samplerequest.do_sample ) logger.info(f请求处理完成生成token数: {request.max_new_tokens}) return ChatResponse( successTrue, responseresponse_text, usage{ max_new_tokens: request.max_new_tokens, temperature: request.temperature, top_p: request.top_p } ) except Exception as e: logger.error(f聊天请求处理失败: {e}) return ChatResponse( successFalse, response, errorstr(e) ) app.post(/batch_chat, response_modelBatchChatResponse) async def batch_chat_completion(request: BatchChatRequest): 批量聊天补全端点 同时处理多个聊天请求返回多个回复 if service is None: raise HTTPException(status_code503, detail服务未就绪) try: logger.info(f收到批量聊天请求请求数: {len(request.requests)}) responses [] all_messages_list [] all_params [] # 准备批量请求的数据 for chat_request in request.requests: messages [{role: msg.role, content: msg.content} for msg in chat_request.messages] all_messages_list.append(messages) params { max_new_tokens: chat_request.max_new_tokens, temperature: chat_request.temperature, top_p: chat_request.top_p, do_sample: chat_request.do_sample } all_params.append(params) # 这里简化处理实际批量生成需要模型支持我们这里循环处理 # 如果你的模型和pipeline支持真正的批量生成可以改用service.batch_generate for i, (messages, params) in enumerate(zip(all_messages_list, all_params)): try: response_text service.generate( messagesmessages, max_new_tokensparams[max_new_tokens], temperatureparams[temperature], top_pparams[top_p], do_sampleparams[do_sample] ) responses.append(ChatResponse( successTrue, responseresponse_text, usage{ max_new_tokens: params[max_new_tokens], temperature: params[temperature], top_p: params[top_p] } )) except Exception as e: logger.error(f批量请求中第{i}个请求处理失败: {e}) responses.append(ChatResponse( successFalse, response, errorstr(e) )) return BatchChatResponse( successall(r.success for r in responses), responsesresponses ) except Exception as e: logger.error(f批量聊天请求处理失败: {e}) return BatchChatResponse( successFalse, responses[], errorstr(e) ) if __name__ __main__: # 启动服务 uvicorn.run( app, host0.0.0.0, # 监听所有网络接口 port8000, # 端口号 log_levelinfo )这个API服务提供了几个关键端点GET /根路径返回服务基本信息。GET /health健康检查用于监控服务状态。POST /chat最主要的聊天端点接收JSON格式的请求返回模型回复。POST /batch_chat批量聊天端点一次处理多个请求。5.2 启动API服务现在我们可以启动这个API服务了。在项目目录下运行python api_server.py你会看到类似下面的输出表示服务正在启动INFO: Started server process [12345] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRLC to quit)服务启动后会先加载模型这可能需要一些时间取决于你的硬件然后开始监听8000端口。5.3 测试API接口服务跑起来了我们怎么知道它工作正常呢有几种测试方法方法1使用curl命令测试打开另一个终端用curl发送测试请求# 测试健康检查 curl http://localhost:8000/health # 测试聊天接口 curl -X POST http://localhost:8000/chat \ -H Content-Type: application/json \ -d { messages: [ {role: user, content: 你好请介绍一下你自己} ], max_new_tokens: 100, temperature: 0.6 }方法2使用Python脚本测试创建一个测试脚本test_api.py# test_api.py import requests import json import time def test_single_chat(): 测试单次聊天接口 url http://localhost:8000/chat payload { messages: [ {role: user, content: 用Python写一个快速排序函数} ], max_new_tokens: 200, temperature: 0.3, top_p: 0.9, do_sample: True } print(发送单次聊天请求...) start_time time.time() response requests.post(url, jsonpayload) elapsed time.time() - start_time print(f请求耗时: {elapsed:.2f}秒) print(f状态码: {response.status_code}) if response.status_code 200: result response.json() print(f成功: {result[success]}) print(f回复内容:\n{result[response]}) print(f使用参数: {result.get(usage, {})}) else: print(f请求失败: {response.text}) def test_batch_chat(): 测试批量聊天接口 url http://localhost:8000/batch_chat payload { requests: [ { messages: [{role: user, content: 今天天气怎么样}], max_new_tokens: 50 }, { messages: [{role: user, content: 讲一个程序员的笑话}], max_new_tokens: 100 }, { messages: [{role: user, content: Python和JavaScript有什么区别}], max_new_tokens: 150 } ] } print(\n发送批量聊天请求3个请求...) start_time time.time() response requests.post(url, jsonpayload) elapsed time.time() - start_time print(f批量请求总耗时: {elapsed:.2f}秒) print(f状态码: {response.status_code}) if response.status_code 200: result response.json() print(f整体成功: {result[success]}) for i, resp in enumerate(result[responses]): print(f\n--- 请求 {i1} ---) print(f成功: {resp[success]}) if resp[success]: print(f回复: {resp[response][:100]}...) # 只显示前100字符 else: print(f错误: {resp[error]}) else: print(f请求失败: {response.text}) def test_health(): 测试健康检查接口 url http://localhost:8000/health print(测试健康检查接口...) response requests.get(url) print(f状态码: {response.status_code}) print(f响应: {response.json()}) if __name__ __main__: # 先测试健康检查 test_health() print(\n *50 \n) # 测试单次聊天 test_single_chat() print(\n *50 \n) # 测试批量聊天 test_batch_chat()运行测试脚本python test_api.py如果一切正常你会看到API服务正确处理了请求并返回了模型的生成结果。6. 总结到这里我们已经完成了一个完整的Nanbeige4.1-3B模型推理服务的封装。让我们回顾一下都做了些什么6.1 核心成果模型封装使用Hugging Face的pipeline接口将Nanbeige4.1-3B模型的加载、预处理、推理和后处理流程封装成了一个简洁的Python类NanbeigeInferenceService。这大大简化了模型调用代码。服务化暴露基于FastAPI框架为模型封装类添加了HTTP API接口提供了/chat和/batch_chat两个主要端点。现在任何能发送HTTP请求的客户端无论是Python、JavaScript、Java还是Go都能轻松调用这个模型。标准化接口定义了清晰的请求和响应数据格式使用Pydantic模型包括对话消息、生成参数等。这使得接口易于理解和使用也便于后续的维护和扩展。6.2 服务优势通过这种服务化封装我们获得了几个关键优势简化调用客户端只需要发送一个HTTP POST请求无需关心模型加载、GPU内存管理等复杂细节。语言无关服务可以通过任何编程语言调用方便集成到不同的技术栈中。资源高效模型在服务启动时只加载一次后续所有请求共享同一个模型实例节省了显存和加载时间。易于扩展可以在此基础上轻松添加更多功能比如流式输出、支持更多生成参数、添加认证和限流等。便于部署可以配合Docker容器化部署或者使用进程管理工具如Supervisor、systemd来保证服务稳定运行。6.3 后续扩展建议这个基础版本已经可用但你还可以根据实际需求进行扩展流式输出修改API支持Server-Sent EventsSSE实现打字机效果的流式回复提升用户体验。异步处理使用FastAPI的异步特性或者结合消息队列如Redis、RabbitMQ处理高并发请求。模型管理支持动态加载和切换多个模型或者实现模型的热更新。监控告警添加Prometheus指标暴露结合Grafana监控服务的QPS、响应时间、错误率等。认证授权为API添加API Key认证或OAuth2授权保护服务不被滥用。缓存优化对常见请求或生成结果进行缓存减少模型计算提升响应速度。6.4 完整项目结构最后我们来看一下完成后的项目结构nanbeige-api-service/ ├── model_service.py # 模型服务封装类 ├── api_server.py # FastAPI HTTP服务 ├── test_service.py # 模型服务测试脚本 ├── test_api.py # API接口测试脚本 ├── requirements.txt # 项目依赖可通过 pip freeze requirements.txt 生成 └── venv/ # Python虚拟环境目录你可以把整个项目目录打包部署到任何支持Python的服务器上。只需要安装依赖pip install -r requirements.txt然后运行python api_server.py一个生产可用的Nanbeige4.1-3B模型API服务就启动了。这个服务化方案不仅适用于Nanbeige4.1-3B其设计思路和代码结构可以很容易地适配到其他Hugging Face模型上。下次当你需要将一个大模型集成到你的应用中时不妨试试这种服务化的方式它会让你的开发工作变得更加简单和高效。获取更多AI镜像想探索更多AI镜像和应用场景访问 CSDN星图镜像广场提供丰富的预置镜像覆盖大模型推理、图像生成、视频生成、模型微调等多个领域支持一键部署。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2478379.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!