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

【人工智能】Transformers之Pipeline(概述):30w+大模型极简应用

​​​​​​​

目录

一、引言 

二、pipeline库

2.1 概述

2.2 使用task实例化pipeline对象

2.2.1 基于task实例化“自动语音识别”

2.2.2 task列表

2.2.3 task默认模型

2.3 使用model实例化pipeline对象

2.3.1 基于model实例化“自动语音识别”

 2.3.2 查看model与task的对应关系

三、总结


一、引言 

 pipeline(管道)是huggingface transformers库中一种极简方式使用大模型推理的抽象,将所有大模型分为语音(Audio)、计算机视觉(Computer vision)、自然语言处理(NLP)、多模态(Multimodal)等4大类,28小类任务(tasks)。共计覆盖32万个模型

本文对pipeline进行整体介绍,之后本专栏以每个task为主题,分别介绍各种task使用方法。

二、pipeline库

2.1 概述

管道是一种使用模型进行推理的简单而好用的方法。这些管道是从库中抽象出大部分复杂代码的对象,提供了专用于多项任务的简单 API,包括命名实体识别、掩码语言建模、情感分析、特征提取和问答。在使用上,主要有2种方法

  • 使用task实例化pipeline对象
  • 使用model实例化pipeline对象

2.2 使用task实例化pipeline对象

2.2.1 基于task实例化“自动语音识别”

自动语音识别的task为automatic-speech-recognition:

import os
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
os.environ["CUDA_VISIBLE_DEVICES"] = "2"from transformers import pipelinespeech_file = "./output_video_enhanced.mp3"
pipe = pipeline(task="automatic-speech-recognition")
result = pipe(speech_file)
print(result)

2.2.2 task列表

task共计28类,按首字母排序,列表如下,直接替换2.2.1代码中的pipeline的task即可应用:

  • "audio-classification":将返回一个AudioClassificationPipeline。
  • "automatic-speech-recognition":将返回一个AutomaticSpeechRecognitionPipeline。
  • "depth-estimation":将返回一个DepthEstimationPipeline。
  • "document-question-answering":将返回一个DocumentQuestionAnsweringPipeline。
  • "feature-extraction":将返回一个FeatureExtractionPipeline。
  • "fill-mask":将返回一个FillMaskPipeline:。
  • "image-classification":将返回一个ImageClassificationPipeline。
  • "image-feature-extraction":将返回一个ImageFeatureExtractionPipeline。
  • "image-segmentation":将返回一个ImageSegmentationPipeline。
  • "image-to-image":将返回一个ImageToImagePipeline。
  • "image-to-text":将返回一个ImageToTextPipeline。
  • "mask-generation":将返回一个MaskGenerationPipeline。
  • "object-detection":将返回一个ObjectDetectionPipeline。
  • "question-answering":将返回一个QuestionAnsweringPipeline。
  • "summarization":将返回一个SummarizationPipeline。
  • "table-question-answering":将返回一个TableQuestionAnsweringPipeline。
  • "text2text-generation":将返回一个Text2TextGenerationPipeline。
  • "text-classification"("sentiment-analysis"可用别名):将返回一个 TextClassificationPipeline。
  • "text-generation":将返回一个TextGenerationPipeline:。
  • "text-to-audio""text-to-speech"可用别名):将返回一个TextToAudioPipeline:。
  • "token-classification"("ner"可用别名):将返回一个TokenClassificationPipeline。
  • "translation":将返回一个TranslationPipeline。
  • "translation_xx_to_yy":将返回一个TranslationPipeline。
  • "video-classification":将返回一个VideoClassificationPipeline。
  • "visual-question-answering":将返回一个VisualQuestionAnsweringPipeline。
  • "zero-shot-classification":将返回一个ZeroShotClassificationPipeline。
  • "zero-shot-image-classification":将返回一个ZeroShotImageClassificationPipeline。
  • "zero-shot-audio-classification":将返回一个ZeroShotAudioClassificationPipeline。
  • "zero-shot-object-detection":将返回一个ZeroShotObjectDetectionPipeline。

2.2.3 task默认模型

