<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Library on 中文AI术语词典</title><link>https://terms-en.ai-term-hub.com/zh/tags/library/</link><description>Recent content in Library on 中文AI术语词典</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 18 Jul 2026 11:44:45 +0000</lastBuildDate><atom:link href="https://terms-en.ai-term-hub.com/zh/tags/library/index.xml" rel="self" type="application/rss+xml"/><item><title>Unsloth</title><link>https://terms-en.ai-term-hub.com/zh/terms/unsloth/</link><pubDate>Sat, 18 Jul 2026 11:37:39 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/unsloth/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>Unsloth 是一款专为优化大语言模型（LLM）的微调和部署而设计的工具。它通过替换标准的 PyTorch 操作，实现了显著的速度提升和内存占用减少。&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>Unsloth 是一个开源库，通过优化的内存管理和内核实现，将大语言模型（LLM）的训练和推理速度提升高达 2 倍。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>内存优化&lt;/li>
&lt;li>自定义内核&lt;/li>
&lt;li>LLM 微调&lt;/li>
&lt;li>加速推理&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>在有限的 GPU 资源下微调 LLM&lt;/li>
&lt;li>加速推理流水线&lt;/li>
&lt;li>降低训练时的云计算成本&lt;/li>
&lt;/ul>
&lt;h2 id="code-example">Code Example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> unsloth &lt;span style="color:#f92672">import&lt;/span> FastLanguageModel
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model, tokenizer &lt;span style="color:#f92672">=&lt;/span> FastLanguageModel&lt;span style="color:#f92672">.&lt;/span>from_pretrained(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> model_name&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;unsloth/Llama-2-7b-bnb-4bit&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> max_seq_length&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">2048&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> dtype&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">None&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> load_in_4bit&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">True&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/lora-%E4%BD%8E%E7%A7%A9%E9%80%82%E5%BA%94/">LoRA (低秩适应)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/pytorch-%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E6%A1%86%E6%9E%B6/">PyTorch (深度学习框架)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/hugging-face-%E6%A8%A1%E5%9E%8B%E7%A4%BE%E5%8C%BA%E5%B9%B3%E5%8F%B0/">Hugging Face (模型社区平台)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/flash-attention-%E9%AB%98%E6%95%88%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6/">Flash Attention (高效注意力机制)&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Vllm</title><link>https://terms-en.ai-term-hub.com/zh/terms/vllm/</link><pubDate>Sat, 18 Jul 2026 11:37:39 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/vllm/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>vLLM（Virtual Large Language Model）是一个旨在加速 LLM 服务的开源库。它引入了 PagedAttention，这是一种受操作系统虚拟内存&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>vLLM 是一个高吞吐量且内存高效的 LLM 推理引擎，利用 PagedAttention 优化 GPU 内存使用。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>PagedAttention&lt;/li>
&lt;li>KV Cache 管理&lt;/li>
&lt;li>推理服务&lt;/li>
&lt;li>吞吐量优化&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>高并发 API 服务&lt;/li>
&lt;li>批处理推理处理&lt;/li>
&lt;li>具有成本效益的 LLM 部署&lt;/li>
&lt;/ul>
&lt;h2 id="code-example">Code Example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> vllm &lt;span style="color:#f92672">import&lt;/span> LLM, SamplingParams
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>llm &lt;span style="color:#f92672">=&lt;/span> LLM(model&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;facebook/opt-125m&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>prompts &lt;span style="color:#f92672">=&lt;/span> [&lt;span style="color:#e6db74">&amp;#34;Hello, my name is&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;The capital of France is&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sampling_params &lt;span style="color:#f92672">=&lt;/span> SamplingParams(temperature&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">0.8&lt;/span>, top_p&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">0.95&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>outputs &lt;span style="color:#f92672">=&lt;/span> llm&lt;span style="color:#f92672">.&lt;/span>generate(prompts, sampling_params)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/tensorrt-nvidia-%E6%8E%A8%E7%90%86%E4%BC%98%E5%8C%96%E5%BA%93/">TensorRT (NVIDIA 推理优化库)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/tgi-%E6%96%87%E6%9C%AC%E7%94%9F%E6%88%90%E6%8E%A8%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8/">TGI (文本生成推理服务器)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/pagedattention-%E5%88%86%E9%A1%B5%E6%B3%A8%E6%84%8F%E5%8A%9B%E6%9C%BA%E5%88%B6/">PagedAttention (分页注意力机制)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/llm-serving-llm-%E6%9C%8D%E5%8A%A1%E5%8C%96/">LLM Serving (LLM 服务化)&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Stable Diffusion Diffusers</title><link>https://terms-en.ai-term-hub.com/zh/terms/stable_diffusion_diffusers/</link><pubDate>Sat, 18 Jul 2026 11:35:05 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/stable_diffusion_diffusers/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>Diffusers库是Hugging Face推出的一个开源工具包，旨在简化预训练扩散模型（特别是Stable Diffusion）的使用。它提供了模块化的管道（pipelines），处理从加载模型、预处理输入到后处理输出的整个流程。该库支持多种框架（如PyTorch和JAX），并允许用户轻松地进行模型微调（fine-tuning）和自定义推理配置，极大地降低了使用先进扩散模型的技术门槛。&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>一个Hugging Face库，提供用于运行和微调Stable Diffusion模型的标准化管理流程。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>Hugging Face&lt;/li>
&lt;li>管道抽象&lt;/li>
&lt;li>微调&lt;/li>
&lt;li>模型互操作性&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>图像生成器的快速原型开发&lt;/li>
&lt;li>自定义模型微调&lt;/li>
&lt;li>扩散过程的教育演示&lt;/li>
&lt;/ul>
&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/hugging-face-hub-hugging-face%E6%A8%A1%E5%9E%8B%E4%BB%93%E5%BA%93/">Hugging Face Hub (Hugging Face模型仓库)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/pytorch-%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0%E6%A1%86%E6%9E%B6/">PyTorch (深度学习框架)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/transformers-library-hugging-face%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E5%A4%84%E7%90%86%E5%BA%93/">Transformers Library (Hugging Face自然语言处理库)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/model-cards-%E6%A8%A1%E5%9E%8B%E5%8D%A1%E7%89%87-%E6%96%87%E6%A1%A3/">Model Cards (模型卡片/文档)&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>模型中心 Mixin</title><link>https://terms-en.ai-term-hub.com/zh/terms/model_hub_mixin/</link><pubDate>Sat, 18 Jul 2026 11:26:24 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/model_hub_mixin/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>Mixin 提供了保存、加载和推送模型到 Hugging Face Hub 等通用方法，无需每种模型架构单独实现这些工具。它们确保了代码的一致性和可维护性。&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>模型中心 Mixin 是一个可重用的类组件，用于为 Hugging Face Transformers 模型添加标准化功能。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>代码可重用性&lt;/li>
&lt;li>Hugging Face 生态系统&lt;/li>
&lt;li>标准化 API&lt;/li>
&lt;li>继承&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>创建自定义模型架构&lt;/li>
&lt;li>将新模型集成到 Hub&lt;/li>
&lt;li>跨项目共享模型工具&lt;/li>
&lt;/ul>
&lt;h2 id="code-example">Code Example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> transformers.modeling_utils &lt;span style="color:#f92672">import&lt;/span> PreTrainedModel
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">MyModel&lt;/span>(PreTrainedModel): &lt;span style="color:#66d9ef">pass&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/hugging-face-hub-hugging-face-%E6%A8%A1%E5%9E%8B%E4%B8%AD%E5%BF%83/">Hugging Face Hub (Hugging Face 模型中心)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/transformers-library-transformers-%E5%BA%93/">Transformers Library (Transformers 库)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/pytorch-modules-pytorch-%E6%A8%A1%E5%9D%97/">PyTorch Modules (PyTorch 模块)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/model-saving-%E6%A8%A1%E5%9E%8B%E4%BF%9D%E5%AD%98/">Model Saving (模型保存)&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Diffusers</title><link>https://terms-en.ai-term-hub.com/zh/terms/diffusers/</link><pubDate>Sat, 18 Jul 2026 11:14:55 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/diffusers/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>Hugging Face Diffusers 是一个模块化工具包，旨在简化扩散模型的使用。它为文本生成图像、图像修复和超分辨率等任务提供了预训练管道。&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>Hugging Face 生态系统中的一个库，提供了用于图像、音频和文本生成的最先进的扩散模型实现。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>管道抽象&lt;/li>
&lt;li>预训练模型&lt;/li>
&lt;li>去噪过程&lt;/li>
&lt;li>社区中心&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>构建创意 AI 艺术应用&lt;/li>
&lt;li>实现图像编辑工具&lt;/li>
&lt;li>快速原型开发生成式功能&lt;/li>
&lt;/ul>
&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/stable-diffusion/">Stable Diffusion&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/hugging-face/">Hugging Face&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/%E6%BD%9C%E5%9C%A8%E6%89%A9%E6%95%A3-latent-diffusion/">潜在扩散 (Latent Diffusion)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/%E7%94%9F%E6%88%90%E5%BC%8F-ai-generative-ai/">生成式 AI (Generative AI)&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Transformers库</title><link>https://terms-en.ai-term-hub.com/zh/terms/transformers/</link><pubDate>Sat, 18 Jul 2026 10:55:40 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/transformers/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>术语“Transformers”通常指由Hugging Face维护的广泛使用的Python库。它为下载、训练和部署基于Transformer架构的预训练模型提供了易于使用的接口。&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>在此语境下，指Hugging Face Transformers库，这是一个流行的开源工具包，用于最先进的NLP和多模态模型。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>Hugging Face Hub&lt;/li>
&lt;li>Pipeline API&lt;/li>
&lt;li>Model Cards&lt;/li>
&lt;li>分词器集成&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>NLP应用的快速原型开发&lt;/li>
&lt;li>访问社区预训练模型&lt;/li>
&lt;li>标准化模型部署工作流&lt;/li>
&lt;/ul>
&lt;h2 id="code-example">Code Example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> transformers &lt;span style="color:#f92672">import&lt;/span> pipeline
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>classifier &lt;span style="color:#f92672">=&lt;/span> pipeline(&lt;span style="color:#e6db74">&amp;#39;sentiment-analysis&amp;#39;&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/hugging_face-hugging-face%E5%B9%B3%E5%8F%B0/">hugging_face (Hugging Face平台)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/pipeline-%E6%B5%81%E6%B0%B4%E7%BA%BFapi/">pipeline (流水线API)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/tokenizer-%E5%88%86%E8%AF%8D%E5%99%A8/">tokenizer (分词器)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/pytorch-pytorch%E6%A1%86%E6%9E%B6/">pytorch (PyTorch框架)&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>