针对每一个task,pipeline默认配置了模型,可以通过pipeline源代码查看:

SUPPORTED_TASKS = {"audio-classification": {"impl": AudioClassificationPipeline,"tf": (),"pt": (AutoModelForAudioClassification,) if is_torch_available() else (),"default": {"model": {"pt": ("superb/wav2vec2-base-superb-ks", "372e048")}},"type": "audio",},"automatic-speech-recognition": {"impl": AutomaticSpeechRecognitionPipeline,"tf": (),"pt": (AutoModelForCTC, AutoModelForSpeechSeq2Seq) if is_torch_available() else (),"default": {"model": {"pt": ("facebook/wav2vec2-base-960h", "55bb623")}},"type": "multimodal",},"text-to-audio": {"impl": TextToAudioPipeline,"tf": (),"pt": (AutoModelForTextToWaveform, AutoModelForTextToSpectrogram) if is_torch_available() else (),"default": {"model": {"pt": ("suno/bark-small", "645cfba")}},"type": "text",},"feature-extraction": {"impl": FeatureExtractionPipeline,"tf": (TFAutoModel,) if is_tf_available() else (),"pt": (AutoModel,) if is_torch_available() else (),"default": {"model": {"pt": ("distilbert/distilbert-base-cased", "935ac13"),"tf": ("distilbert/distilbert-base-cased", "935ac13"),}},"type": "multimodal",},"text-classification": {"impl": TextClassificationPipeline,"tf": (TFAutoModelForSequenceClassification,) if is_tf_available() else (),"pt": (AutoModelForSequenceClassification,) if is_torch_available() else (),"default": {"model": {"pt": ("distilbert/distilbert-base-uncased-finetuned-sst-2-english", "af0f99b"),"tf": ("distilbert/distilbert-base-uncased-finetuned-sst-2-english", "af0f99b"),},},"type": "text",},"token-classification": {"impl": TokenClassificationPipeline,"tf": (TFAutoModelForTokenClassification,) if is_tf_available() else (),"pt": (AutoModelForTokenClassification,) if is_torch_available() else (),"default": {"model": {"pt": ("dbmdz/bert-large-cased-finetuned-conll03-english", "f2482bf"),"tf": ("dbmdz/bert-large-cased-finetuned-conll03-english", "f2482bf"),},},"type": "text",},"question-answering": {"impl": QuestionAnsweringPipeline,"tf": (TFAutoModelForQuestionAnswering,) if is_tf_available() else (),"pt": (AutoModelForQuestionAnswering,) if is_torch_available() else (),"default": {"model": {"pt": ("distilbert/distilbert-base-cased-distilled-squad", "626af31"),"tf": ("distilbert/distilbert-base-cased-distilled-squad", "626af31"),},},"type": "text",},"table-question-answering": {"impl": TableQuestionAnsweringPipeline,"pt": (AutoModelForTableQuestionAnswering,) if is_torch_available() else (),"tf": (TFAutoModelForTableQuestionAnswering,) if is_tf_available() else (),"default": {"model": {"pt": ("google/tapas-base-finetuned-wtq", "69ceee2"),"tf": ("google/tapas-base-finetuned-wtq", "69ceee2"),},},"type": "text",},"visual-question-answering": {"impl": VisualQuestionAnsweringPipeline,"pt": (AutoModelForVisualQuestionAnswering,) if is_torch_available() else (),"tf": (),"default": {"model": {"pt": ("dandelin/vilt-b32-finetuned-vqa", "4355f59")},},"type": "multimodal",},"document-question-answering": {"impl": DocumentQuestionAnsweringPipeline,"pt": (AutoModelForDocumentQuestionAnswering,) if is_torch_available() else (),"tf": (),"default": {"model": {"pt": ("impira/layoutlm-document-qa", "52e01b3")},},"type": "multimodal",},"fill-mask": {"impl": FillMaskPipeline,"tf": (TFAutoModelForMaskedLM,) if is_tf_available() else (),"pt": (AutoModelForMaskedLM,) if is_torch_available() else (),"default": {"model": {"pt": ("distilbert/distilroberta-base", "ec58a5b"),"tf": ("distilbert/distilroberta-base", "ec58a5b"),}},"type": "text",},"summarization": {"impl": SummarizationPipeline,"tf": (TFAutoModelForSeq2SeqLM,) if is_tf_available() else (),"pt": (AutoModelForSeq2SeqLM,) if is_torch_available() else (),"default": {"model": {"pt": ("sshleifer/distilbart-cnn-12-6", "a4f8f3e"), "tf": ("google-t5/t5-small", "d769bba")}},"type": "text",},# This task is a special case as it's parametrized by SRC, TGT languages."translation": {"impl": TranslationPipeline,"tf": (TFAutoModelForSeq2SeqLM,) if is_tf_available() else (),"pt": (AutoModelForSeq2SeqLM,) if is_torch_available() else (),"default": {("en", "fr"): {"model": {"pt": ("google-t5/t5-base", "686f1db"), "tf": ("google-t5/t5-base", "686f1db")}},("en", "de"): {"model": {"pt": ("google-t5/t5-base", "686f1db"), "tf": ("google-t5/t5-base", "686f1db")}},("en", "ro"): {"model": {"pt": ("google-t5/t5-base", "686f1db"), "tf": ("google-t5/t5-base", "686f1db")}},},"type": "text",},"text2text-generation": {"impl": Text2TextGenerationPipeline,"tf": (TFAutoModelForSeq2SeqLM,) if is_tf_available() else (),"pt": (AutoModelForSeq2SeqLM,) if is_torch_available() else (),"default": {"model": {"pt": ("google-t5/t5-base", "686f1db"), "tf": ("google-t5/t5-base", "686f1db")}},"type": "text",},"text-generation": {"impl": TextGenerationPipeline,"tf": (TFAutoModelForCausalLM,) if is_tf_available() else (),"pt": (AutoModelForCausalLM,) if is_torch_available() else (),"default": {"model": {"pt": ("openai-community/gpt2", "6c0e608"), "tf": ("openai-community/gpt2", "6c0e608")}},"type": "text",},"zero-shot-classification": {"impl": ZeroShotClassificationPipeline,"tf": (TFAutoModelForSequenceClassification,) if is_tf_available() else (),"pt": (AutoModelForSequenceClassification,) if is_torch_available() else (),"default": {"model": {"pt": ("facebook/bart-large-mnli", "c626438"),"tf": ("FacebookAI/roberta-large-mnli", "130fb28"),},"config": {"pt": ("facebook/bart-large-mnli", "c626438"),"tf": ("FacebookAI/roberta-large-mnli", "130fb28"),},},"type": "text",},"zero-shot-image-classification": {"impl": ZeroShotImageClassificationPipeline,"tf": (TFAutoModelForZeroShotImageClassification,) if is_tf_available() else (),"pt": (AutoModelForZeroShotImageClassification,) if is_torch_available() else (),"default": {"model": {"pt": ("openai/clip-vit-base-patch32", "f4881ba"),"tf": ("openai/clip-vit-base-patch32", "f4881ba"),}},"type": "multimodal",},"zero-shot-audio-classification": {"impl": ZeroShotAudioClassificationPipeline,"tf": (),"pt": (AutoModel,) if is_torch_available() else (),"default": {"model": {"pt": ("laion/clap-htsat-fused", "973b6e5"),}},"type": "multimodal",},"image-classification": {"impl": ImageClassificationPipeline,"tf": (TFAutoModelForImageClassification,) if is_tf_available() else (),"pt": (AutoModelForImageClassification,) if is_torch_available() else (),"default": {"model": {"pt": ("google/vit-base-patch16-224", "5dca96d"),"tf": ("google/vit-base-patch16-224", "5dca96d"),}},"type": "image",},"image-feature-extraction": {"impl": ImageFeatureExtractionPipeline,"tf": (TFAutoModel,) if is_tf_available() else (),"pt": (AutoModel,) if is_torch_available() else (),"default": {"model": {"pt": ("google/vit-base-patch16-224", "3f49326"),"tf": ("google/vit-base-patch16-224", "3f49326"),}},"type": "image",},"image-segmentation": {"impl": ImageSegmentationPipeline,"tf": (),"pt": (AutoModelForImageSegmentation, AutoModelForSemanticSegmentation) if is_torch_available() else (),"default": {"model": {"pt": ("facebook/detr-resnet-50-panoptic", "fc15262")}},"type": "multimodal",},"image-to-text": {"impl": ImageToTextPipeline,"tf": (TFAutoModelForVision2Seq,) if is_tf_available() else (),"pt": (AutoModelForVision2Seq,) if is_torch_available() else (),"default": {"model": {"pt": ("ydshieh/vit-gpt2-coco-en", "65636df"),"tf": ("ydshieh/vit-gpt2-coco-en", "65636df"),}},"type": "multimodal",},"object-detection": {"impl": ObjectDetectionPipeline,"tf": (),"pt": (AutoModelForObjectDetection,) if is_torch_available() else (),"default": {"model": {"pt": ("facebook/detr-resnet-50", "2729413")}},"type": "multimodal",},"zero-shot-object-detection": {"impl": ZeroShotObjectDetectionPipeline,"tf": (),"pt": (AutoModelForZeroShotObjectDetection,) if is_torch_available() else (),"default": {"model": {"pt": ("google/owlvit-base-patch32", "17740e1")}},"type": "multimodal",},"depth-estimation": {"impl": DepthEstimationPipeline,"tf": (),"pt": (AutoModelForDepthEstimation,) if is_torch_available() else (),"default": {"model": {"pt": ("Intel/dpt-large", "e93beec")}},"type": "image",},"video-classification": {"impl": VideoClassificationPipeline,"tf": (),"pt": (AutoModelForVideoClassification,) if is_torch_available() else (),"default": {"model": {"pt": ("MCG-NJU/videomae-base-finetuned-kinetics", "4800870")}},"type": "video",},"mask-generation": {"impl": MaskGenerationPipeline,"tf": (),"pt": (AutoModelForMaskGeneration,) if is_torch_available() else (),"default": {"model": {"pt": ("facebook/sam-vit-huge", "997b15")}},"type": "multimodal",},"image-to-image": {"impl": ImageToImagePipeline,"tf": (),"pt": (AutoModelForImageToImage,) if is_torch_available() else (),"default": {"model": {"pt": ("caidas/swin2SR-classical-sr-x2-64", "4aaedcb")}},"type": "image",},
}

2.3 使用model实例化pipeline对象

2.3.1 基于model实例化“自动语音识别”

如果不想使用task中默认的模型,可以指定huggingface中的模型:

import os
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
os.environ["CUDA_VISIBLE_DEVICES"] = "2"from transformers import pipelinespeech_file = "./output_video_enhanced.mp3"
#transcriber = pipeline(task="automatic-speech-recognition", model="openai/whisper-medium")
pipe = pipeline(model="openai/whisper-medium")
result = pipe(speech_file)
print(result)

 2.3.2 查看model与task的对应关系

可以登录https://huggingface.co/tasks查看

三、总结

本文为transformers之pipeline专栏的第0篇,后面会以每个task为一篇,共计讲述28+个tasks的用法,通过28个tasks的pipeline使用学习,可以掌握语音、计算机视觉、自然语言处理、多模态乃至强化学习等30w+个huggingface上的开源大模型。让你成为大模型领域的专家!

期待您的3连+关注,如何还有时间,欢迎阅读我的其他文章:

《AI—工程篇》

AI智能体研发之路-工程篇(一):Docker助力AI智能体开发提效

AI智能体研发之路-工程篇(二):Dify智能体开发平台一键部署

AI智能体研发之路-工程篇(三):大模型推理服务框架Ollama一键部署

AI智能体研发之路-工程篇(四):大模型推理服务框架Xinference一键部署

AI智能体研发之路-工程篇(五):大模型推理服务框架LocalAI一键部署

《AI—模型篇》

AI智能体研发之路-模型篇(一):大模型训练框架LLaMA-Factory在国内网络环境下的安装、部署及使用

AI智能体研发之路-模型篇(二):DeepSeek-V2-Chat 训练与推理实战

AI智能体研发之路-模型篇(三):中文大模型开、闭源之争

AI智能体研发之路-模型篇(四):一文入门pytorch开发

AI智能体研发之路-模型篇(五):pytorch vs tensorflow框架DNN网络结构源码级对比

AI智能体研发之路-模型篇(六):【机器学习】基于tensorflow实现你的第一个DNN网络

AI智能体研发之路-模型篇(七):【机器学习】基于YOLOv10实现你的第一个视觉AI大模型

AI智能体研发之路-模型篇(八):【机器学习】Qwen1.5-14B-Chat大模型训练与推理实战

AI智能体研发之路-模型篇(九):【机器学习】GLM4-9B-Chat大模型/GLM-4V-9B多模态大模型概述、原理及推理实战

《AI—Transformers应用》

【AI大模型】Transformers大模型库(一):Tokenizer

【AI大模型】Transformers大模型库(二):AutoModelForCausalLM

【AI大模型】Transformers大模型库(三):特殊标记(special tokens)

【AI大模型】Transformers大模型库(四):AutoTokenizer

【AI大模型】Transformers大模型库(五):AutoModel、Model Head及查看模型结构

相关文章:

【人工智能】Transformers之Pipeline(概述):30w+大模型极简应用

​​​​​​​ 目录 一、引言 二、pipeline库 2.1 概述 2.2 使用task实例化pipeline对象 2.2.1 基于task实例化“自动语音识别” 2.2.2 task列表 2.2.3 task默认模型 2.3 使用model实例化pipeline对象 2.3.1 基于model实例化“自动语音识别” 2.3.2 查看model与task…...

Jenkins中Node节点与构建任务

目录 节点在 Jenkins 中的主要作用 1. 分布式构建 分布式处理 负载均衡 2. 提供不同的运行环境 多平台支持 特殊环境需求 3. 提高资源利用率 动态资源管理 云端集成 4. 提供隔离和安全性 任务隔离 权限控制 5. 提高可扩展性 横向扩展 高可用性 Jenkins 主服务…...

Leetcode3200. 三角形的最大高度

Every day a Leetcode 题目来源:3200. 三角形的最大高度 解法1:模拟 枚举第一行是红色还是蓝色,再按题意模拟即可。 代码: /** lc appleetcode.cn id3200 langcpp** [3200] 三角形的最大高度*/// lc codestart class Solutio…...

docker运行nginx挂载前端html页面步骤

1.常用docker命令 1.docker ps -a 查看所有容器 2.docker ps查看存活的容器 3.docker rm 删除容器 4.docker stop 停止容器运行 5.docker logs 容器id 查看容器日志 6.docker images 查看镜像 7.docker rmi 删除镜像 8.docker exec nginx nginx -s reload 重新加载conf文件…...

kafka部署以及常用命令详细总结

1环境准备 1.1ip规划 ip: 192.168.1.200 1.2配置主机名 #设置主机名 hostnamectl set-hostname node11.3配置hosts [rootnode1 ~]# cat >> /etc/hosts << EOF192.168.1.200 node1 EOF2部署 2.1安装包准备 将以下安装包从官网下载到本地 jdk-8u371-linux-x6…...

代码随想录算法训练营第29天|LeetCode 134. 加油站、135. 分发糖果、860.柠檬水找零、406.根据身高重建队列

1. LeetCode 134. 加油站 题目链接&#xff1a;https://leetcode.cn/problems/gas-station/description/ 文章链接&#xff1a;https://programmercarl.com/0134.加油站.html 视频链接&#xff1a;https://www.bilibili.com/video/BV1jA411r7WX 思路&#xff1a; 贪心&#xff…...

代理模式(大话设计模式)C/C++版本

代理模式 C #include <iostream> using namespace std;class Subject // Subject 定义了RealSubject和Proxy的共用接口..这样就在任何使用RealSubject的地方都可以使用Proxy { public:virtual void func(){cout << "Subject" << endl;} };class R…...

本人学习保存-macOS打开Navicat提示「“Navicat Premium”已损坏,无法打开。 你应该将它移到废纸篓。」的解决方法

新安装了macOS Ventura&#xff0c;打开Navicat Premium&#xff0c;发现会提示&#xff1a; “Navicat Premium”已损坏&#xff0c;无法打开。 你应该将它移到废纸篓。 遇到这种情况&#xff0c;千万别直接移到废纸篓&#xff0c;是有办法解决的。在这里记录一下解决方案。 …...

《Cross-Image Pixel Contrasting for Semantic Segmentation》论文解读

期刊&#xff1a;TPAMI 年份&#xff1a;2024 摘要 研究图像语义分割问题。目前的方法主要集中在通过专门设计的上下文聚合模块(如空洞卷积、神经注意力)或结构感知的优化目标(如iou样损失)挖掘"局部"上下文&#xff0c;即单个图像中像素之间的依赖关系。然而&…...

技术周总结 2024.07.08~07.14(算法,Python,Java,Scala,PHP)

文章目录 一、07.13 周六1.0&#xff09;算法题&#xff1a;字符串中的单词反转1.1&#xff09; 问题01:可靠性计算中的MTTR MTTF MTBF 分别指什么&#xff1f;他们之间有什么联系&#xff1f;MTTR (Mean Time to Repair)MTTF (Mean Time to Failure)MTBF (Mean Time Between F…...

UnityECS学习中问题及总结entityQuery.ToComponentDataArray和entityQuery.ToEntityArray区别

在Unity的ECS&#xff08;Entity Component System&#xff09;开发中&#xff0c;entityQuery.ToComponentDataArray<T>(Allocator.Temp) 和 entityQuery.ToEntityArray(Allocator.Temp) 是两种不同的方法&#xff0c;用于从实体查询中获取数据。除了泛型参数之外&#…...

[python]基于yolov10+gradio目标检测演示系统设计

【设计介绍】 YOLOv10结合Gradio实现目标检测系统设计是一个结合了最新目标检测技术和快速部署框架的项目。下面将详细介绍这一系统的设计和实现过程。 一、YOLOv10介绍 YOLOv10是YOLO&#xff08;You Only Look Once&#xff09;系列的最新版本&#xff0c;由清华大学的研究…...

浏览器开发者视角及CSS表达式选择元素

点击想要查看的接口&#xff0c;然后点击检查&#xff0c;便可以切换到该接口对应的html代码 如果F12不起作用的话&#xff0c;点击更多工具&#xff0c;然后选择开发者工具即可 ctrlF可以去查阅相关的CSS表达式选择元素 如果没有加#t1&#xff0c;那么表示的是选择所有的p 使用…...

GuLi商城-商品服务-API-品牌管理-统一异常处理

每个方法都加这段校验太麻烦了 准备做一个统一异常处理@ControllerAdvice 后台代码: package com.nanjing.gulimall.product.exception;import com.nanjing.common.exception.BizCodeEnum; import com.nanjing.common.utils.R; import lombok.extern.slf4j.Slf4j; import org…...

VUE+Spring Flux实现SSE长连接

VUE代码 // 初始化EventSourceinitEventSource(url) {const token getAccessToken();const eventSource new EventSourcePolyfill(url, {headers: {Authorization: Bearer ${token},tenant-id: getTenantId(),}});eventSource.onerror (e) > {console.log("SSE连接错…...

C#实现Winform程序右下角弹窗消息提示

前言 消息通知在应用程序中&#xff0c;是一种非常有用的功能&#xff0c;实现对一些重要信息、提醒或警告及时向用户展示。我们在使用软件时&#xff0c;通常会收到一种从桌面右下角弹出的&#xff08;提示信息或广告&#xff09;信息框。本文将介绍使用 C# 实现此种方式的信息…...

Java三剑客:封装、继承、多态的魔法世界

第一章&#xff1a;封装的艺术 —— 保护你的宝藏 案例分析&#xff1a;银行账户系统 想象一下&#xff0c;你正在构建一个银行账户系统。每个账户都有一个余额&#xff0c;这个余额需要受到严格的保护&#xff0c;不能被随意修改。我们可以通过封装来实现这一目标。 示例代…...

0145__Linux的capability

https://zhuanlan.zhihu.com/p/693896673 Linux的capability深入分析&#xff08;1&#xff09;_linux 设置进程capprm-CSDN博客 cap_init(3) - Linux manual page...

# Redis 入门到精通(一)数据类型(4)

Redis 入门到精通&#xff08;一&#xff09;数据类型&#xff08;4&#xff09; 一、redis 数据类型–sorted_set实现时效性任务管理 1、sorted_set 类型数据操作的注意事项 score 保存的数据存储空间是64位&#xff0c;如果是整数范围是-9007199254740992~9007199254740992…...

西邮计科嵌入式复习

西邮嵌入式复习 一、第一章复习二、第二章复习三、第三章复习四、第四章复习 一、第一章复习 二、第二章复习 三、第三章复习 四、第四章复习...

浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)

✅ 一、ECS 服务配置 Dockerfile 确保监听 80 端口 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]或 EXPOSE 80 CMD ["python3", "-m", "http.server", "80"]任务定义&#xff08;Task Definition&…...

华为云AI开发平台ModelArts

华为云ModelArts&#xff1a;重塑AI开发流程的“智能引擎”与“创新加速器”&#xff01; 在人工智能浪潮席卷全球的2025年&#xff0c;企业拥抱AI的意愿空前高涨&#xff0c;但技术门槛高、流程复杂、资源投入巨大的现实&#xff0c;却让许多创新构想止步于实验室。数据科学家…...

AI-调查研究-01-正念冥想有用吗?对健康的影响及科学指南

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; 目前2025年06月05日更新到&#xff1a; AI炼丹日志-28 - Aud…...

Docker 离线安装指南

参考文章 1、确认操作系统类型及内核版本 Docker依赖于Linux内核的一些特性&#xff0c;不同版本的Docker对内核版本有不同要求。例如&#xff0c;Docker 17.06及之后的版本通常需要Linux内核3.10及以上版本&#xff0c;Docker17.09及更高版本对应Linux内核4.9.x及更高版本。…...

Python爬虫实战:研究feedparser库相关技术

1. 引言 1.1 研究背景与意义 在当今信息爆炸的时代,互联网上存在着海量的信息资源。RSS(Really Simple Syndication)作为一种标准化的信息聚合技术,被广泛用于网站内容的发布和订阅。通过 RSS,用户可以方便地获取网站更新的内容,而无需频繁访问各个网站。 然而,互联网…...

UDP(Echoserver)

网络命令 Ping 命令 检测网络是否连通 使用方法: ping -c 次数 网址ping -c 3 www.baidu.comnetstat 命令 netstat 是一个用来查看网络状态的重要工具. 语法&#xff1a;netstat [选项] 功能&#xff1a;查看网络状态 常用选项&#xff1a; n 拒绝显示别名&#…...

Go 语言接口详解

Go 语言接口详解 核心概念 接口定义 在 Go 语言中&#xff0c;接口是一种抽象类型&#xff0c;它定义了一组方法的集合&#xff1a; // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的&#xff1a; // 矩形结构体…...

MVC 数据库

MVC 数据库 引言 在软件开发领域,Model-View-Controller(MVC)是一种流行的软件架构模式,它将应用程序分为三个核心组件:模型(Model)、视图(View)和控制器(Controller)。这种模式有助于提高代码的可维护性和可扩展性。本文将深入探讨MVC架构与数据库之间的关系,以…...

C++中string流知识详解和示例

一、概览与类体系 C 提供三种基于内存字符串的流&#xff0c;定义在 <sstream> 中&#xff1a; std::istringstream&#xff1a;输入流&#xff0c;从已有字符串中读取并解析。std::ostringstream&#xff1a;输出流&#xff0c;向内部缓冲区写入内容&#xff0c;最终取…...

Java 二维码

Java 二维码 **技术&#xff1a;**谷歌 ZXing 实现 首先添加依赖 <!-- 二维码依赖 --><dependency><groupId>com.google.zxing</groupId><artifactId>core</artifactId><version>3.5.1</version></dependency><de…...